[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] du: -H now does what POSIX requires
From: |
Jim Meyering |
Subject: |
[PATCH] du: -H now does what POSIX requires |
Date: |
Tue, 16 Dec 2008 08:01:26 +0100 |
Long ago, before POSIX took du's -H option, GNU du used it as a synonym
for --si (and analogous to --human's -h). Once POSIX usurped the
short-named -H, GNU du deprecated, it and now it's been long enough that
we can change the meaning to align with POSIX.
>From d2892d80218e78ec8b5e962b0a6d0ce02f2abc91 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 9 Dec 2008 08:22:21 +0100
Subject: [PATCH] du: -H now does what POSIX requires
* src/du.c (usage): Update --help output.
(main): Move -H-handling code from the --si block to
the one for --dereference-args (-D).
* doc/coreutils.texi (du invocation): Update description.
* NEWS (Changes in behavior): Mention this.
---
NEWS | 3 +++
doc/coreutils.texi | 5 +----
src/du.c | 13 ++++---------
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/NEWS b/NEWS
index ca87b23..717af04 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,9 @@ GNU coreutils NEWS -*-
outline -*-
cp and mv: the --reply={yes,no,query} option has been removed.
Using it has elicited a warning for the last three years.
+ du: -H (initially equivalent to --si) is now equivalent to
+ --dereference-args, and thus works as POSIX requires
+
ls -l now marks SELinux-only files with the less obtrusive '.',
rather than '+'. A file with any other combination of MAC and ACL
is still marked with a '+'.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 983a694..8bbafe9 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -10016,10 +10016,7 @@ du invocation
@item -H
@opindex -H
-Currently, @option{-H} is the same as @option{--si},
-except that @option{-H} evokes a warning.
-This option will be changed to be equivalent to
address@hidden (@option{-D}).
+Equivalent to @option{--dereference-args} (@option{-D}).
@item -k
@opindex -k
diff --git a/src/du.c b/src/du.c
index 6e4d28b..860e8fe 100644
--- a/src/du.c
+++ b/src/du.c
@@ -294,8 +294,7 @@ Mandatory arguments to long options are mandatory for short
options too.\n\
--files0-from=F summarize disk usage of the NUL-terminated file\n\
names specified in file F;\n\
If F is - then read names from standard input\n\
- -H like --si, but also evokes a warning; will soon\n\
- change to be equivalent to --dereference-args (-D)\n\
+ -H equivalent to --dereference-args (-D)\n\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M
2G)\n\
--si like -h, but use powers of 1000 not 1024\n\
"), stdout);
@@ -729,11 +728,6 @@ main (int argc, char **argv)
output_block_size = 1;
break;
- case 'H': /* FIXME: remove warning and move this "case 'H'" to
- precede --dereference-args in late 2006. */
- error (0, 0, _("WARNING: use --si, not -H; the meaning of the -H\
- option will soon\nchange to be the same as that of --dereference-args (-D)"));
- /* fall through */
case HUMAN_SI_OPTION:
human_output_opts = human_autoscale | human_SI;
output_block_size = 1;
@@ -762,7 +756,7 @@ main (int argc, char **argv)
}
break;
- case MEGABYTES_LONG_OPTION:
+ case MEGABYTES_LONG_OPTION: /* FIXME: remove in 2009 */
error (0, 0,
_("the --megabytes option is deprecated; use -m instead"));
/* fall through */
@@ -792,7 +786,8 @@ main (int argc, char **argv)
}
break;
- case 'D': /* This will eventually be 'H' (-H), too. */
+ case 'H': /* NOTE: before 2008-12, -H was equivalent to --si. */
+ case 'D':
symlink_deref_bits = FTS_COMFOLLOW | FTS_PHYSICAL;
break;
--
1.6.1.rc2.312.g2e96
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] du: -H now does what POSIX requires,
Jim Meyering <=