Compare commits

...

46 Commits

Author SHA1 Message Date
Jim Meyering
39b517459f update from master 2002-01-06 09:34:09 +00:00
Jim Meyering
d4eb26affa *** empty log message *** 2002-01-05 21:13:34 +00:00
Jim Meyering
fc9f72abca (version_etc_copyright): Update copyright year. 2002-01-05 21:13:29 +00:00
Jim Meyering
cec759ed61 *** empty log message *** 2002-01-05 20:38:36 +00:00
Jim Meyering
9d4fa35a77 . 2002-01-05 20:11:34 +00:00
Jim Meyering
66be6a1689 *** empty log message *** 2002-01-05 20:11:05 +00:00
Jim Meyering
aaa4c7445b add another test 2002-01-05 20:10:44 +00:00
Jim Meyering
4d18918a3a *** empty log message *** 2002-01-05 19:18:02 +00:00
Jim Meyering
26802588fa (install-data-yes, uninstall-data-yes):
Install the LC_TIME locale category as an alias for LC_MESSAGES.
This fixes a bug introduced in the 2001-09-22 upgrade to gettext 0.10.40.
2002-01-02 19:59:44 +00:00
Jim Meyering
d8a4f42f8c . 2001-12-31 07:56:43 +00:00
Jim Meyering
638f87f1bd *** empty log message *** 2001-12-29 23:01:15 +00:00
Jim Meyering
521f68c0a5 *** empty log message *** 2001-12-29 22:59:09 +00:00
Jim Meyering
c672e2892b (main): With -r, always dereference symlinks. 2001-12-29 22:58:40 +00:00
Jim Meyering
27d553aad2 *** empty log message *** 2001-12-29 22:55:43 +00:00
Jim Meyering
d04627589e . 2001-12-29 22:55:17 +00:00
Jim Meyering
9782cef803 *** empty log message *** 2001-12-29 22:53:38 +00:00
Jim Meyering
88429654db (TESTS): Add r-vs-symlink. 2001-12-29 22:53:09 +00:00
Jim Meyering
b9ca7077bb . 2001-12-28 08:08:15 +00:00
Jim Meyering
f5bf6fe980 Use notation compatible with SI and with IEC 60027-2.
For example, --block-size=1MB now means --block-size=1000000,
whereas --block-size=1MiB now means --block-size=1048576.
A trailing `B' now means decimal, not binary; this is a silent change.
-H or --si now outputs the trailing 'B', for consistency with this.
Programs now output trailing 'K' (not 'k') to mean 1024.
New df, du short option -B is short for --block-size.
You can omit an integer `1' before a block size suffix,
e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'.

Document the above.  Remove documentation
for obsolescent constructs MD, --kilobytes, -m or --megabytes.
2001-12-21 11:54:04 +00:00
Jim Meyering
9db9190cd4 *** empty log message *** 2001-12-21 11:40:55 +00:00
Jim Meyering
df5fb23be1 *** empty log message *** 2001-12-21 11:39:22 +00:00
Jim Meyering
9b9c6a8565 [!HAVE_CONFIG_H]: Remove block of code that duplicated
code in lib/ for compiling this program without config.h.
2001-12-21 11:39:02 +00:00
Jim Meyering
51a3adcefa (usage): Deprecate --kilobytes. Document size suffixes. 2001-12-21 11:36:35 +00:00
Jim Meyering
d1772031ee (BLOCK_SIZE_OPTION): Remove; no longer needed now that we have 'B'.
(long_options, usage, main): Add -B.
(usage): Deprecate --kilobytes, -m, --megabytes.
Document size suffixes.

(print_header, show_dev): Enlarge column widths for trailing "B".
2001-12-21 11:35:54 +00:00
Jim Meyering
309253682d (BLOCK_SIZE_OPTION): Remove; no longer needed now that we have 'B'.
(long_options, usage, main): Add -B.
(usage): Deprecate --kilobytes, -m, --megabytes.
Document size suffixes.
2001-12-21 11:31:54 +00:00
Jim Meyering
b34d965da0 (usage, parse_integer): Prefer K to k for 1024. 2001-12-21 11:28:34 +00:00
Jim Meyering
b9676dd73d *** empty log message *** 2001-12-20 16:54:24 +00:00
Jim Meyering
de9ef8a7a7 *** empty log message *** 2001-12-20 16:53:56 +00:00
Jim Meyering
3c20276087 (usage, specify_sort_size): Accept 'K' (which is
now preferred, as it connotes 1024) as well as 'k'.
2001-12-20 16:53:50 +00:00
Jim Meyering
174e9df9c1 *** empty log message *** 2001-12-20 10:01:41 +00:00
Jim Meyering
8d83abaf89 (close_stdout_status): If ferror (stdout), do
not silently exit merely because the output buffer happens to
have nothing pending.
2001-12-20 10:01:25 +00:00
Jim Meyering
82a83f3743 *** empty log message *** 2001-12-19 18:10:46 +00:00
Jim Meyering
0b6b9b5195 Add FSF copyright notice. 2001-12-19 18:10:24 +00:00
Jim Meyering
ae3295706e *** empty log message *** 2001-12-19 15:07:13 +00:00
Jim Meyering
79a8c33f6d *** empty log message *** 2001-12-19 15:05:38 +00:00
Jim Meyering
44dcbba28a (suffixes): Prefer K to k for 1024.
(generate_suffix_backwards): New function.
(human_readable_inexact): Use it.
2001-12-19 15:05:33 +00:00
Jim Meyering
f0ed17134a (__xstrtol): If there is no number but there
is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
Accept 'K' as well as 'k'.
2001-12-19 10:41:27 +00:00
Jim Meyering
1cc94659ad (xstrtoumax): If there is no number but there
is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
Accept 'K' as well as 'k'.
2001-12-19 10:35:39 +00:00
Jim Meyering
4ee49675d3 *** empty log message *** 2001-12-17 19:45:12 +00:00
Jim Meyering
2fcddf2514 (usage): Remove strap `)' in --help output. 2001-12-17 19:45:03 +00:00
Jim Meyering
450dbb37c2 *** empty log message *** 2001-12-17 09:09:05 +00:00
Jim Meyering
42ee53e9ba *** empty log message *** 2001-12-17 09:08:39 +00:00
Jim Meyering
2a9c589d4d *** empty log message *** 2001-12-17 09:07:22 +00:00
Jim Meyering
4efee8b478 (url_dir_list): Don't set define it here, but... 2001-12-17 09:06:56 +00:00
Jim Meyering
6e5e7b7179 (url_dir_list): ...define it here instead.
(hosts, a_host, b_host): Remove now-unused variables.
(alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables.
2001-12-17 09:06:33 +00:00
Jim Meyering
a580a5e647 (real_dir): Remove unused variable. 2001-12-17 09:01:08 +00:00
27 changed files with 512 additions and 522 deletions

View File

@@ -1,16 +1,9 @@
# -*- makefile -*-
## Customize Makefile.maint.
# List the hosts to which test releases are copied.
# `a' and `b' are merely placeholders, and correspond to the
# `a_' and `b_' prefixes of the following variables.
hosts = a b
a_host = alpha.gnu.org
b_host = freefriends.org
alpha_subdir = gnu/fetish
a_url_dir = $(alpha_subdir)
b_url_dir = $(alpha_subdir)
url_dir_list = \
ftp://alpha.gnu.org/gnu/fetish \
http://fetish.sf.net \
# Files that `make wget-update' should update.
wget_files = \

View File

