Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg.
Add missing _() so all strings can be internationalized.
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index ff24b42..9320c25 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-20 Theodore Ts'o <tytso@mit.edu>
+
+ * unix.c (usage, parse_extended_opts): Clean up messages printed
+ by e2fsck for grammer and consistency.
+
2005-06-19 Theodore Ts'o <tytso@mit.edu>
* e2fsck.8.in: Make it clear that the -c, -l, and -L options are
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 2b6e476..1d74929 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -73,7 +73,7 @@
fprintf(stderr,
_("Usage: %s [-panyrcdfvstDFSV] [-b superblock] [-B blocksize]\n"
"\t\t[-I inode_buffer_blocks] [-P process_inode_size]\n"
- "\t\t[-l|-L bad_blocks_file] [-C fd] [-j ext-journal]\n"
+ "\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n"
"\t\t[-E extended-options] device\n"),
ctx->program_name);
@@ -87,7 +87,7 @@
" -v Be verbose\n"
" -b superblock Use alternative superblock\n"
" -B blocksize Force blocksize when looking for superblock\n"
- " -j external-journal Set location of the external journal\n"
+ " -j external_journal Set location of the external journal\n"
" -l bad_blocks_file Add to badblocks list\n"
" -L bad_blocks_file Set badblocks list\n"
));
@@ -529,15 +529,18 @@
continue;
}
ctx->ext_attr_ver = ea_ver;
- } else
+ } else {
+ fprintf(stderr, _("Unknown extended option: %s\n"),
+ token);
extended_usage++;
+ }
}
if (extended_usage) {
- fprintf(stderr, _("Extended options are separated by commas, "
- "and may take an argument which\n"
- "is set off by an equals ('=') sign. "
- "Valid raid options are:\n"
- "\tea_ver=<ea_version (1 or 2)\n\n"));
+ fputs(("\nExtended options are separated by commas, "
+ "and may take an argument which\n"
+ "is set off by an equals ('=') sign. "
+ "Valid extended options are:\n"
+ "\tea_ver=<ea_version (1 or 2)>\n\n"), stderr);
exit(1);
}
}
diff --git a/misc/ChangeLog b/misc/ChangeLog
index d6cedee..57f0b49 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,5 +1,17 @@
2005-06-20 Theodore Ts'o <tytso@mit.edu>
+ * partinfo.c: Add ioctl definition for BLKGETSIZE so it can be
+ compiled cleanly.
+
+ * findsuper.c: Fix up comments for grammar.
+
+ * dumpe2fs.c (print_journal_information), partinfo.c (main): Add
+ missing _() so all strings can be internationalized.
+
+ * badblocks.c (main), mke2fs.c (parse_extended_opts, PRS),
+ partinfo.c (main), tune2fs.c (usage): Clean up printed
+ messages for grammar and consistency.
+
* e2image.8.in: Clean up e2image man page, mostly based on
suggestions from Benno Schulenberg.
diff --git a/misc/badblocks.c b/misc/badblocks.c
index 9a6acdf..e82648f 100644
--- a/misc/badblocks.c
+++ b/misc/badblocks.c
@@ -1047,7 +1047,7 @@
errcode = ext2fs_badblocks_list_create(&bb_list,0);
if (errcode) {
com_err (program_name, errcode,
- _("creating in-memory bad blocks list"));
+ _("while creating in-memory bad blocks list"));
exit (1);
}
@@ -1062,7 +1062,7 @@
default:
errcode = ext2fs_badblocks_list_add(bb_list,next_bad);
if (errcode) {
- com_err (program_name, errcode, _("adding to in-memory bad block list"));
+ com_err (program_name, errcode, _("while adding to in-memory bad block list"));
exit (1);
}
continue;
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c
index 73042fa..b6995fd 100644
--- a/misc/dumpe2fs.c
+++ b/misc/dumpe2fs.c
@@ -257,7 +257,7 @@
for (i=0; i < ntohl(jsb->s_nr_users); i++) {
uuid_unparse(&jsb->s_users[i*16], str);
printf(i ? " %s\n"
- : "Journal users: %s\n",
+ : _("Journal users: %s\n"),
str);
}
}
diff --git a/misc/findsuper.c b/misc/findsuper.c
index 8fb163b..620f775 100644
--- a/misc/findsuper.c
+++ b/misc/findsuper.c
@@ -61,10 +61,10 @@
* Documentation addendum added by Andreas dwguest@win.tue.nl/aeb@cwi.nl
*
* The program findsuper is a utility that scans a disk and finds
- * copies of ext2 superblocks (by checking for the ext2 signature
+ * copies of ext2 superblocks (by checking for the ext2 signature).
*
* For each superblock found, it prints the offset in bytes, the
- * offset in 1024-byte blocks, the size of ext2 partition in fs
+ * offset in 1024-byte blocks, the size of the ext2 partition in fs
* blocks, the filesystem blocksize (in bytes), the block group number
* (always 0 for older ext2 systems), and a timestamp (s_mtime).
*
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 4c93c9f..49689c3 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -871,10 +871,10 @@
}
if (r_usage) {
fprintf(stderr, _("\nBad options specified.\n\n"
- "Options are separated by commas, "
+ "Extended options are separated by commas, "
"and may take an argument which\n"
"\tis set off by an equals ('=') sign.\n\n"
- "Valid raid options are:\n"
+ "Valid extended options are:\n"
"\tstride=<stride length in blocks>\n"
"\tresize=<resize maximum size in blocks>\n\n"));
exit(1);
@@ -1005,7 +1005,7 @@
if (size < EXT2_MIN_BLOCK_SIZE ||
size > EXT2_MAX_BLOCK_SIZE || *tmp) {
com_err(program_name, 0,
- _("bad fragment size - %s"),
+ _("invalid fragment size - %s"),
optarg);
exit(1);
}
@@ -1033,7 +1033,7 @@
inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024 ||
*tmp) {
com_err(program_name, 0,
- _("bad inode ratio %s (min %d/max %d)"),
+ _("invalid inode ratio %s (min %d/max %d)"),
optarg, EXT2_MIN_BLOCK_SIZE,
EXT2_MAX_BLOCK_SIZE);
exit(1);
@@ -1061,7 +1061,7 @@
reserved_ratio = strtoul(optarg, &tmp, 0);
if (reserved_ratio > 50 || *tmp) {
com_err(program_name, 0,
- _("bad reserved blocks percent - %s"),
+ _("invalid reserved blocks percent - %s"),
optarg);
exit(1);
}
@@ -1093,7 +1093,7 @@
inode_size = strtoul(optarg, &tmp, 0);
if (*tmp) {
com_err(program_name, 0,
- _("bad inode size - %s"), optarg);
+ _("invalid inode size - %s"), optarg);
exit(1);
}
break;
@@ -1212,9 +1212,9 @@
}
if ((blocksize > 4096) &&
(param.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
- fprintf(stderr, "\nWarning: some 2.4 kernels do not support "
- "blocksizes greater than 4096 \n\tusing ext3."
- " Use -b 4096 if this is an issue for you.\n\n");
+ fprintf(stderr, _("\nWarning: some 2.4 kernels do not support "
+ "blocksizes greater than 4096\n\tusing ext3. "
+ "Use -b 4096 if this is an issue for you.\n\n"));
if (optind < argc) {
param.s_blocks_count = parse_num_blocks(argv[optind++],
@@ -1357,7 +1357,7 @@
inode_size > EXT2_BLOCK_SIZE(¶m) ||
inode_size & (inode_size - 1)) {
com_err(program_name, 0,
- _("bad inode size %d (min %d/max %d)"),
+ _("invalid inode size %d (min %d/max %d)"),
inode_size, EXT2_GOOD_OLD_INODE_SIZE,
blocksize);
exit(1);
diff --git a/misc/partinfo.c b/misc/partinfo.c
index 9363149..f1ec879 100644
--- a/misc/partinfo.c
+++ b/misc/partinfo.c
@@ -9,6 +9,9 @@
#include <sys/types.h>
#include <fcntl.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
#include <stdio.h>
#include <linux/hdreg.h>
#include <unistd.h>
@@ -16,6 +19,10 @@
#include <errno.h>
#include "nls-enable.h"
+#if defined(__linux__) && defined(_IO) && !defined(BLKGETSIZE)
+#define BLKGETSIZE _IO(0x12,96) /* return device size */
+#endif
+
void print_error(char *operation, int error, char *device)
{
fprintf(stderr, _("%s failed for %s: %s\n"), operation, device,
@@ -35,11 +42,9 @@
textdomain(NLS_CAT_NAME);
#endif
if (argc == 1) {
- fprintf(stderr, _("Usage: %s <dev1> <dev2> <dev3>\n\n"
- "This program prints out the partition information "
- "for a set of devices\n"
- "A common way to use this program is:\n\n\t"
- "%s /dev/hda?\n\n"), argv[0], argv[0]);
+ fprintf(stderr, _("Usage: %s device...\n\nPrints out the"
+ "partition information for each given device.\n"),
+ "For example: %s /dev/hda\n\n", argv[0], argv[0]);
exit(1);
}
@@ -47,7 +52,7 @@
fd = open(argv[i], O_RDONLY);
if (fd < 0) {
- print_error("open", errno, argv[i]);
+ print_error(_("open"), errno, argv[i]);
continue;
}
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 8385187..15bfd44 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -81,14 +81,14 @@
static void usage(void)
{
fprintf(stderr,
- _("Usage: %s [-c max-mounts-count] [-e errors-behavior] "
+ _("Usage: %s [-c max_mounts_count] [-e errors_behavior] "
"[-g group]\n"
- "\t[-i interval[d|m|w]] [-j] [-J journal-options]\n"
- "\t[-l] [-s sparse-flag] [-m reserved-blocks-percent]\n"
- "\t[-o [^]mount-options[,...]] [-r reserved-blocks-count]\n"
- "\t[-u user] [-C mount-count] [-L volume-label] "
- "[-M last-mounted-dir]\n"
- "\t[-O [^]feature[,...]] [-T last-check-time] [-U UUID]"
+ "\t[-i interval[d|m|w]] [-j] [-J journal_options]\n"
+ "\t[-l] [-s sparse_flag] [-m reserved_blocks_percent]\n"
+ "\t[-o [^]mount_options[,...]] [-r reserved_blocks_count]\n"
+ "\t[-u user] [-C mount_count] [-L volume_label] "
+ "[-M last_mounted_dir]\n"
+ "\t[-O [^]feature[,...]] [-T last_check_time] [-U UUID]"
" device\n"), program_name);
exit (1);
}