@@ -177,12 +177,6 @@ my-distcheck: local-check
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
# This must be the same name on both hosts.
# Make it a symlink that points to the right place.
real_dir = fetish-ftp
url_dir_list = $(foreach x,$(hosts),ftp://$($(x)_host)/$($(x)_url_dir))
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')

2
THANKS
View File

@@ -58,9 +58,11 @@ Charles Karney karney@pppl.gov
Charles Randall crandall@matchlogic.com
Chip Salzenberg chip@valinux.com
Chris Faylor cgf@cygnus.com
Chris J. Bednar cjb@AdvancedDataSolutions.com
Chris Sylvain csylvain@umm.edu
Chris Yeo cyeo@biking.org
Christi Alice Scarborough christi@chiark.greenend.org.uk
Christian Harkort christian.harkort@web.de
Christian Krackowizer ckrackowiz@std.schuler-ag.com
Christian Rose menthos@menthos.com
Christian von Roques roques@pond.sub.org

View File

@@ -118,7 +118,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU command line utilities.
Copyright (C) 1994, 95, 96, 2001 Free Software Foundation, Inc.
Copyright (C) 1994, 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -137,7 +137,8 @@ Free Documentation License''.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1994, 95, 96, 2000 Free Software Foundation, Inc.
Copyright @copyright{} 1994, 1995, 1996, 2000, 2001 Free Software
Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -673,63 +674,101 @@ future.
A block size specification can be a positive integer specifying the number
of bytes per block, or it can be @code{human-readable} or @code{si} to
select a human-readable format.
select a human-readable format. Integers may be followed by suffixes
that are upward compatible with the
@uref{http://www.bipm.fr/enus/3_SI/si-prefixes.html, SI prefixes}
for decimal multiples and with the
@uref{http://physics.nist.gov/cuu/Units/binary.html, IEC 60027-2
prefixes for binary multiples}.
With human-readable formats, output sizes are followed by a size letter
such as @samp{M} for megabytes. @code{BLOCK_SIZE=human-readable} uses
powers of 1024; @samp{M} stands for 1,048,576 bytes.
@code{BLOCK_SIZE=si} is similar, but uses powers of 1000; @samp{M} stands
for 1,000,000 bytes. (SI, the International System of Units, defines
these power-of-1000 prefixes.)
@code{BLOCK_SIZE=si} is similar, but uses powers of 1000 and appends
@samp{B}; @samp{MB} stands for 1,000,000 bytes.
An integer block size can be followed by a size letter to specify a
multiple of that size. When this notation is used, the size letters
normally stand for powers of 1024, and can be followed by an optional
@samp{B} for ``byte''; but if followed by @samp{D} (for ``decimal
byte''), they stand for powers of 1000. For example,
@code{BLOCK_SIZE=4MB} is equivalent to @code{BLOCK_SIZE=4194304}, and
@code{BLOCK_SIZE=4MD} is equivalent to @code{BLOCK_SIZE=4000000}.
An integer block size can be followed by a suffix to specify a
multiple of that size; in this case an omitted integer is understood
to be 1. A bare size letter, or one followed by @samp{iB}, specifies
a multiple using powers of 1024. A size letter followed by @samp{B}
specifies powers of 1000 instead. For example, @samp{M} and
@samp{MiB} are equivalent to @samp{1048576}, whereas @samp{MB} is
equivalent to @samp{1000000}.
The following size letters are defined. Large sizes like @code{1Y}
The following suffixes are defined. Large sizes like @code{1Y}
may be rejected by your computer due to limitations of its arithmetic.
@table @samp
@item kB
@cindex kilobyte, definition of
kilobyte: @math{10^3 = 1000}.
@item k
kilo: @math{2^10 = 1024} for @code{human-readable},
or @math{10^3 = 1000} for @code{si}.
@itemx K
@itemx KiB
@cindex kibibyte, definition of
kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is
@samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and
@sc{posix} use @samp{k} to mean @samp{KiB}.
@item MB
@cindex megabyte, definition of
megabyte: @math{10^6 = 1,000,000}.
@item M
Mega: @math{2^20 = 1,048,576}
or @math{10^6 = 1,000,000}.
@itemx MiB
@cindex mebibyte, definition of
mebibyte: @math{2^20 = 1,048,576}.
@item GB
@cindex gigabyte, definition of
gigabyte: @math{10^9 = 1,000,000,000}.
@item G
Giga: @math{2^30 = 1,073,741,824}
or @math{10^9 = 1,000,000,000}.
@itemx GiB
@cindex gibibyte, definition of
gibibyte: @math{2^30 = 1,073,741,824}.
@item TB
@cindex terabyte, definition of
terabyte: @math{10^12 = 1,000,000,000,000}.
@item T
Tera: @math{2^40 = 1,099,511,627,776}
or @math{10^12 = 1,000,000,000,000}.
@itemx TiB
@cindex tebibyte, definition of
tebibyte: @math{2^40 = 1,099,511,627,776}.
@item PB
@cindex petabyte, definition of
petabyte: @math{10^15 = 1,000,000,000,000,000}.
@item P
Peta: @math{2^50 = 1,125,899,906,842,624}
or @math{10^15 = 1,000,000,000,000,000}.
@itemx PiB
@cindex pebibyte, definition of
pebibyte: @math{2^50 = 1,125,899,906,842,624}.
@item EB
@cindex exabyte, definition of
exabyte: @math{10^18 = 1,000,000,000,000,000,000}.
@item E
Exa: @math{2^60 = 1,152,921,504,606,846,976}@*
or @math{10^18 = 1,000,000,000,000,000,000}.
@itemx EiB
@cindex exbibyte, definition of
exbibyte: @math{2^60 = 1,152,921,504,606,846,976}.
@item ZB
@cindex zettabyte, definition of
zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000}
@item Z
Zetta: @math{2^70 = 1,180,591,620,717,411,303,424}@*
or @math{10^21 = 1,000,000,000,000,000,000,000}.
@itemx ZiB
@math{2^70 = 1,180,591,620,717,411,303,424}.
(@samp{Zi} is a GNU extension to IEC 60027-2.)
@item YB
@cindex yottabyte, definition of
yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}.
@item Y
Yotta: @math{2^80 = 1,208,925,819,614,629,174,706,176}@*
or @math{10^24 = 1,000,000,000,000,000,000,000,000}.
@itemx YiB
@math{2^80 = 1,208,925,819,614,629,174,706,176}.
(@samp{Yi} is a GNU extension to IEC 60027-2.)
@end table
@opindex -k
@opindex --kilobytes
@opindex -h
@opindex --block-size
@opindex --human-readable
@opindex --si
Block size defaults can be overridden by an explicit
@option{--block-size=@var{size}} option. The @option{-k} or
@option{--kilobytes} option is equivalent to @option{--block-size=1k}, which
@option{--block-size=@var{size}} option. The @option{-k}
option is equivalent to @option{--block-size=1K}, which
is the default unless the @env{POSIXLY_CORRECT} environment variable is
set. The @option{-h} or @option{--human-readable} option is equivalent to
@option{--block-size=human-readable}. The @option{--si} option is
@@ -2909,9 +2948,9 @@ specify @option{-o @var{output-file}} before any input files.
@opindex --buffer-size
@cindex size for main memory sorting
Use a main-memory sort buffer of the given @var{size}. By default,
@var{size} is in units of 1,024 bytes. Appending @samp{%} causes
@var{size} is in units of 1024 bytes. Appending @samp{%} causes
@var{size} to be interpreted as a percentage of physical memory.
Appending @samp{k} multiplies @var{size} by 1,024 (the default),
Appending @samp{K} multiplies @var{size} by 1024 (the default),
@samp{M} by 1,048,576, @samp{G} by 1,073,741,824, and so on for
@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. Appending
@samp{b} causes @var{size} to be interpreted as a byte count, with no
@@ -4782,7 +4821,7 @@ provide this option for compatibility.)
@opindex -h
@opindex --human-readable
@cindex human-readable output
Append a size letter such as @samp{M} for megabytes to each size.
Append a size letter to each size, such as @samp{M} for mebibytes.
Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes.
Use the @option{--si} option if you prefer powers of 1000.
@@ -4881,9 +4920,8 @@ it also affects the HP-UX @code{ls} program.
@itemx --si
@opindex --si
@cindex SI output
Append a size letter such as @samp{M} for megabytes to each size. (SI
is the International System of Units, which defines these letters as
prefixes.) Powers of 1000 are used, not 1024; @samp{M} stands for
Append an SI-style abbreviation to each size, such as @samp{MB} for
megabytes. Powers of 1000 are used, not 1024; @samp{MB} stands for
1,000,000 bytes. Use the @option{-h} or @option{--human-readable} option if
you prefer powers of 1024.
@@ -5102,11 +5140,10 @@ Append @samp{*} for executable regular files, otherwise behave as for
@end table
@item -k
@itemx --kilobytes
@opindex -k
@opindex --kilobytes
Print file sizes in 1024-byte blocks, overriding the default block
size (@pxref{Block size}).
This option is equivalent to @option{--block-size=1K}.
@item -m
@itemx --format=commas
@@ -5755,8 +5792,8 @@ standard block size suffixes like @samp{k}=1024 (@pxref{Block size}).
Use different @command{dd} invocations to use different block sizes for
skipping and I/O. For example, the following shell commands copy data
in 512 kB blocks between a disk and a tape, but do not save or restore a
4 kB label at the start of the disk:
in 512 KiB blocks between a disk and a tape, but do not save or restore a
4 KiB label at the start of the disk:
@example
disk=/dev/rdsk/c0t1d0s2
@@ -6372,7 +6409,7 @@ time to waste.
@cindex size of file to shred
Shred the first @var{BYTES} bytes of the file. The default is to shred
the whole file. @var{BYTES} can be followed by a size specification like
@samp{k}, @samp{M}, or @samp{G} to specify a multiple. @xref{Block size}.
@samp{K}, @samp{M}, or @samp{G} to specify a multiple. @xref{Block size}.
@item -u
@itemx --remove
@@ -6439,7 +6476,8 @@ Bourne-compatible shell) the command @samp{shred - 1<>file} instead.
You might use the following command to erase all trace of the
file system you'd created on the floppy disk in your first drive.
That command takes about 20 minutes to erase a 1.44MB floppy.
That command takes about 20 minutes to erase a ``1.44MB'' (actually
1440 KiB) floppy.
@example
shred --verbose /dev/fd0
@@ -7360,12 +7398,20 @@ pseudo-filesystems, such as automounter entries. Also, filesystems of
type ``ignore'' or ``auto'', supported by some operating systems, are
only included if this option is specified.
@item -B @var{size}
@itemx --block-size=@var{size}
@opindex -B
@opindex --block-size
@cindex filesystem sizes
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
@item -h
@itemx --human-readable
@opindex -h
@opindex --human-readable
@cindex human-readable output
Append a size letter such as @samp{M} for megabytes to each size.
Append a size letter to each size, such as @samp{M} for mebibytes.
Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes.
Use the @option{-H} or @option{--si} option if you prefer powers of 1000.
@@ -7374,9 +7420,8 @@ Use the @option{-H} or @option{--si} option if you prefer powers of 1000.
@opindex -H
@opindex --si
@cindex SI output
Append a size letter such as @samp{M} for megabytes to each size. (SI
is the International System of Units, which defines these letters as
prefixes.) Powers of 1000 are used, not 1024; @samp{M} stands for
Append an SI-style abbreviation to each size, such as @samp{MB} for
megabytes. Powers of 1000 are used, not 1024; @samp{MB} stands for
1,000,000 bytes. Use the @option{-h} or @option{--human-readable} option if
you prefer powers of 1024.
@@ -7390,12 +7435,11 @@ for index node) contains information about a file such as its owner,
permissions, timestamps, and location on the disk.
@item -k
@itemx --kilobytes
@opindex -k
@opindex --kilobytes
@cindex kilobytes for filesystem sizes
@cindex kibibytes for filesystem sizes
Print sizes in 1024-byte blocks, overriding the default block size
(@pxref{Block size}).
This option is equivalent to @option{--block-size=1K}.
@item -l
@itemx --local
@@ -7405,13 +7449,6 @@ Print sizes in 1024-byte blocks, overriding the default block size
Limit the listing to local filesystems. By default, remote filesystems
are also listed.
@item -m
@itemx --megabytes
@opindex -m
@opindex --megabytes
@cindex megabytes for filesystem sizes
Print sizes in megabyte (that is, 1,048,576-byte) blocks.
@item --no-sync
@opindex --no-sync
@cindex filesystem space, retrieving old data more quickly
@@ -7556,6 +7593,14 @@ Show counts for all files, not just directories.
@opindex --bytes
Print sizes in bytes, overriding the default block size (@pxref{Block size}).
@item -B @var{size}
@itemx --block-size=@var{size}
@opindex -B
@opindex --block-size
@cindex file sizes
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
@item -c
@itemx --total
@opindex -c
@@ -7579,7 +7624,7 @@ are often symbolic links.
@opindex -h
@opindex --human-readable
@cindex human-readable output
Append a size letter such as @samp{M} for megabytes to each size.
Append a size letter to each size, such as @samp{M} for mebibytes.
Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes.
Use the @option{-H} or @option{--si} option if you prefer powers of 1000.
@@ -7588,18 +7633,17 @@ Use the @option{-H} or @option{--si} option if you prefer powers of 1000.
@opindex -H
@opindex --si
@cindex SI output
Append a size letter such as @samp{M} for megabytes to each size. (SI
is the International System of Units, which defines these letters as
prefixes.) Powers of 1000 are used, not 1024; @samp{M} stands for
Append an SI-style abbreviation to each size, such as @samp{MB} for
megabytes. Powers of 1000 are used, not 1024; @samp{MB} stands for
1,000,000 bytes. Use the @option{-h} or @option{--human-readable} option if
you prefer powers of 1024.
@item -k
@itemx --kilobytes
@opindex -k
@opindex --kilobytes
@cindex kibibytes for file sizes
Print sizes in 1024-byte blocks, overriding the default block size
(@pxref{Block size}).
This option is equivalent to @option{--block-size=1K}.
@item -l
@itemx --count-links
@@ -7625,13 +7669,6 @@ Show the total for each directory (and file if --all) that is at
most MAX_DEPTH levels down from the root of the hierarchy. The root
is at level 0, so @code{du --max-depth=0} is equivalent to @code{du -s}.
@item -m
@itemx --megabytes
@opindex -m
@opindex --megabytes
@cindex megabytes for filesystem sizes
Print sizes in megabyte (that is, 1,048,576-byte) blocks.
@item -s
@itemx --summarize
@opindex -s

View File

@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2001-07-25.07}
\def\texinfoversion{2002-01-04.07}
%
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
% 2000, 01 Free Software Foundation, Inc.
@@ -30,14 +30,17 @@
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% ftp://ftp.gnu.org/gnu/texinfo.tex
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
% ftp://texinfo.org/tex/texinfo.tex
% ftp://us.ctan.org/macros/texinfo/texinfo.tex
% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
% ftp://texinfo.org/texinfo/texinfo.tex
% ftp://tug.org/tex/texinfo.tex
% (and all CTAN mirrors, see http://www.ctan.org),
% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
%
% The texinfo.tex in any given Texinfo distribution could well be out
% of date, so if that's what you're using, please check.
% Texinfo has a small home page at http://texinfo.org/.
%
% Texinfo has a small home page at http://texinfo.org/ and also
% http://www.gnu.org/software/texinfo.
%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
@@ -927,10 +930,12 @@ where each line of input produces a line of output.}
\def\dopdfimage#1#2#3{%
\def\imagewidth{#2}%
\def\imageheight{#3}%
% without \immediate, pdftex seg faults when the same image is
% included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
\ifnum\pdftexversion < 14
\pdfimage
\immediate\pdfimage
\else
\pdfximage
\immediate\pdfximage
\fi
\ifx\empty\imagewidth\else width \imagewidth \fi
\ifx\empty\imageheight\else height \imageheight \fi
@@ -943,7 +948,7 @@ where each line of input produces a line of output.}
\pdfrefximage \pdflastximage
\fi}
\def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
\def\pdfmkpgn#1{#1@}
\def\pdfmkpgn#1{#1}
\let\linkcolor = \Blue % was Cyan, but that seems light?
\def\endlink{\Black\pdfendlink}
% Adding outlines to PDF; macros for calculating structure of outlines
@@ -5799,8 +5804,15 @@ width0pt\relax} \fi
%
\smallfonts \rm
%
% Hang the footnote text off the number.
\hang
% Because we use hanging indentation in footnotes, a @noindent appears
% to exdent this text, so make it be a no-op. makeinfo does not use
% hanging indentation so @noindent can still be needed within footnote
% text after an @example or the like (not that this is good style).
\let\noindent = \relax
%
% Hang the footnote text off the number. Use \everypar in case the
% footnote extends for more than one paragraph.
\everypar = {\hang}%
\textindent{\thisfootno}%
%
% Don't crash into the line above the footnote text. Since this
@@ -5881,7 +5893,7 @@ width0pt\relax} \fi
\global\warnednoepsftrue
\fi
\else
\imagexxx #1,,,\finish
\imagexxx #1,,,,,\finish
\fi
}
%
@@ -5891,33 +5903,34 @@ width0pt\relax} \fi
% #4 is (ignored optional) html alt text.
% #5 is (ignored optional) extension.
% #6 is just the usual extra ignored arg for parsing this stuff.
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{%
\newif\ifimagevmode
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \loggingall
\catcode`\^^M = 5 % in case we're inside an example
\normalturnoffactive % allow _ et al. in names
% If the image is by itself, center it.
\ifvmode
\imagevmodetrue
\nobreak\bigskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
% above and below.
\nobreak\vskip\parskip
\nobreak
\line\bgroup\hss
\fi
%
% Output the image.
\ifpdf
\centerline{\dopdfimage{#1}{#2}{#3}}%
\dopdfimage{#1}{#2}{#3}%
\else
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
\begingroup
\catcode`\^^M = 5 % in case we're inside an example
\normalturnoffactive % allow _ et al. in names
% If the image is by itself, center it.
\ifvmode
\nobreak\bigskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
% above and below.
\nobreak\vskip\parskip
\nobreak
\centerline{\epsfbox{#1.eps}}%
\bigbreak
\else
% In the middle of a paragraph, no extra space.
\epsfbox{#1.eps}%
\fi
\endgroup
\epsfbox{#1.eps}%
\fi
}
%
\ifimagevmode \hss \egroup \bigbreak \fi % space after the image
\endgroup}
\message{localization,}
@@ -6087,6 +6100,10 @@ should work if nowhere else does.}
%
\afourpaper
\internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
%
% Must explicitly reset to 0 because we call \afourpaper, apparently,
% although this does not entirely make sense.
\globaldefs = 0
}}
% Use @afourwide to print on European A4 paper in wide format.

View File

@@ -1,3 +1,23 @@
2002-01-05 Jim Meyering <meyering@lucent.com>
* version-etc.c (version_etc_copyright): Update copyright year.
2001-01-19 Paul Eggert <eggert@twinsun.com>
* closeout.c (close_stdout_status): If ferror (stdout), do
not silently exit merely because the output buffer happens to
have nothing pending.
2001-12-18 Paul Eggert <eggert@twinsun.com>
See the big note in ../ChangeLog.
* human.c (suffixes): Prefer K to k for 1024.
(generate_suffix_backwards): New function.
(human_readable_inexact): Use it.
* xstrtol.c (__xstrtol): If there is no number but there
is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
Accept 'K' as well as 'k'.
2001-12-15 Jim Meyering <meyering@lucent.com>
* regex.h (__restrict_arr): Update from libc.

View File

@@ -94,7 +94,9 @@ close_stdout_status (int status)
{
int e = ferror (stdout) ? 0 : -1;
if (__fpending (stdout) == 0)
/* If the stream's error bit is clear and there is nothing to flush,
then return right away. */
if (e && __fpending (stdout) == 0)
return;
if (fclose (stdout) != 0)

View File

@@ -1,5 +1,7 @@
/* human.c -- print human readable file size
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -66,16 +68,34 @@ char *getenv ();
static const char suffixes[] =
{
0, /* not used */
'k', /* kilo */
'M', /* Mega */
'G', /* Giga */
'T', /* Tera */
'P', /* Peta */
'E', /* Exa */
'Z', /* Zetta */
'Y' /* Yotta */
'K', /* kibi ('k' for kilo is a special case) */
'M', /* mega or mebi */
'G', /* giga or gibi */
'T', /* tera or tebi */
'P', /* peta or pebi */
'E', /* exa or exbi */
'Z', /* zetta or 2**70 */
'Y' /* yotta or 2**80 */
};
/* Generate into P[-1] (and possibly P[-2]) the proper suffix for
POWER and BASE. Return the address of the generated suffix. */
static char *
generate_suffix_backwards (char *p, int power, int base)
{
char letter = suffixes[power];
if (base == 1000)
{
*--p = 'B';
if (power == 1)
letter = 'k';
}
*--p = letter;
return p;
}
/* If INEXACT_STYLE is not human_round_to_even, and if easily
possible, adjust VALUE according to the style. */
static double
@@ -113,7 +133,7 @@ human_readable (uintmax_t n, char *buf,
Use INEXACT_STYLE to determine whether to take the ceiling or floor
of any result that cannot be expressed exactly.
If OUTPUT_BLOCK_SIZE is negative, use a format like "127k" if
If OUTPUT_BLOCK_SIZE is negative, use a format like "127K" if
possible, using powers of -OUTPUT_BLOCK_SIZE; otherwise, use
ordinary decimal format. Normally -OUTPUT_BLOCK_SIZE is either
1000 or 1024; it must be at least 2. Most people visually process
@@ -121,9 +141,10 @@ human_readable (uintmax_t n, char *buf,
more prone to misinterpretation. Hence, converting to an
abbreviated form usually improves readability. Use a suffix
indicating which power is being used. For example, assuming
-OUTPUT_BLOCK_SIZE is 1024, 8500 would be converted to 8.3k,
-OUTPUT_BLOCK_SIZE is 1024, 8500 would be converted to 8.3K,
133456345 to 127M, 56990456345 to 53G, and so on. Numbers smaller
than -OUTPUT_BLOCK_SIZE aren't modified. */
than -OUTPUT_BLOCK_SIZE aren't modified. If -OUTPUT_BLOCK_SIZE is
1024, append a "B" after any size letter. */
char *
human_readable_inexact (uintmax_t n, char *buf,
@@ -193,6 +214,8 @@ human_readable_inexact (uintmax_t n, char *buf,
sprintf (buf, "%.0f", adjust_value (inexact_style, damt));
else
{
char suffix[3];
char const *psuffix;
double e = 1;
power = 0;
@@ -205,12 +228,13 @@ human_readable_inexact (uintmax_t n, char *buf,
damt /= e;
sprintf (buf, "%.1f%c", adjust_value (inexact_style, damt),
suffixes[power]);
if (4 < strlen (buf))
sprintf (buf, "%.0f%c",
adjust_value (inexact_style, damt * 10) / 10,
suffixes[power]);
suffix[2] = '\0';
psuffix = generate_suffix_backwards (suffix + 2, power, base);
sprintf (buf, "%.1f%s",
adjust_value (inexact_style, damt), psuffix);
if (4 + (base == 1000) < strlen (buf))
sprintf (buf, "%.0f%s",
adjust_value (inexact_style, damt * 10) / 10, psuffix);
}
return buf;
@@ -236,7 +260,7 @@ human_readable_inexact (uintmax_t n, char *buf,
}
while (base <= amt && power < sizeof suffixes - 1);
*--p = suffixes[power];
p = generate_suffix_backwards (p, power, base);
if (amt < 10)
{

View File

@@ -1,5 +1,5 @@
/* Utility to help print --version output in a consistent format.
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
char* version_etc_copyright =
/* Do *not* mark this string for translation. */
"Copyright (C) 2001 Free Software Foundation, Inc.";
"Copyright (C) 2002 Free Software Foundation, Inc.";
/* Display the --version information the standard way.

View File

@@ -141,8 +141,16 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
tmp = __strtol (s, p, strtol_base);
if (errno != 0)
return LONGINT_OVERFLOW;
if (*p == s)
return LONGINT_INVALID;
{
/* If there is no number but there is a valid suffix, assume the
number is 1. The string is invalid otherwise. */
if (valid_suffixes && **p && strchr (valid_suffixes, **p))
tmp = 1;
else
return LONGINT_INVALID;
}
/* Let valid_suffixes == NULL mean `allow any suffix'. */
/* FIXME: update all callers except the ones that allow suffixes
@@ -169,15 +177,20 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
{
/* The ``valid suffix'' '0' is a special flag meaning that
an optional second suffix is allowed, which can change
the base, e.g. "100MD" for 100 megabytes decimal. */
the base. A suffix "B" (e.g. "100MB") stands for a power
of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for
a power of 1024. If no suffix (e.g. "100M"), assume
power-of-1024. */
switch (p[0][1])
{
case 'B':
suffixes++;
case 'i':
if (p[0][2] == 'B')
suffixes += 2;
break;
case 'D':
case 'B':
case 'D': /* 'D' is obsolescent */
base = 1000;
suffixes++;
break;
@@ -198,29 +211,30 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
overflow = 0;
break;
case 'E': /* Exa */
case 'E': /* exa or exbi */
overflow = bkm_scale_by_power (&tmp, base, 6);
break;
case 'G': /* Giga */
case 'G': /* giga or gibi */
case 'g': /* 'g' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 3);
break;
case 'k': /* kilo */
case 'K': /* kibi */
overflow = bkm_scale_by_power (&tmp, base, 1);
break;
case 'M': /* Mega */
case 'M': /* mega or mebi */
case 'm': /* 'm' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 2);
break;
case 'P': /* Peta */
case 'P': /* peta or pebi */
overflow = bkm_scale_by_power (&tmp, base, 5);
break;
case 'T': /* Tera */
case 'T': /* tera or tebi */
case 't': /* 't' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 4);
break;
@@ -229,11 +243,11 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
overflow = bkm_scale (&tmp, 2);
break;
case 'Y': /* Yotta */
case 'Y': /* yotta or 2**80 */
overflow = bkm_scale_by_power (&tmp, base, 8);
break;
case 'Z': /* Zetta */
case 'Z': /* zetta or 2**70 */
overflow = bkm_scale_by_power (&tmp, base, 7);
break;

View File

@@ -1,3 +1,68 @@
2002-01-05 Jim Meyering <meyering@lucent.com>
* Version 4.1.5.
2001-12-29 Jim Meyering <meyering@lucent.com>
* src/cp.c (main): With -r, always dereference symlinks.
Reported by Christian Harkort. Patch by Chris J. Bednar.
* tests/cp/r-vs-symlink: New file to test for the above fix.
* tests/cp/Makefile.am (TESTS): Add r-vs-symlink.
2001-12-21 Jim Meyering <meyering@lucent.com>
* src/shred.c [!HAVE_CONFIG_H]: Remove cpp block that duplicated
code in lib/ in order to facilitate compiling this program without
config.h.
2001-12-19 Paul Eggert <eggert@twinsun.com>
* src/shred.c: Add FSF copyright notice.
2001-12-18 Paul Eggert <eggert@twinsun.com>
Use notation compatible with SI and with IEC 60027-2.
For example, --block-size=1MB now means --block-size=1000000,
whereas --block-size=1MiB now means --block-size=1048576.
A trailing `B' now means decimal, not binary; this is a silent change.
-H or --si now outputs the trailing 'B', for consistency with this.
Programs now output trailing 'K' (not 'k') to mean 1024.
New df, du short option -B is short for --block-size.
You can omit an integer `1' before a block size suffix,
e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'.
* NEWS, doc/coreutils.texi: Document this. Remove documentation
for obsolescent constructs MD, --kilobytes, -m or --megabytes.
* src/dd.c (usage, parse_integer): Prefer K to k for 1024.
* src/shred.c (usage, main): Likewise.
* src/shred.c (xstrtoumax): If there is no number but there
is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary.
Accept 'K' as well as 'k'.
* src/dd.c (usage): MD -> MB for decimal.
* src/df.c (BLOCK_SIZE_OPTION): Remove; no longer needed now that
we have 'B'.
(long_options, usage, main): Add -B.
(usage): Deprecate --kilobytes, -m, --megabytes.
Document size suffixes.
* src/du.c: Likewise.
* src/ls.c (usage): Deprecate --kilobytes. Document size suffixes.
* src/df.c (print_header, show_dev): Enlarge column widths for
trailing "B".
2001-12-17 Jim Meyering <meyering@lucent.com>
* Makefile.maint (real_dir): Remove unused variable.
(url_dir_list): Don't set define it here, but...
* Makefile.cfg (url_dir_list): ...define it here instead.
(hosts, a_host, b_host): Remove now-unused variables.
(alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables.
2001-12-15 Jim Meyering <meyering@lucent.com>
* Version 4.1.4.

View File

@@ -1,3 +1,20 @@
[4.1.5]
* cp -r no longer preserves symlinks
* The block size notation is now compatible with SI and with IEC 60027-2.
For example, --block-size=1MB now means --block-size=1000000,
whereas --block-size=1MiB now means --block-size=1048576.
A missing `B' (e.g. `1M') has the same meaning as before.
A trailing `B' now means decimal, not binary; this is a silent change.
The nonstandard `D' suffix (e.g. `1MD') is now obsolescent.
* -H or --si now outputs the trailing 'B', for consistency with the above.
* Programs now output trailing 'K' (not 'k') to mean 1024, as per IEC 60027-2.
* New df, du short option -B is short for --block-size.
* You can omit an integer `1' before a block size suffix,
e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'.
* The following options are now obsolescent, as their names are
incompatible with IEC 60027-2:
df, du: -m or --megabytes (use -BM or --block-size=1M)
df, du, ls: --kilobytes (use --block-size=1K)
[4.1.4]
* df --local no longer lists smbfs file systems whose name starts with //
* dd now detects the Linux/tape/lseek bug at run time and warns about it.

View File

@@ -1,7 +1,19 @@
2001-12-15 Jim Meyering <meyering@lucent.com>
2001-12-28 Jim Meyering <meyering@lucent.com>
* configure.ac (ALL_LINGUAS): Add Catalan (ca).
2001-12-17 Jim Meyering <meyering@lucent.com>
* Version 2.0.12.
* Makefile.maint (real_dir): Remove unused variable.
(url_dir_list): Don't set define it here, but...
* Makefile.cfg (url_dir_list): ...define it here instead.
(hosts, a_host, b_host): Remove now-unused variables.
(alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables.
2001-12-15 Jim Meyering <meyering@lucent.com>
* src/basename.c, src/chroot.c, src/date.c, src/dirname.c, src/echo.c,
* src/env.c, src/expr.c, src/factor.c, src/hostid.c, src/hostname.c,
* src/id.c, src/kill.c, src/logname.c, src/nice.c, src/pathchk.c,

View File

@@ -1,7 +1,24 @@
2001-12-13 Jim Meyering <meyering@lucent.com>
2001-12-20 Jim Meyering <meyering@lucent.com>
* Version 2.0.20.
2001-12-18 Paul Eggert <eggert@twinsun.com>
* src/sort.c (usage, specify_sort_size): Accept 'K' (which is
now preferred, as it connotes 1024) as well as 'k'.
* NEWS: Document this change.
2001-12-17 Jim Meyering <meyering@lucent.com>
* src/uniq.c (usage): Remove stray `)' in --help output.
Reported by Padraig Brady.
* Makefile.maint (real_dir): Remove unused variable.
(url_dir_list): Don't set define it here, but...
* Makefile.cfg (url_dir_list): ...define it here instead.
(hosts, a_host, b_host): Remove now-unused variables.
(alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables.
2001-12-12 Bruno Haible <bruno@clisp.org>
Paul Eggert <eggert@twinsun.com>

View File

@@ -1,5 +1,6 @@
Changes in release 2.1
[2.0.20]
* sort -S now accepts 'K' as a synonym for 'k'.
* wc recognizes all locale-defined white-space characters, not just those
in the "C" locale.
[2.0.19]

View File

@@ -107,6 +107,18 @@ install-data-yes: all
echo "installing $(srcdir)/$$cat as" \
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
fi; \
timedir=$(localedir)/$$lang/LC_TIME; \
case "`ls -ld $(DESTDIR)$$timedir 2>/dev/null`" in \
*/'LC_TIME -> LC_MESSAGES') ;; \
*) \
rm -fr $(DESTDIR)$$timedir; \
ln -s LC_MESSAGES $(DESTDIR)$$timedir \
|| { $(mkinstalldirs) $(DESTDIR)$$timedir \
&& { ln $(DESTDIR)$$dir/* $(DESTDIR)$$timedir \
|| cp $(DESTDIR)$$dir/* $(DESTDIR)$$timedir; }; }; \
echo "installing $(DESTDIR)$$timedir as" \
"an alias for $(DESTDIR)$$dir";; \
esac; \
done
# Define this as empty until I found a useful application.
@@ -126,7 +138,8 @@ uninstall-data-yes:
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo \
$(DESTDIR)$(localedir)/$$lang/LC_TIME/$(PACKAGE).mo; \
done
check: all

View File

@@ -944,6 +944,7 @@ main (int argc, char **argv)
case 'r':
x.recursive = 1;
x.copy_as_regular = 1;
x.dereference = DEREF_ALWAYS;
break;
case 'R':

View File

@@ -310,8 +310,8 @@ Copy a file, converting and formatting according to the options.\n\
fputs (_("\
\n\
BLOCKS and BYTES may be followed by the following multiplicative suffixes:\n\
xM M, c 1, w 2, b 512, kD 1000, k 1024, MD 1,000,000, M 1,048,576,\n\
GD 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n\
xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n\
GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n\
Each KEYWORD may be:\n\
\n\
"), stdout);
@@ -518,7 +518,7 @@ parse_integer (const char *str, int *invalid)
{
uintmax_t n;
char *suffix;
enum strtol_error e = xstrtoumax (str, &suffix, 10, &n, "bcEGkMPTwYZ0");
enum strtol_error e = xstrtoumax (str, &suffix, 10, &n, "bcEGkKMPTwYZ0");
if (e == LONGINT_INVALID_SUFFIX_CHAR && *suffix == 'x')
{

View File

@@ -120,20 +120,19 @@ static int print_type;
enum
{
SYNC_OPTION = CHAR_MAX + 1,
NO_SYNC_OPTION,
BLOCK_SIZE_OPTION
NO_SYNC_OPTION
};
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"block-size", required_argument, NULL, BLOCK_SIZE_OPTION},
{"block-size", required_argument, NULL, 'B'},
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"kilobytes", no_argument, NULL, 'k'},
{"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
{"local", no_argument, NULL, 'l'},
{"megabytes", no_argument, NULL, 'm'},
{"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
{"portability", no_argument, NULL, 'P'},
{"print-type", no_argument, NULL, 'T'},
{"sync", no_argument, NULL, SYNC_OPTION},
@@ -158,7 +157,12 @@ print_header (void)
if (inode_format)
printf (_(" Inodes IUsed IFree IUse%%"));
else if (output_block_size < 0)
printf (_(" Size Used Avail Use%%"));
{
if (output_block_size == -1000)
printf (_(" Size Used Avail Use%%"));
else
printf (_(" Size Used Avail Use%%"));
}
else if (posix_format)
printf (_(" %4d-blocks Used Available Capacity"), output_block_size);
else
@@ -166,7 +170,7 @@ print_header (void)
char buf[LONGEST_HUMAN_READABLE + 1];
char *p = human_readable (output_block_size, buf, 1, -1024);
/* Replace e.g. "1.0k" by "1k". */
/* Replace e.g. "1.0K" by "1K". */
size_t plen = strlen (p);
if (3 <= plen && strncmp (p + plen - 3, ".0", 2) == 0)
strcpy (p + plen - 3, p + plen - 1);
@@ -322,7 +326,7 @@ show_dev (const char *disk, const char *mount_point, const char *fstype,
}
else
{
width = output_block_size < 0 ? 5 : 9;
width = output_block_size < 0 ? 5 + (output_block_size == -1000) : 9;
use_width = posix_format ? 8 : 4;
input_units = fsu.fsu_blocksize;
output_units = output_block_size;
@@ -762,15 +766,14 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all include filesystems having 0 blocks\n\
--block-size=SIZE use SIZE-byte blocks\n\
-B, --block-size=SIZE use SIZE-byte blocks\n\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\
-H, --si likewise, but use powers of 1000 not 1024\n\
"), stdout);
fputs (_("\
-i, --inodes list inode information instead of block usage\n\
-k, --kilobytes like --block-size=1024\n\
-k like --block-size=1K\n\
-l, --local limit listing to local filesystems\n\
-m, --megabytes like --block-size=1048576\n\
--no-sync do not invoke sync before getting usage info (default)\n\
"), stdout);
fputs (_("\
@@ -783,6 +786,10 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\n\
SIZE may be (or may be an integer optionally followed by) one of following:\n\
kB 1000, K 1024, MB 1,000,000, M 1,048,576, and so on for G, T, P, E, Z, Y.\n\
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -814,7 +821,7 @@ main (int argc, char **argv)
posix_format = 0;
exit_status = 0;
while ((c = getopt_long (argc, argv, "aiF:hHklmPTt:vx:", long_options, NULL))
while ((c = getopt_long (argc, argv, "aB:iF:hHklmPTt:vx:", long_options, NULL))
!= -1)
{
switch (c)
@@ -824,6 +831,9 @@ main (int argc, char **argv)
case 'a':
show_all_fs = 1;
break;
case 'B':
human_block_size (optarg, 1, &output_block_size);
break;
case 'i':
inode_format = 1;
break;
@@ -839,7 +849,7 @@ main (int argc, char **argv)
case 'l':
show_local_fs = 1;
break;
case 'm':
case 'm': /* obsolescent */
output_block_size = 1024 * 1024;
break;
case 'T':
@@ -855,10 +865,6 @@ main (int argc, char **argv)
require_sync = 0;
break;
case BLOCK_SIZE_OPTION:
human_block_size (optarg, 1, &output_block_size);
break;
case 'F':
/* Accept -F as a synonym for -t for compatibility with Solaris. */
case 't':

View File

@@ -150,14 +150,13 @@ static uintmax_t tot_size = 0;
enum
{
EXCLUDE_OPTION = CHAR_MAX + 1,
BLOCK_SIZE_OPTION,
MAX_DEPTH_OPTION
};
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"block-size", required_argument, 0, BLOCK_SIZE_OPTION},
{"block-size", required_argument, 0, 'B'},
{"bytes", no_argument, NULL, 'b'},
{"count-links", no_argument, NULL, 'l'},
{"dereference", no_argument, NULL, 'L'},
@@ -166,9 +165,9 @@ static struct option const long_options[] =
{"exclude-from", required_argument, 0, 'X'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, 0, 'H'},
{"kilobytes", no_argument, NULL, 'k'},
{"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
{"max-depth", required_argument, NULL, MAX_DEPTH_OPTION},
{"megabytes", no_argument, NULL, 'm'},
{"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
{"one-file-system", no_argument, NULL, 'x'},
{"separate-dirs", no_argument, NULL, 'S'},
{"summarize", no_argument, NULL, 's'},
@@ -196,7 +195,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all write counts for all files, not just directories\n\
--block-size=SIZE use SIZE-byte blocks\n\
-B, --block-size=SIZE use SIZE-byte blocks\n\
-b, --bytes print size in bytes\n\
-c, --total produce a grand total\n\
-D, --dereference-args dereference PATHs when symbolic link\n\
@@ -204,12 +203,11 @@ Mandatory arguments to long options are mandatory for short options too.\n\
fputs (_("\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\
-H, --si likewise, but use powers of 1000 not 1024\n\
-k, --kilobytes like --block-size=1024\n\
-k like --block-size=1K\n\
-l, --count-links count sizes many times if hard linked\n\
"), stdout);
fputs (_("\
-L, --dereference dereference all symbolic links\n\
-m, --megabytes like --block-size=1048576\n\
-S, --separate-dirs do not include size of subdirectories\n\
-s, --summarize display only a total for each argument\n\
"), stdout);
@@ -224,6 +222,10 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\n\
SIZE may be (or may be an integer optionally followed by) one of following:\n\
kB 1000, K 1024, MB 1,000,000, M 1,048,576, and so on for G, T, P, E, Z, Y.\n\
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -580,7 +582,7 @@ main (int argc, char **argv)
human_block_size (getenv ("DU_BLOCK_SIZE"), 0, &output_block_size);
while ((c = getopt_long (argc, argv, "abchHklmsxDLSX:", long_options, NULL))
while ((c = getopt_long (argc, argv, "abchHklmsxB:DLSX:", long_options, NULL))
!= -1)
{
long int tmp_long;
@@ -622,7 +624,7 @@ main (int argc, char **argv)
max_depth = (int) tmp_long;
break;
case 'm':
case 'm': /* obsolescent */
output_block_size = 1024 * 1024;
break;
@@ -638,6 +640,10 @@ main (int argc, char **argv)
opt_one_file_system = 1;
break;
case 'B':
human_block_size (optarg, 1, &output_block_size);
break;
case 'D':
opt_dereference_arguments = 1;
break;
@@ -660,10 +666,6 @@ main (int argc, char **argv)
add_exclude (exclude, optarg, EXCLUDE_WILDCARDS);
break;
case BLOCK_SIZE_OPTION:
human_block_size (optarg, 1, &output_block_size);
break;
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);

View File

@@ -740,7 +740,7 @@ static struct option const long_options[] =
{"full-time", no_argument, 0, FULL_TIME_OPTION},
{"human-readable", no_argument, 0, 'h'},
{"inode", no_argument, 0, 'i'},
{"kilobytes", no_argument, 0, 'k'},
{"kilobytes", no_argument, 0, 'k'}, /* long form is obsolescent */
{"numeric-uid-gid", no_argument, 0, 'n'},
{"no-group", no_argument, 0, 'G'},
{"hide-control-chars", no_argument, 0, 'q'},
@@ -3610,7 +3610,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
none (default), classify (-F), file-type (-p)\n\
-i, --inode print index number of each file\n\
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n\
-k, --kilobytes like --block-size=1024\n\
-k like --block-size=1K\n\
"), stdout);
fputs (_("\
-l use a long listing format\n\
@@ -3669,6 +3669,10 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\n\
SIZE may be (or may be an integer optionally followed by) one of following:\n\
kB 1000, K 1024, MB 1,000,000, M 1,048,576, and so on for G, T, P, E, Z, Y.\n\
"), stdout);
fputs (_("\
\n\
By default, color is not used to distinguish types of files. That is\n\

View File

@@ -1,3 +1,24 @@
/* shred.c - overwrite files and devices to make it harder to recover data
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999 Colin Plumb.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Colin Plumb. */
/* TODO:
- use consistent non-capitalization in error messages
- add standard GNU copyleft comment
@@ -13,8 +34,6 @@
*/
/*
* shred.c - by Colin Plumb.
*
* Do a securer overwrite of given files or devices, to make it harder
* for even very expensive hardware probing to recover the data.
*
@@ -44,11 +63,6 @@
* If asked to wipe a file, this also unlinks it, renaming it to in a
* clever way to try to leave no trace of the original filename.
*
* Copyright 1997, 1998, 1999 Colin Plumb <colin@nyx.net>. This program
* may be freely distributed under the terms of the GNU GPL, the BSD license,
* or Larry Wall's "Artistic License" Even if you use the BSD license,
* which does not require it, I'd really like to get improvements back.
*
* The ISAAC code still bears some resemblance to the code written
* by Bob Jenkins, but he permits pretty unlimited use.
*
@@ -88,320 +102,16 @@
#include <signal.h>
#include <sys/types.h>
#if HAVE_CONFIG_H
/* Default fileutils build */
# include "system.h"
# include "xstrtol.h"
# include "closeout.h"
# include "error.h"
# include "human.h"
# include "quotearg.h" /* For quotearg_colon */
# include "quote.h" /* For quotearg_colon */
# include "xalloc.h"
#include "system.h"
#include "xstrtol.h"
#include "closeout.h"
#include "error.h"
#include "human.h"
#include "quotearg.h" /* For quotearg_colon */
#include "quote.h" /* For quotearg_colon */
#include "xalloc.h"
char *xstrdup PARAMS ((char const *));
#else /* !HAVE_CONFIG_H */
/*
* Standalone build - this file compiles by itself without autoconf and
* the like. No i18n, and I still have to write a stub for getopt_long,
* but it's a lot less intertwingled than the usual GNU utilities.
*/
# include <ctype.h> /* For isprint */
# include <string.h> /* For memcpy, strerror */
# include <limits.h> /* For ULONG_MAX etc. */
# include <stdlib.h> /* For strtoul, EXIT_FAILURE */
# include <errno.h>
# include <fcntl.h> /* For O_RDONLY etc. */
# include <unistd.h> /* For getpid, etc. */
# include <sys/time.h> /* For struct timeval */
# include <sys/stat.h> /* For struct stat */
# define PACKAGE "standalone"
# define VERSION "2.0" /* Kind of arbitrary... */
# if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5 || __STRICT_ANSI__
# define attribute(x)
# else
# define attribute __attribute__
# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
/* The __-protected forms were introduced in GCC 2.6.4 */
# define __format__ format
# define __printf__ printf
# endif
# endif
/* Reasonable default assumptions for time-getting */
# ifndef HAVE_GETTIMEOFDAY
# define HAVE_GETTIMEOFDAY 1 /* Most systems have it these days */
# endif
# ifdef CLOCK_REALTIME
# ifndef HAVE_CLOCK_GETTIME
# define HAVE_CLOCK_GETTIME 1
# endif
# endif
# ifndef STDOUT_FILENO
# define STDOUT_FILENO 1
# endif
# define RETSIGTYPE int
# ifndef S_IWUSR
# ifdef S_IWRITE
# define S_IWUSR S_IWRITE
# else
# define S_IWUSR 0200
# endif
# endif
/* POSIX doesn't require st_blksize, and 65536 is a reasonable
upper bound for existing filesystem practice. */
# define ST_BLKSIZE(Stat) 65536
# define uintmax_t unsigned long
/* Variant human-readable function that ignores last two args */
# define human_readable(v, b, f, t) (sprintf (b, "%lu", (unsigned long) v), b)
# define LONGEST_HUMAN_READABLE (sizeof (uintmax_t) * CHAR_BIT / 3)
/* Variant convert-to-uintmax_t function that accepts metric suffixes */
enum strtol_error
{
LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW
};
static uintmax_t
xstrtoumax (char const *ptr, char const **end, int base, uintmax_t *res,
char const *valid_suffixes)
{
char *end_ptr;
char const *p;
static char const metric_suffixes[] = "kMGTPEZY";
int decimal_flag;
uintmax_t n;
char c;
errno = 0;
*res = n = strtoul (ptr, &end_ptr, base);
if (end)
*end = end_ptr;
if (errno)
return LONGINT_OVERFLOW;
if (ptr == end_ptr)
return LONGINT_INVALID;
c = *end_ptr;
if (!c)
return LONGINT_OK;
/* Now deal with metric-style suffixes */
if (valid_suffixes && !strchr (valid_suffixes, c))
return LONGINT_INVALID_SUFFIX_CHAR;
decimal_flag = 0;
switch (c)
{
case 'b':
if (n > ULONG_MAX/512)
return LONGINT_OVERFLOW;
n *= 512;
break;
case 'B':
if (n > ULONG_MAX/102412)
return LONGINT_OVERFLOW;
n *= 1024;
break;
case 'c':
break;
case 'K':
c = 'k';
goto def;
case 'm':
c = 'M';
/*FALLTHROUGH*/
def:default:
p = strchr (metric_suffixes, c);
if (!p)
return LONGINT_INVALID_SUFFIX_CHAR;
/*
* If valid_suffixes contains '0', then xD (decimal) and xB (binary)
* are allowed as "supersuffixes". Binary is the default.
*/
if (strchr (valid_suffixes, '0'))
{
if (end_ptr[1] == 'B')
end_ptr++;
else if (end_ptr[1] == 'D')
{
decimal_flag = 1;
end_ptr++;
}
}
/* Now do the scaling */
p++;
if (decimal_flag)
do {
if (n > ULONG_MAX/1000)
return LONGINT_OVERFLOW;
n *= 1000;
} while (--p > metric_suffixes);
else
do {
if (n > ULONG_MAX/1024)
return LONGINT_OVERFLOW;
n *= 1024;
} while (--p > metric_suffixes);
}
/* Final wrapup */
if (end)
*end = end_ptr+1; /* Extra suffix is allowed if it's expected */
else if (end_ptr[1])
return LONGINT_INVALID_SUFFIX_CHAR;
*res = n;
return LONGINT_OK;
}
/* Dummy i18n stubs */
# define _(x) x
# define N_(x) x
# define setlocale(x,y) (void) 0
# define bindtextdomain(x,y) (void) 0
# define textdomain(x) (void) 0
/*
* Print a message with `fprintf (stderr, FORMAT, ...)';
* if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
* If STATUS is nonzero, terminate the program with `exit (STATUS)'.
*/
static void error (int status, int errnum, const char *format, ...)
attribute ((__format__ (__printf__, 3, 4)));
extern char const *program_name;
static void
error (int status, int errnum, const char *format, ...)
{
va_list ap;
if (program_name)
{
fputs (program_name, stderr);
fputs (": ", stderr);
}
va_start (ap, format);
vfprintf (stderr, format, ap);
va_end (ap);
if (errnum)
{
fputs (": ", stderr);
fputs (strerror (errnum), stderr);
}
putc ('\n', stderr);
if (status)
exit (status);
}
/*
* GNU programs actually check for failure closing standard output.
* This seems unnecessary, until your shell script starts hitting
* ENOSPC and doing bizarre things with zero-length files.
*/
static void
close_stdout (void)
{
if (ferror (stdout))
error (EXIT_FAILURE, 0, _("write error"));
if (fclose (stdout) != 0)
error (EXIT_FAILURE, errno, _("write error"));
}
/*
* Quote the argument (including colon characters) into the buffer.
* Return the buffer size used (including trailing null byte.)
* If this is larger than the bufsize, it is an estimate of the space
* needed.
*/
static size_t
quotearg_colon_buf (char const *arg, char *buf, size_t bufsize)
{
/* Some systems don't have \a or \e, so this is ASCII-dependent */
static char const escaped[] = "\7\b\33\f\n\r\t\v";
static char const escapes[] = "abefnrtv";
int c;
size_t pos = 0;
char const *p;
while ((c = (unsigned char) *arg++) != 0)
{
if (isprint (c))
{
if (strchr ("\\:", c)) /* Anything else we should quote? */
if (pos++ < bufsize) *buf++ = '\\';
}
else
{
if (pos++ < bufsize) *buf++ = '\\';
p = strchr (escaped, c); /* c is never 0, so this is okay */
if (p)
{
c = escapes[p-escaped];
}
else
{
if ('0' <= *arg && *arg <= '9')
c += 256; /* Force 3-digit form if followed by a digit */
if (c > 077)
if (pos++ < bufsize) *buf++ = "0123"[c>>6 & 3];
if (c > 07)
if (pos++ < bufsize) *buf++ = "01234567"[c>>3 & 7];
c = "01234567"[c & 7];
}
}
if (pos++ < bufsize) *buf++ = c;
}
if (pos++ < bufsize) *buf++ = 0;
return pos;
}
/* Quote metacharacters in a filename */
char const *
quotearg_colon (char const *arg)
{
static char *buf = 0;
size_t bufsize = 0;
size_t newsize;
while ((newsize = quotearg_colon_buf (arg, buf, bufsize)) > bufsize)
{
buf = realloc (buf, newsize);
if (!buf)
error (EXIT_FAILURE, 0, _("memory exhausted"));
bufsize = newsize;
}
return buf;
}
void *
xmalloc (size_t n)
{
void *p = malloc (n);
if (!p)
error (EXIT_FAILURE, 0, _("memory exhausted"));
return p;
}
char *
xstrdup (char const *string)
{
return strcpy (xmalloc (strlen (string) + 1), string);
}
#endif /* ! HAVE_CONFIG_H */
#ifndef O_NOCTTY
# define O_NOCTTY 0 /* This is a very optional frill */
#endif
@@ -474,7 +184,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
printf (_("\
-f, --force change permissions to allow writing if necessary\n\
-n, --iterations=N Overwrite N times instead of the default (%d)\n\
-s, --size=N shred this many bytes (suffixes like k, M, G accepted)\n\
-s, --size=N shred this many bytes (suffixes like K, M, G accepted)\n\
"), DEFAULT_PASSES);
fputs (_("\
-u, --remove truncate and remove file after overwriting\n\
@@ -1838,7 +1548,7 @@ main (int argc, char **argv)
case 's':
{
uintmax_t tmp;
if (xstrtoumax (optarg, NULL, 0, &tmp, "cbBkMGTPEZY0")
if (xstrtoumax (optarg, NULL, 0, &tmp, "cbBkKMGTPEZY0")
!= LONGINT_OK)
{
error (1, 0, _("%s: invalid file size"),

View File

@@ -343,7 +343,7 @@ entire line as the key.\n\
SIZE may be followed by the following multiplicative suffixes:\n\
"), stdout);
fputs (_("\
% 1% of memory, b 1, k 1024 (default), and so on for M, G, T, P, E, Z, Y.\n\
% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.\n\
\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
@@ -602,9 +602,9 @@ specify_sort_size (char const *s)
{
uintmax_t n;
char *suffix;
enum strtol_error e = xstrtoumax (s, &suffix, 10, &n, "EgGkmMPtTYZ");
enum strtol_error e = xstrtoumax (s, &suffix, 10, &n, "EgGkKmMPtTYZ");
/* The default unit is kB. */
/* The default unit is KiB. */
if (e == LONGINT_OK && ISDIGIT (suffix[-1]))
{
if (n <= UINTMAX_MAX / 1024)

View File

@@ -148,7 +148,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-D, --all-repeated[=delimit-method] print all duplicate lines\n\
delimit-method={none(default),prepend,separate)}\n\
delimit-method={none(default),prepend,separate}\n\
Delimiting is done with blank lines.\n\
-f, --skip-fields=N avoid comparing the first N fields\n\
-i, --ignore-case ignore differences in case when comparing\n\

View File

@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = 1.1 gnits
TESTS = \
link-preserve \
r-vs-symlink link-preserve \
backup-1 no-deref-link1 no-deref-link2 no-deref-link3 backup-is-src \
same-file cp-mv-backup symlink-slash slink-2-slink fail-perm dir-slash \
perm cp-HL special-bits link dir-rm-dest cp-parents deref-slink \

View File

@@ -118,7 +118,7 @@ install_sh = @install_sh@
AUTOMAKE_OPTIONS = 1.1 gnits
TESTS = \
link-preserve \
r-vs-symlink link-preserve \
backup-1 no-deref-link1 no-deref-link2 no-deref-link3 backup-is-src \
same-file cp-mv-backup symlink-slash slink-2-slink fail-perm dir-slash \
perm cp-HL special-bits link dir-rm-dest cp-parents deref-slink \

39
tests/cp/r-vs-symlink Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
# cp -r should not create symlinks. Fixed in fileutils-4.1.5.
if test "$VERBOSE" = yes; then
set -x
cp --version
fi
. $srcdir/../envvar-check
pwd=`pwd`
tmp=r-vs-slink.$$
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
echo abc > foo || framework_failure=1
ln -s foo slink || framework_failure=1
ln -s no-such-file no-file || framework_failure=1
if test $framework_failure = 1; then
echo '$0: failure in testing framework' 1>&2
(exit 1); exit
fi
fail=0
# This must fail.
cp -r no-file junk 2>/dev/null && fail=1
cp -r slink bar || fail=1
set x `ls -l bar`; shift; mode=$1
case $mode in
l*) fail=1;;
esac
(exit $fail); exit