Compare commits

...

3988 Commits

Author SHA1 Message Date
Eric Blake
6c935a0554 Merge remote branch 'origin/next' into next 2009-10-10 09:28:19 -06:00
Jim Meyering
3b7dc2b522 rm: record timing data
* README-rm-timing-compare: new file
* README-rm-timing-2: New file.
2009-10-10 09:21:36 -06:00
Eric Blake
aeaa6bf7ae touch: optimize use of utimens
* src/touch.c (main): Use UTIME_NOW rather than calling gettime.
(touch): Use UTIME_OMIT rather than stat.
2009-10-10 09:14:39 -06:00
Eric Blake
82e344ca09 copy: allow symlink timestamp preservation on more systems
* src/copy.c (utimens_symlink): Simplify by using lutimens.
* m4/jm-macros.m4 (coreutils_MACROS): Drop utimensat; gnulib does
this for us.
* tests/cp/preserve-slink-time: Recognize lutimes support.
2009-10-10 09:14:35 -06:00
Eric Blake
2cd1577554 build: update gnulib submodule to latest, for utimens improvements 2009-10-10 09:14:17 -06:00
Eric Blake
c2bebf63ed maint: touch up previous LDADD patch
* src/Makefile.am (dir_LDADD): Delete; the ls_LDADD line covers this.
2009-10-10 06:28:40 -06:00
Jim Meyering
d74a1b005c build: build uname(1) unconditionally
Before, on a system without the uname function, the build
system would detect that and not build/install a uname program.
Now that gnulib guarantees a uname function, ...
* configure.ac: Don't check for the uname function.
* src/Makefile.am (build_if_possible__progs): Move uname...
(EXTRA_PROGRAMS): ...to this list.
2009-10-10 09:03:15 +02:00
Jim Meyering
4f1a3eda10 maint: list program names one per line
* src/Makefile.am (EXTRA_PROGRAMS): List them one per line.
(build_if_possible__progs): Likewise.
2009-10-10 08:58:43 +02:00
Jim Meyering
c9e7b8844b build: ls: fix link failure due to missing -lacl
* src/Makefile.am (ls_LDADD): Re-add $(LIB_ACL).
Inadvertently-removed by commit 78c93601.
2009-10-10 08:24:02 +02:00
Eric Blake
219f2f0538 maint: touch up previous LDADD patch
* src/Makefile.am (stdbuf_LDADD): Add missing primer.
(hostname_LDADD, uname_LDADD): Add GETHOSTNAME_LIB.
* bootstrap.conf (gnulib_modules): Add uname.
2009-10-09 20:08:03 -06:00
Eric Blake
78c9360178 maint: improve additional library tracking
* src/Makefile.am (LDADD): Refactor, to make per-library additions
to individual programs easier to maintain.
2009-10-09 19:28:07 -06:00
Jim Meyering
0023f65fd7 chcon: don't disable just because SELinux is disabled
* src/chcon.c (main): Now that gnulib provides getfilecon wrappers,
we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit
immediately if SELinux is disabled", since chcon is still useful as
long as the file system provides handlers for the security.*
name space.  gnulib's getfilecon wrappers ensure that an offending
context now evokes a return value of -1.
Prompted by comments from Stephen Smalley in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394
* NEWS (Bug fixes): Mention it.
2009-10-09 14:33:10 +02:00
Jim Meyering
57d9263ca5 ls: remove explicit getfilecon work-around
* src/ls.c (gobble_file): Remove l?getfilecon work-around,
now that the gnulib wrappers handle it for us.
2009-10-09 14:33:10 +02:00
Jim Meyering
e11a0319b3 build: update gnulib submodule to latest, for getfilecon wrappers 2009-10-09 14:33:10 +02:00
Eric Blake
c039c96449 maint: use X2NREALLOC in more places
* src/chroot.c (set_additional_groups): Use X2NREALLOC rather than
x2nrealloc.
* src/factor.c (emit_factor): Likewise.
* src/setuidgid.c (main): Likewise.
2009-10-08 20:30:08 -06:00
Eric Blake
aa092ccf6a maint: remove unused macros and declarations
* src/system.h (EDQUOT, EISDIR, ENOSYS, EOVERFLOW, F_OK, X_OK)
(W_OK, R_OK): Delete; macros provided by gnulib.
(includes): Gnulib guarantees both <time.h> and <sys/time.h>, in
either order.
(free, malloc, memchr, realloc, getenv, lseek): Delete, gnulib
guarantees these declarations.
* m4/check-decl.m4 (gl_CHECK_DECLS): Delete checks now done by
gnulib.
2009-10-08 20:30:06 -06:00
Eric Blake
2a876d901d maint: move timeout exit statuses
* src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Remove as
macros...
* src/system.h (EXIT_TIMEDOUT, EXIT_CANCELED): ...and provide as
enum values instead.
* src/stdbuf.c (EXIT_CANCELED): Delete.
2009-10-08 20:30:03 -06:00
Eric Blake
a797c4d7d3 stat: test recent patch
* tests/misc/stat-slash: New test.
* tests/Makefile.am (TESTS): Run it.
2009-10-08 20:30:00 -06:00
Eric Blake
7a3bc1bf27 stdbuf: improve path search
* src/stdbuf.c (set_program_path): Use gnulib methods for better
file name handling.
* bootstrap.conf (gnulib_modules): Add xreadlink.
2009-10-08 06:52:18 -06:00
Eric Blake
00674c7475 stat: work with recent gnulib changes
* src/stat.c (do_stat): Don't mask function-like stat macro.
2009-10-08 06:52:15 -06:00
Jim Meyering
eb5f06f2a6 stat: add support for many more file system types
* src/stat.c (human_fstype): Add the following FS types,
from <linux/magic.h>: afs, anon-inode FS, btrfs, cgroupfs,
cramfs-wend, debugfs, futexfs, inotifyfs, minux3, securityfs,
selinux, xenfs.
Also add "nilfs".
* src/Makefile.am (fs-kernel-magic): New rule.
* NEWS (Bug fixes): Mention this.
2009-10-08 10:18:28 +02:00
Jim Meyering
8e32390716 stat: recognize CIFS and HFS file system types
* src/stat.c (human_fstype) [CIFS, HFS]: Add new file system types.
Prompted by a report from Stuart Kemp.
Normalize the form of a few hexadecimal magic numbers.
Alphabetize on S_MAGIC_ case names.
* src/Makefile.am (fs-magic-compare, fs-def, fs-magic): New rules, to
automate comparison of our list with that in the Linux statfs man page.
* NEWS (Bug fixes): Mention it.
2009-10-08 09:07:12 +02:00
Guenter Knauf
b95be30e3f md5sum, sha*sum: also accept openssl checksum syntax
* src/md5sum.c (split_3): Accept openssl checksum syntax, which
differs only by two spaces from that of the bsd checksum tools:
openssl: MD5(f)= d41d8cd98f00b204e9800998ecf8427e
bsd:     MD5 (f) = d41d8cd98f00b204e9800998ecf8427e
2009-10-07 09:31:27 +02:00
Jim Meyering
d183a15cbb maint: make release-making instructions more generic
* README-release: Make instructions more generic.
2009-10-06 16:49:36 +02:00
Jim Meyering
96829a9ff0 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-10-06 13:20:18 +02:00
Jim Meyering
ca1e31f3c5 version 8.0
* NEWS: Record release date.
2009-10-06 13:04:16 +02:00
Jim Meyering
3c40fdfba6 build: update gnulib submodule to latest 2009-10-06 11:15:54 +02:00
Ondřej Vašík
3a97d664b9 chcon: exit immediately if SELinux is disabled
This change happens to avoid an abort in chcon when SELinux is
disabled while operating on a file with an "unlabeled" context from
back in 2006.  However, that same abort can still be triggered by the
same file when running chcon with SELinux enabled.  This bug in chcon
will be fixed in a subsequent commit via a getfilecon wrapper.  See
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18384
for how to correct your disk attributes to avoid triggering this bug.
* src/chcon.c (main): Exit immediately if SELinux is disabled.
Reported in http://bugzilla.redhat.com/527142 by Yanko Kaneti.
* src/runcon.c (main): Do not hardcode program name in error message.
* THANKS: Update.
2009-10-06 10:10:51 +02:00
Jim Meyering
addb62da92 build: update gnulib submodule to latest 2009-10-03 06:56:55 +02:00
James R. Van Zandt
569df689e3 dircolors: highlight .cgm and .emf as images
* src/dircolors.hin: Add .cgm, .emf.
* THANKS: Update.
2009-10-02 10:58:05 -06:00
Jim Meyering
df0c0381ab maint: remove obsolete syntax-check exclusion
* cfg.mk (local-checks-to-skip): Remove strftime-check.
2009-10-02 15:48:08 +02:00
Pádraig Brady
f8726e05c4 tail: avoid a race where we could miss new data with --pid
* src/tail.c (tail_forever, tail_forever_inotify): Close a race in
tail_forever_inotify where new data written after the file check by
a now dead process, but before the pid check, is not output.  We use
the POSIX guarantee that read() and write() are serialized wrt each
other even in separate processes, to assume full file consistency
after exit() and so poll for new data _after_ the writer has exited.
This also allows us to not redundantly _wait_ for new data if the
process is dead.
* tests/tail-2/pid: Remove the now partially invalid sub second sleep
check as we now don't unconditionally wait, and replace it with a check
for the redundant sleep.  Also clarify some of the existing comments.
* NEWS: Mention the fix.
2009-10-02 14:00:06 +01:00
Jim Meyering
95c01c656e maint: move gnu-web-doc-update script to gnulib
* bootstrap.conf (gnulib_modules): Add gnu-web-doc-update.
Remove gendocs, since gnu-web-doc-update depends on it.
* gnu-web-doc-update: Remove file, now that we get it from gnulib.
2009-10-02 12:10:21 +02:00
Jim Meyering
8a7f66feb4 build: update gnulib submodule to latest 2009-10-02 12:10:21 +02:00
Jim Meyering
30a227673e tests: tail-2/pid: use a 3-second timeout, not 1
* tests/tail-2/pid: When using the timeout program to ensuring that
tail -s.1 --pid=$PID_T_MAX does not wait forever, use a timeout longer
than 1 second.  A 1-second timeout could be too short on a very busy
system, and result in a timeout, and hence false-positive failure.

2009-09-30  Jim Meyering  <meyering@redhat.com>
2009-09-30 23:28:13 +02:00
Jim Meyering
dd8db19cc7 build: update gnulib submodule to latest 2009-09-30 17:46:42 +02:00
Jim Meyering
569e387b8a build: translate diagnostics from two new files
* po/POTFILES.in: Add two new files: lib/siglist.h, lib/strsignal.c
2009-09-30 17:04:29 +02:00
Jim Meyering
9ca7d6b49e build: now that we use the lock module, don't exclude lock.m4
* bootstrap.conf: Don't exclude lock.m4.
2009-09-30 17:04:29 +02:00
Pádraig Brady
d4c7114bce ls: always print "?" for allocated size of a dereferenced dangling symlink
Previously for `ls -Ls` (but not `ls -Lsl`), we referenced
the st_blocks returned from the previous failed stat() call.
This undefined value was seen to be 0 for dangling symlinks at least.
* src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills):
Don't use st_blocks if the previous stat() failed
* tests/ls/dangle: Add a test case
* NEWS: Mention the fix, and roll up related items into a single entry.
2009-09-30 15:42:35 +01:00
Jim Meyering
ce1069c215 build: use gnulib's freopen module
* bootstrap.conf (gnulib_modules): Add freopen, strsignal, fsync.
Exposed via make CFLAGS=-DGNULIB_POSIXCHECK 2>&1 \
|perl -lne '/.* use gnulib module (\S+).*/ and print $1' \
|sort |uniq -c|sort -nr
(avoided_gnulib_modules): Don't avoid the "lock" module.
Now it's required, as a dependency of the strsignal module.
2009-09-30 09:39:48 +02:00
Jim Meyering
a033e28737 stat: interpret "-" as standard input
* src/stat.c (do_stat): Interpret a command line argument of "-"
to mean "standard input", like many other tools do.
(do_statfs): Fail upon any attempt to use "-".
* NEWS (Changes in behavior): Mention it.
* tests/misc/stat-hyphen: New test, to exercise the above.
* tests/Makefile.am (TESTS): Add misc/stat-hyphen.
2009-09-29 16:04:12 +02:00
Jim Meyering
b7aaa0da8b ls: don't use an undefined struct stat after failed stat/lstat
* src/ls.c (format_inode): Access f->stat only if f->stat_ok is set.
* NEWS (Bug fixes): Mention it.
Improved-by: Pádraig Brady <P@draigBrady.com>
2009-09-29 14:12:30 +02:00
Jim Meyering
36edf7bad2 ls: print "?", not "0" as inode of dereferenced dangling symlink
ls prints inode numbers two ways: for long (-l) listings,
and for short ones, e.g., ls -li and ls -i.  The code to print
long listings properly printed "?" when the inode was unknown,
but the code for handling short listings would print 0 instead.
Factor out the formatting code into a new function so ls prints
the right string ("?") from both places:
* NEWS (Bug fixes): Mention it.
* src/ls.c (format_inode): New function.
(print_long_format): Use it here.
(print_file_name_and_frills): Use it here, too.
* tests/ls/dangle: Exercise this fix.
Reported by Yang Ren in http://bugzilla.redhat.com/525400
2009-09-29 11:42:45 +02:00
Jim Meyering
242689c7f9 ls: with -LR, exit with status 2 upon detecting a cycle
* src/ls.c (print_dir): Diagnosing the cycle is not enough.
Also set exit status to 2.  This is what Solaris' /bin/ls does, too.
* tests/ls/infloop: Rework test: match both expected stdout and stderr.
Require an exit status of 2 in this case.
* doc/coreutils.texi (ls invocation): Mention that a loop provokes
in an exit status of 2.
* NEWS (Bug fixes): Mention it.
Reported by Yang Ren in http://bugzilla.redhat.com/525402.
* THANKS: Correct ordering of Yang Ren's names.
2009-09-29 07:28:39 +02:00
Jim Meyering
30c65cd49c maint: factor coreutils-specific code out of bootstrap
* bootstrap (bootstrap_epilogue): Define a default, empty function.
Remove coreutils-specific code, and instead,
invoke this new function at the end of this script.
* bootstrap.conf (bootstrap_epilogue): Define, to override the default.
2009-09-26 14:45:50 +02:00
Eric Blake
ca9e212cf8 cp, mv: use linkat to guarantee semantics
* src/copy.c (copy_internal): Use linkat, not link.
2009-09-25 07:03:36 -06:00
Eric Blake
efcee783e4 ln: add -L/-P options
* src/ln.c (STAT_LIKE_LINK): Delete.
(logical): New flag.
(long_options): Add -L, -P.
(usage): Mention them.
(main): Choose between them.
(do_link): Perform correct action.
* tests/ln/misc: Move hard-to-sym portion of test...
* tests/ln/hard-to-sym: ...into new test, and add more.
* tests/Makefile.am (TESTS): Run new test.
* NEWS: Document this.
* doc/coreutils.texi (link invocation, ln invocation): Likewise.
* bootstrap.conf (gnulib_modules): Add linkat.
2009-09-25 07:03:03 -06:00
Eric Blake
fb59d72f0a build: update gnulib submodule to latest 2009-09-24 19:40:31 -06:00
Pádraig Brady
a037e838e1 maint: Use logical rather than bitwise operators on bools
This is because bitwise operators are:
- confusing and inconsistent in a boolean context
- non short circuiting
- brittle in C89 where bool can be an int (so > 1)
2009-09-23 14:33:40 +01:00
Pádraig Brady
ade8dd2096 maint: expr: avoid compiler warnings without GMP
* src/expr.c (mpz_clear, mpz_get_str, mpz_out_str)
[!HAVE_GMP]: Reference unused arguments.
2009-09-23 14:32:07 +01:00
Eric Blake
0cce690850 build: update gnulib submodule to latest 2009-09-23 06:47:46 -06:00
Eric Blake
82124c3c06 maint: summarize gnulib changes
* NEWS: Provide a blurb about recent gnulib improvements.  Fix typo
in readlink blurb.
2009-09-23 06:45:07 -06:00
Jim Meyering
38f1c2006e doc: ls: further improve --help message re --color
* src/ls.c (usage): Correct grammar, change voice, shorten.
Inspired by a report from Bruno Schulenberg.
2009-09-23 09:11:08 +02:00
Eric Blake
8a1edc971f readlink: pick up gnulib changes to readlink -f
* bootstrap.conf (obsolete_gnulib_modules): Move rename...
(gnulib_modules): ...here.  Add symlink.
* NEWS: Document the change in readlink.
* doc/coreutils.texi (readlink invocation): Likewise.
* tests/readlink/can-f: Update test to new semantics, and add test
of loop.
2009-09-23 08:45:08 +02:00
Jim Meyering
70253e9179 maint: df.c: adapt to newer gnulib
* src/df.c: Don't include "canonicalize.h".  No longer needed,
since canonicalize_file_name is now guaranteed to be declared
in <stdlib.h>, thanks to gnulib.
2009-09-23 08:38:00 +02:00
Jim Meyering
b18b6912e8 build: update gnulib submodule to latest 2009-09-23 08:37:59 +02:00
Pádraig Brady
fbfca3c675 doc: stdbuf: mention it can have a non standard exit status
* doc/coreutils.texi (Exit status): Add stdbuf to the list
2009-09-22 12:22:47 +01:00
Pádraig Brady
7a404d10f5 maint: uptime: fix a theoretical compile warning
* src/uptime.c (print_uptime) [!HAVE_UTMPX_H && !HAVE_UTMP_H]:
Reference possibly unused arguments.
2009-09-22 12:21:00 +01:00
Pádraig Brady
8c92bb3441 ls: fix a performance regression
* src/ls.c (print_color_indicator): This reinstates commit f3f1ccfd,
21-10-2008, "ls: make it possible to disable file capabilities checking"
which was inadvertently reverted with commit 3a169f4c, 14-09-2009,
"ls: handle disabling of colors consistently ...".
2009-09-22 10:07:21 +01:00
Eric Blake
32f987af12 build: avoid compiler warnings on cygwin 1.5
* src/copy.c (utimens_symlink): Avoid unused variables.
* src/su.c (getusershell): Rely on gnulib for prototype.
2009-09-21 20:42:16 -06:00
Jim Meyering
fee8694886 doc: ls: add an article, "the"
* src/ls.c (usage): Tweak wording.
2009-09-21 15:30:38 +02:00
Pádraig Brady
3a169f4c5d ls: handle disabling of colors consistently for all tile types
* src/ls.c (print_color_indicator): Use consistent syntax for
all file and directory subtypes, and fall back to the color
of the base type if there is no enabled color for the subtype.
This allows turning off specific colors for o+w dirs for example.
* tests/ls/color-dtype-dir: Add a case to test that turning off
coloring for o+w directories, falls back to standard dir color.
* NEWS: Mention the fix
Introduced by commit ac467814, 2005-09-05,
"Colorize set-user-ID ... files and sticky ... directories."
2009-09-21 13:16:44 +01:00
Pádraig Brady
29ec834c3b doc: ls: make help for --color more concise and accurate
* src/ls.c (usage): Shorten the --color ancillary info by
two lines, while replacing --color=none with --color=never.
Mention "always" is the default parameter of the --color option,
along with the primary help for that option.
Mention the ancillary --color info in the --color primary help.
2009-09-21 12:44:35 +01:00
Pádraig Brady
9837344837 doc: normalize and add missing entries to texinfo menu
* doc/coreutils.texi: Add the missing arch, base64, link, readlink,
and unlink entries.  Also remove extraneous '.' from some entries
and try to align all entries on the same column.
* THANKS: Add Benno Schulenberg.
2009-09-21 12:42:19 +01:00
Pádraig Brady
5d4f09d83a doc: mention the texinfo documentation in --help
* src/system.h: Rename emit_bug_reporting_address() to
emit_ancillary_info() and update it to not print the translation
project address in en_* locales, and _do_ print it in the 'C'
(and other) locales so that it's included in the default man page.
Also mention how to invoke the texinfo documentation for each command.
Also move the "hard-locale.h" include to the 8 files that now use it.
* man/help2man: Strip the newly added texinfo reference from the
--help output as a more verbose version is already added by help2man.
Suggestion from C de-Avillez
2009-09-21 12:37:57 +01:00
Jim Meyering
c48003a53c maint: automate the web-doc updating procedure
* gnu-web-doc-update: New script, destined for gnulib.
* README-release: Refer to the new script.
2009-09-21 08:56:17 +02:00
Jim Meyering
a2883947bc dircolors: arrange to highlight names with the .lz suffix
* src/dircolors.hin: Add .lz, for GNU lzip.
Suggested by Matias A. Fonzo.
2009-09-19 12:26:41 +02:00
Jim Meyering
99f59aaaf8 mktemp: adapt to new, 3-argument gen_tempname_len
* src/mktemp.c (mkstemp_len, mkdtemp_len): Update callers of
gen_tempname_len.
* gl/lib/tempname.c, gl/lib/tempname.h: Rebase against recently
API-modified copy of tempname module in gnulib.
Reported by Lluís Batlle.
2009-09-19 11:16:56 +02:00
Jim Meyering
6504d7e193 build: merge bootstrap changes from gnulib
* bootstrap: Update from gnulib.
2009-09-17 14:30:01 +02:00
Eric Blake
2bad8c0dea rm, rmdir: improve cross-compilation support
* bootstrap.conf (gnulib_modules): Drop rmdir-errno.
* src/rmdir.c (errno_rmdir_non_empty): Check both cases allowed by
POSIX, rather than relying on configure-time check that might
fail during cross-compilation.  Reverts commit 9b6eb98d41.
2009-09-16 21:26:58 -06:00
Ondřej Vašík
fe6f4e305c cp: fix a probably redundant chmod when setting xattrs
* src/copy.c (copy_reg): Fix initial value of access_changed variable.
This was introduced by Pádraig Brady in commit cca83faf, 2009-09-14,
"cp,mv: preserve extended attributes even for read-only files"
2009-09-15 10:51:13 +01:00
Jim Meyering
a77fb35364 doc: NEWS: mention origin of touch -t ....60 bug
* NEWS: It is an old bug.
2009-09-14 15:57:13 +02:00
Jim Meyering
94eca76776 doc: touch, document that it accepts .60
* doc/coreutils.texi (touch invocation): Document that SS may be 60.
2009-09-14 15:37:26 +02:00
Jim Meyering
20761ce686 touch: don't reject "60" as number of seconds in a legacy time stamp
A valid command like "touch -t 197101010000.60 F" would fail due
to the suffix of ".60".  This bug is fixed via the latest change
to gnulib's posixtm module.
* tests/touch/60-seconds: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
2009-09-14 15:27:51 +02:00
Jim Meyering
df84346ebc build: update gnulib submodule to latest, for fixed posixtm module 2009-09-14 15:27:51 +02:00
Jim Meyering
71bac0dac3 maint: use #!/bin/sh consistently in shell-based test scripts
* tests/misc/sort-continue: Change first line to standard #!/bin/sh,
not #!/bin/bash (though it doesn't matter, since each is invoked
via $(SHELL) dir/test-name.
2009-09-14 15:27:02 +02:00
Pádraig Brady
d41dbb187f tests: fix dd/skip-seek-past-file to work on ecryptfs
* tests/dd/skip-seek-past-file: Require sparse support
to ensure that when we're checking if we can create an
$OFF_T_MAX length file, that we don't actually allocate
any space.  This was an issue on ecryptfs and was reported
by Bert Wesarg.
2009-09-14 14:22:02 +01:00
Ondřej Vašík
cca83fafa6 cp,mv: preserve extended attributes even for read-only files
* src/copy.c (copy_reg): Temporarily set u+rw on the destination file
to allow GNU/Linux to set xattrs.
* tests/misc/xattr: Test that change.
* NEWS (Bug fixes): Mention it.
Reported by Ernest N. Mamikonyan.
2009-09-14 14:19:03 +01:00
Jim Meyering
eb1299481a doc: improve timeout's --help message
* src/timeout.c (usage): Improve --help description.
2009-09-14 09:18:30 +02:00
Jim Meyering
255a6a201e maint: use consistent cpp indentation in all .c files
* src/stty.c: Make cpp indentation reflect nesting.
* src/factor.c: Likewise.
2009-09-13 22:05:37 +02:00
Jim Meyering
f6f78f093b doc: NEWS: say quadratic and linear, rather than O(N^2) and O(N)
* NEWS: Use a slightly less technical description.
Suggested by Andreas Schwab.
2009-09-13 12:11:57 +02:00
Jim Meyering
21b617b78b doc: improve NEWS
* NEWS (rm -r, without -f): Mention that the N in "O(N)" represents
hierarchy depth.  Suggested by Ralf Wildenhues.
(rm -r, standards conformance): Make wording more accurate.
2009-09-13 11:58:48 +02:00
Jim Meyering
ebbf0a1f0f id: don't print context=... when POSIXLY_CORRECT is set
* src/id.c (print_full_info) [POSIXLY_CORRECT]: Don't print context.
Reported by Ulrich Drepper.
* NEWS (Changes in behavior): Mention it.
* doc/coreutils.texi (id invocation): Document that id also prints the
security context, when possible, and when POSIXLY_CORRECT is not set.
* tests/id/no-context: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.
2009-09-11 19:58:18 +02:00
Eric Blake
398749b0cc rm: avoid compiler warning
* src/remove.c (rm_fts): Don't allow fall-through when assertions
are disabled.
2009-09-11 14:08:58 +02:00
Eric Blake
e5dba03d2f euidaccess-stat: remove unnecessary macros
* lib/euidaccess-stat.c (F_OK, R_OK, W_OK, X_OK): Delete; now
guaranteed by gnulib.
2009-09-11 14:08:58 +02:00
Eric Blake
c756343503 rm: use gnulib faccessat
* bootstrap.conf (gnulib_modules): Add faccessat.  Replace strdup
with strdup-posix.
* m4/jm-macros.m4 (coreutils_MACROS): Revert previous change, now
that gnulib does it for us.
* src/remove.c (write_protected_non_symlink): Use faccessat in
more situations.
2009-09-11 14:08:58 +02:00
Jim Meyering
722287e443 rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)
where N is the depth of the deepest hierarchy rm is processing.
* src/remove.c (write_protected_non_symlink): Use faccessat to
avoid O(N)-per-entry cost of calling euidaccess.
* m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat.
* NEWS (Improvements): Mention it.
2009-09-11 14:08:58 +02:00
Jim Meyering
9966c92dd4 build: placate gcc's new -Wskip-jump-init
* remove.c (rm_fts): Put braces around each of the two offending blocks.
* configure.ac: Don't turn off -Wjump-misses-init.
With the rewrite of remove.c, it is no longer needed.
2009-09-11 14:08:58 +02:00
Jim Meyering
4f73ecaf7d rm: rewrite to use fts
* remove.c: Don't include "unlinkdir.h"; no longer used.
Do not include <setjmp.h> or "cycle-check.h".  Likewise.
Include "xfts.h".
(dir_name, dir_len): Remove definitions.
(CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Likewise.
(INODE_SORT_DIR_ENTRIES_THRESHOLD, NEED_REWIND, D_TYPE): Likewise.
(struct dirstack_state, Dirstack_state): Likewise.
(g_buf, g_n_allocated): Remove declarations.
(hash_freer, hash_compare_strings, rm_malloc): Remove functions.
(rm_free, push_dir, top_dir, pop_dir, right_justify): Likewise.
(full_filename0, xfull_filename, full_filename_): Likewise.
(AD_stack_height, AD_stack_top, AD_stack_pop, AD_stack_clear): Likewise.
(obstack_init_minimal, ds_init, ds_clear, ds_free): Likewise.
(AD_pop_and_chdir, AD_ensure_initialized, AD_mark_helper): Likewise.
(AD_mark_as_unremovable, AD_mark_current_as_unremovable): Likewise.
(AD_push_initial, AD_push, AD_push, AD_is_removable): Likewise.
(write_protected_non_symlink): Change 3rd parameter from
dirstack_state "ds" to full_name.
(prompt): Adjust parameters.  Now, state comes from FTS/FTSENT pair.
Those replace fd_cwd and "ds".  Remove "filename".  Remove pdirent_type
in favor of new "is_dir" parameter.  Rename is_empty to is_empty_p.
(DO_RMDIR, DO_UNLINK): Remove definitions.
(remove_entry, fd_to_subdirp, compare_ino): Remove functions.
(dirent_count, dirent_inode_sort_may_be_useful): Likewise.
(preprocess_dir): Likewise.
(fts_skip_tree, mark_ancestor_dirs, excise, rm_fts): New functions.
(remove_cwd_entries, remove_dir, rm_1): Remove functions.
(rm): Rewrite as a simple loop calling fts_read and dispatching
each entry via rm_fts.
* src/rm.c (main): Adapt to new signature of rm().
* bootstrap.conf (gnulib_modules): Remove unlinkdir, no longer used.
* src/Makefile.am (sc_tight_scope): Also recognize an extern "enum"
declaration.
* tests/rm/empty-name: Adjust expected output to match new diagnostic.
* NEWS (Improvements): Mention it.
2009-09-11 14:08:51 +02:00
Jim Meyering
880a6e7723 maint: doc: adjust README-release
* README-release: Remove mention of bootstrap's old
--gnulib-srcdir=/gnulib option.  No longer needed, and its
use can lead to subtle problems.
2009-09-11 13:14:07 +02:00
Jim Meyering
bd11475627 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-09-11 08:16:18 +02:00
Jim Meyering
aa2f797c7d version 7.6
* NEWS: Record release date.
2009-09-11 07:53:16 +02:00
Jim Meyering
ebc7aacf7b link,ln: use gnulib's link module to work around Solaris 10 deficiency
Before this change, :>f; ln -T f no-such/ would succeed on Solaris 10.
After it, ln fails, as it should: ln: accessing `z/': Not a directory
The command, link f no-such/, had the same problem on that system.
* bootstrap.conf (gnulib_modules): Add "link".
* tests/ln/slash-decorated-nonexistent-dest: New test.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Portability): Mention the improvement.
2009-09-10 18:52:12 +02:00
Jim Meyering
15223b0c3b build: update gnulib submodule to latest 2009-09-10 16:58:15 +02:00
Ondřej Vašík
b64d9b6d9e doc: improve various BLOCKSIZE and SIZE help
* doc/coreutils.texi (multiplierSuffixes): Mention that
the suffix can be specified without a leading number
* src/split.c (usage): Refactor SIZE help to within a function
* src/truncate.c (usage): Likewise
* src/ls.c (usage): Likewise
* src/df.c (usage): Likewise. Also add a function with BLOCKSIZE help
* src/du.c (usage): Likewise.
* src/system.h: Define 2 functions to emit common help text
This was prompted by https://bugzilla.redhat.com/show_bug.cgi?id=511188
2009-09-10 15:28:50 +01:00
Jim Meyering
0bbb9d7785 dd conv=unblock: print final newline consistently
* src/dd.c (dd_copy) [C_UNBLOCK]: Always print the final newline for
non-empty output, not just when output size is a multiple of cbs.
* doc/coreutils.texi (dd invocation) [conv=unblock]: Mention that dd
prints a newline after each output record, not just when replacing
trailing spaces.
Reported by Ulrich Drepper.
* tests/dd/unblock: New file.  Test for this.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
2009-09-10 12:25:04 +02:00
Jim Meyering
f1e1e89e81 maint: make cfg.mk slightly more generic
* cfg.mk (url_dir_list): Don't hard-code "coreutils".  Use $(PACKAGE).
2009-09-09 16:44:37 +02:00
Jim Meyering
1c0ec3541c * gnulib: Update submodule to latest. 2009-09-08 13:30:38 +02:00
Jim Meyering
f0ff8c73fe tail: make the new piped-stdin test as portable as the old one
* src/tail.c (main): Adapt piped-stdin test to use the same isapipe,
test as was used in the preceding POSIXLY_CORRECT condition.
Remove the now-subsumed POSIXLY_CORRECT test.
Reported by Pádraig Brady.
* doc/coreutils.texi (tail invocation): Document this change.
* NEWS (Changes in behavior): Reclassify, clarify.
2009-09-08 13:30:38 +02:00
Pádraig Brady
e8591fd39f tests: tail-2/assert: reduce risk of race condition
* tests/tail2/assert: This reverts commit be853120, 25-08-2009,
"tests: tail-2/assert: avoid risk of race condition"
kill -0 doesn't send a signal and so will only confirm that the
background process was forked, which we know already because
we have its pid.
2009-09-08 10:01:45 +01:00
Pádraig Brady
a863644397 tests: address a race condition in misc/cat-buf
* tests/misc/cat-buf: Increase the delay between writes
to decrease the chance that dd will read both at once.
Since the test is inherently racy, print a warning via
skip_test_ rather than failing outright.
Reported by Jim Meyering.
2009-09-08 01:43:31 +01:00
Jim Meyering
f6d1f70183 tail: syntax-only: use "false", rather than equivalent, 0
* src/tail.c (record_open_fd): Initialize "->ignore" to false, not 0.
2009-09-07 23:20:01 +02:00
Jim Meyering
af6436559c tail: ignore -f for piped-stdin, as POSIX requires
* src/tail.c (main): Tailing a pipe "forever" is not useful,
and POSIX specifies that tail ignore the -f when there is no
file argument and stdin is a FIFO or pipe.  So we do that.
In addition, GNU tail excludes "-" arguments from the list of files
to tail forever, when the associated file descriptor is connected
to a FIFO or pipe.  Before this change, ":|tail -f" would hang.
Reported by Ren Yang and Ulrich Drepper.
* tests/tail-2/pipe-f: Test for this.
* tests/tail-2/pipe-f2: Ensure tail doesn't exit early for a fifo.
* tests/Makefile.am (TESTS): Add these tests.
* NEWS (POSIX conformance): Mention it.
2009-09-07 23:19:56 +02:00
Pádraig Brady
fd9750b0ff tests: tail-2/flush-initial should not rely on stdbuf
* tests/tail-2/flush-initial: stdbuf is not built on all systems.
In any case it's redundant since stdout will automatically be buffered
since we're redirecting to file. So just call tail without using stdbuf.
2009-09-07 21:52:30 +01:00
Jim Meyering
a8d26b3ce1 tail: don't give up on inotify mode for an already-ignored "-"
* src/tail.c (main): Adjust today's change to honor the
F[i].ignore flag that may have been set in tail_file.
2009-09-07 20:56:38 +02:00
Jim Meyering
a4a864da36 tests: misc/cat-buf: clean up syntax
* tests/misc/cat-buf: Don't suppress dd's stderr.
Remove useless quotes.
2009-09-07 20:23:03 +02:00
Jim Meyering
9547a78bda tests: ls/color-clear-to-eol: append NL to accommodate old sed
* tests/ls/color-clear-to-eol: Some vendor sed programs fail
to operate on lines that are not NL-terminated.
This affects at least Solaris 10's /bin/sed.
Reported by Pádraig Brady.
2009-09-07 19:36:37 +02:00
Jim Meyering
494fed0271 tests: tail-2/infloop-1: avoid rare test failure on a busy system
* tests/tail-2/infloop-1: Sleep 3 seconds, not 1, but in increments
of 0.1 second.  Before, this test would fail ~1 time in 20 via
"make -j9 check" on a quad-core system.
Correct comment.
2009-09-07 13:55:37 +02:00
Jim Meyering
61cc6fbc27 build: update gnulib submodule to latest 2009-09-07 09:23:57 +02:00
Jim Meyering
f68f5f23c6 doc: tweak NEWS
* NEWS (dd): Tweak wording.
Two blank lines between sections.
2009-09-07 09:23:48 +02:00
Jim Meyering
cdfb703c5d tail -f: handle "-"/stdin once again
* src/tail.c (main) [HAVE_INOTIFY]: When stdin (i.e., "-", or no args,
but not /dev/stdin) is specified on the command line, don't use inotify.
Reported by Bill Brelsford in <http://bugs.debian.org/545422>.
* tests/tail-2/follow-stdin: New file.  Test for this.
* tests/Makefile.am (TESTS): Add the test.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-07 09:01:14 +02:00
Jim Meyering
15f26e296b tests: tail-2/flush-initial: correct race avoidance code
* tests/tail-2/flush-initial: Wait for the file to be nonempty,
not for the process.  Based on a suggestion from Pádraig Brady.
2009-09-06 20:00:34 +02:00
Jim Meyering
467cc9bb43 tests: ls-misc: don't let a bogus umask cause test failure
* tests/misc/ls-misc: Set umask to 022.  A umask setting permitting
world-write access, e.g., umask o+w, would cause this test to fail.
Report by Mathias Brodala and analysis by Tom Fitzhenry in
<http://bugs.debian.org/544965>.
2009-09-06 18:40:40 +02:00
Jim Meyering
d54376db68 tail: flush initial output before possibly blocking
* src/tail.c (main): Flush any output from tail_file,
before calling tail_forever_inotify, which can block.
* tests/tail-2/flush-initial: New file.  Test for the bug.
* tests/Makefile.am (TESTS): Add tail-2/flush-initial.
* NEWS (Bug fixes): Mention it.
This bug was introduced in coreutils-7.5 via commit ae494d4b,
2009-06-02, "tail: use inotify if it is available".
2009-09-06 09:40:43 +02:00
Jim Meyering
af054f80b2 maint: remove unused file: lib/fdopendir-glibc.c
* lib/fdopendir-glibc.c: Remove unused file.

2009-09-05  Jim Meyering  <meyering@redhat.com>
2009-09-05 19:52:16 +02:00
Jim Meyering
c392c4b8ef tests: ls/stat-vs-dirent: avoid spurious test failure
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".
2009-09-05 19:06:31 +02:00
Pádraig Brady
471f219ac7 doc: make the tail --sleep-interval help less confusing
* src/tail.c (usage): I read "approximately S seconds"
as "approximately 5 seconds" for approximately 5 seconds.
2009-09-05 17:25:40 +01:00
Pádraig Brady
a5e224d793 maint: remove some tab indentation from copy.c
* src/copy.c (copy_internal): Remove tabs erroneously added
in commit 3346c0af.
2009-09-05 17:22:09 +01:00
Pádraig Brady
526a057602 tests: test old tail -f method even on systems with inotify
* src/tail.c (main): Add an undocumented ---disable-inotify option
to allow disabling inotify.
* tests/tail-2/pid: Run test in both normal and "disable_inotify" modes.
* tests/tail-2/tail-n0f: Likewise.
* tests/tail-2/wait: Likewise.
* tests/tail-2/append-only: Likewise.
2009-09-05 17:19:03 +01:00
Eric Blake
41c9e064a6 rm: avoid compiler warning
* src/remove.c (rm_fts): Don't allow fall-through when assertions
are disabled.
2009-09-05 16:28:46 +02:00
Eric Blake
5f303a1293 euidaccess-stat: remove unnecessary macros
* lib/euidaccess-stat.c (F_OK, R_OK, W_OK, X_OK): Delete; now
guaranteed by gnulib.
2009-09-05 16:28:46 +02:00
Eric Blake
2df272914b rm: use gnulib faccessat
* bootstrap.conf (gnulib_modules): Add faccessat.  Replace strdup
with strdup-posix.
* m4/jm-macros.m4 (coreutils_MACROS): Revert previous change, now
that gnulib does it for us.
* src/remove.c (write_protected_non_symlink): Use faccessat in
more situations.
2009-09-05 16:28:46 +02:00
Jim Meyering
278109b9f4 NEWS: mention recent improvements in rm 2009-09-05 16:28:46 +02:00
Jim Meyering
0f3f7d495c rm: improve efficiency of rm -r (without -f) from O(N^2) to O(N)
where N is the depth of the deepest hierarchy rm is processing.
* src/remove.c (write_protected_non_symlink): Use faccessat to
avoid O(N)-per-entry cost of calling euidaccess.
* m4/jm-macros.m4 (coreutils_MACROS): Check for faccessat.
2009-09-05 16:28:46 +02:00
Jim Meyering
4f87cc0364 build: placate gcc's new -Wskip-jump-init
* remove.c (rm_fts): Put braces around each of the two offending blocks.
* configure.ac: Don't turn off -Wjump-misses-init.
With the rewrite of remove.c, it is no longer needed.
2009-09-05 16:28:46 +02:00
Jim Meyering
18c5fbd5dc rm: rewrite to use fts
* remove.c: Don't include "unlinkdir.h"; no longer used.
Do not include <setjmp.h> or "cycle-check.h".  Likewise.
Include "xfts.h".
(dir_name, dir_len): Remove definitions.
(CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Likewise.
(INODE_SORT_DIR_ENTRIES_THRESHOLD, NEED_REWIND, D_TYPE): Likewise.
(struct dirstack_state, Dirstack_state): Likewise.
(g_buf, g_n_allocated): Remove declarations.
(hash_freer, hash_compare_strings, rm_malloc): Remove functions.
(rm_free, push_dir, top_dir, pop_dir, right_justify): Likewise.
(full_filename0, xfull_filename, full_filename_): Likewise.
(AD_stack_height, AD_stack_top, AD_stack_pop, AD_stack_clear): Likewise.
(obstack_init_minimal, ds_init, ds_clear, ds_free): Likewise.
(AD_pop_and_chdir, AD_ensure_initialized, AD_mark_helper): Likewise.
(AD_mark_as_unremovable, AD_mark_current_as_unremovable): Likewise.
(AD_push_initial, AD_push, AD_push, AD_is_removable): Likewise.
(write_protected_non_symlink): Change 3rd parameter from
dirstack_state "ds" to full_name.
(prompt): Adjust parameters.  Now, state comes from FTS/FTSENT pair.
Those replace fd_cwd and "ds".  Remove "filename".  Remove pdirent_type
in favor of new "is_dir" parameter.  Rename is_empty to is_empty_p.
(DO_RMDIR, DO_UNLINK): Remove definitions.
(remove_entry, fd_to_subdirp, compare_ino): Remove functions.
(dirent_count, dirent_inode_sort_may_be_useful): Likewise.
(preprocess_dir): Likewise.
(fts_skip_tree, mark_ancestor_dirs, excise, rm_fts): New functions.
(remove_cwd_entries, remove_dir, rm_1): Remove functions.
(rm): Rewrite as a simple loop calling fts_read and dispatching
each entry via rm_fts.
* src/rm.c (main): Adapt to new signature of rm().
* bootstrap.conf (gnulib_modules): Remove unlinkdir, no longer used.
* src/Makefile.am (sc_tight_scope): Also recognize an extern "enum"
declaration.
* tests/rm/empty-name: Adjust expected output to match new diagnostic.
2009-09-05 16:28:46 +02:00
Jim Meyering
cf963e5a54 rm: record timing data
* README-rm-timing-compare: new file
* README-rm-timing-2: New file.
2009-09-05 16:28:46 +02:00
Jim Meyering
70eadcb4e6 build: update gnulib submodule to latest 2009-09-05 16:28:24 +02:00
Petr Salinger
305bbd99b2 stty: use TAB0, TAB1, and TAB2 only if defined
* src/stty.c (mode_info) [TAB0, TAB1, TAB2]: Guard each
entry with #ifdef.  Required for GNU/kFreeBSD.
Reported by Petr Salinger in http://bugs.debian.org/520368.
2009-09-05 15:54:26 +02:00
Eric Blake
c45b4237bc build: update from gnulib
* gnulib: Update submodule to latest.
2009-09-04 20:46:01 -06:00
Eric Blake
c692280926 ln: add comments related to POSIX 2008
* src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Delete.
(do_link): Update comments per POSIX; add FIXME for -L, -P.
2009-09-04 14:54:55 -06:00
Eric Blake
3346c0afbc mv, cp: tweak LINK_FOLLOWS_SYMLINKS logic
* gnulib: Update to latest gnulib.
* src/copy.c (copy_internal): Adjust comment in light of POSIX
2008, and deal with macro now being tri-state.
2009-09-04 14:54:52 -06:00
Petr Salinger
a23afe7b72 tests: fix a tail-2/pid failure on GNU/kFreeBSD
* tests/tail-2/wait: Increase the file name recheck frequency to
fix a failure on systems without inotify and a file timestamp precision
of 1 second (like GNU/kFreeBSD).
2009-09-04 18:14:55 +01:00
Pádraig Brady
82f09f4762 tests: fix a failure when running tail-2/wait as root
* tests/tail-2/wait: Silently skip a portion of the test
when running as root, rather than failing the whole test.
This regression was introduced with commit 84b5844d, 2009-09-03,
"tests: simplify and fix a race in 2 tail --follow tests".
2009-09-04 17:39:26 +01:00
Mike Frysinger
370fa0fa42 build: fix libcap configure flag handling
* m4/jm-macros.m4 (coreutils_MACROS): The code to handle configure-time
enabling or disabling of libcap support was broken.  It would treat any
libcap configure option as --disable-libcap because it doesn't check
$enableval at all.  This change makes sure we do the sane thing:
  --disable-libcap -> disable and don't run any tests
  --enable-libcap -> run tests and fail if not found
  default -> run tests and warn if not found
2009-09-04 08:48:03 +02:00
Jim Meyering
e0e8429c24 df: don't fail due to an unreadable argument
* src/df.c (main): If open or fstat fails when we're trying to ensure
that all arg-partitions are automounted, fall back on using stat.
Inspired by the report and patch from Olivier Fourdan in
http://bugzilla.redhat.com/520630.
* NEWS (Bug fixes): Mention it.
* tests/df/unreadable: New test for the above.
* tests/Makefile.am (TESTS): Add df/unreadable.
The bug was introduced in coreutils-7.3 via commit dbd17157,
2009-04-28, "df: use open(2), not stat, to trigger automounting".
2009-09-03 19:52:47 +02:00
Kamil Dudka
1422cabf93 doc: install -C: fix bug in the texi documentation
* doc/coreutils.texi: Move the documentation for install --compare (-C)
from the section on fmt to that for install.
Reported by Florian Schlichting.
2009-09-03 16:24:14 +02:00
Pádraig Brady
84b5844d21 tests: simplify and fix a race in 2 tail --follow tests
* tests/tail-2/pid: Use the timeout command to determine process
longevity, rather than querying /proc/$pid/status.
The latter was racy in any case when inotify is used, as then
tail wakes up periodically even for unchanging files therefore
causing the check for "S (sleeping)" state to fail intermittently.
* tests/tail-2/wait: Likewise.
2009-09-03 10:08:06 +01:00
Ondřej Vašík
1a94ac4a05 cp: don't leak resources for each xattr preservation failure
* src/copy.c (copy_reg): Don't return from the function after an
unsuccessful and required preservation of extended attributes.
This resulted in leaking the copy buffer and file descriptors.
* NEWS (Bug fixes): Mention the fix.
The bug was introduced in coreutils-7.1 via commit 0889381c, 2009-01-23,
"cp/mv: add xattr support".
2009-09-03 10:00:32 +01:00
Pádraig Brady
1b2d2635ee chcon, chmod, chgrp, chown, du: report fts_close failure
* src/du.c (du_files): Don't fail silently upon fts_close failure.
* src/chcon.c (process_files): Likewise.
* src/chmod.c (process_files): Likewise.
* src/chown-core.c (chown_files): Likewise.
2009-09-01 13:05:06 +02:00
Jim Meyering
fa3e9cb9af build: update from gnulib
* gnulib: Update submodule to latest.
2009-09-01 12:10:07 +02:00
Jim Meyering
228c8e9eec chcon, chmod, chgrp, chown, du: do not ignore fts_close failure
This is probably never visible, but who knows...
* src/chcon.c (process_files): Don't ignore fts_close failure.
* src/chmod.c (process_files): Likewise.
* src/chown-core.c (chown_files): Likewise.
* src/du.c (du_files): Likewise.
2009-09-01 12:10:07 +02:00
Jim Meyering
1ce27f74ec maint: du: remove unnecessary initialization
* src/du.c (main): Don't set "skip_file" unnecessarily.
2009-09-01 12:10:07 +02:00
Jim Meyering
b2c30136dc maint: chown, chgrp, chmod, chcon: remove unnecessary initialization
* src/chown-core.c: Include "ignore-value.h".
(change_file_owner): Don't set "ent" only to ignore it.
* src/chcon.c (process_file): Likewise.
* src/chmod.c: Include "ignore-value.h".
(process_file): Don't set "ent" only to ignore it.
After diagnosing root-dev/ino failure, return false immediately:
Now that we don't set "ent" we must be sure not to use it uninitialized,
and there's no point in issuing --verbose-related output in this case.
2009-09-01 12:10:07 +02:00
Jim Meyering
e3b14643f4 maint: shred: remove unnecessary initialization
* src/shred.c (genpattern): Value stored to "n" is never used.
2009-09-01 12:10:07 +02:00
Jim Meyering
e579a697b2 maint: dd: remove unnecessary initialization
* src/dd.c (skip): Remove set-but-never-used variable, soffset.
2009-09-01 12:10:07 +02:00
Jim Meyering
68c9b31834 maint: tail: remove unnecessary initialization
* src/tail.c (tail_bytes): Don't compute "diff" twice.
2009-09-01 12:10:07 +02:00
Jim Meyering
856ba44297 maint: mbsalign.c: remove unnecessary assignment
* gl/lib/mbsalign.c (mbsalign): Remove assignment, the result of which
is never used.
2009-09-01 12:10:06 +02:00
Pádraig Brady
8f7d8e3bc3 timeout: remove a redundant assignment
* src/timeout.c (main): While keeping argc and argv in
sync may be marginally useful, it is redundant to update argc,
so just remove that to suppress the clang warning.
2009-09-01 11:07:15 +01:00
Pádraig Brady
0b1dcf33f5 timeout: defensive handling of all wait() errors
* src/timeout.c (main): Handle all possible cases of unexpected
failures from wait().  This was prompted by the clang tool reporting
the possible non-initialization of the status variable.
2009-09-01 11:02:18 +01:00
Jim Meyering
a977dbbe78 ls -i: print consistent inode numbers also for mount points
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT
would print the wrong inode number for any entry that is a mount point.
It would do that by relying on readdir's dirent.d_ino values, while
most readdir implementations return the inode number of the underlying,
inaccessible directory.  Thus, it is not consistent with what you'd
get when applying stat to the same entry.  This bug led to surprising
results like "ls -i" and "ls -i --color" printing different numbers (ls
must usually "stat" a file to colorize its name).  This change makes it
so that on offending systems, ls must stat non-command-line-arguments
for which otherwise it would be able to use "for free" dirent.d_ino
values.  Regardless of this change, ls is already required to stat every
command-line argument.  Note: versions of GNU ls prior to coreutils-6.0
did not perform the invalid optimization, and hence always printed
correct inode numbers.  Thus, for the sake of correctness, ls -i is
forgoing the readdir optimization, for any kernel (including linux!)
with POSIX-nonconforming readdir.  Note that currently, only Cygwin has
been agile enough to conform.

* src/ls.c (RELIABLE_D_INO): Define.
(print_dir): Use it.
For plenty of discussion, see this long thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020
This bug was introduced by the 2006-02-26 commit, 33eb3efe:
"In ls, avoid calling stat for --inode (-i), when possible."
* tests/ls/readdir-mountpoint-inode: New test.
* tests/Makefile.am (TESTS): Add it.
* tests/ls/stat-vs-dirent: Don't suppress failure of this test,
now that ls -i is fixed.  Though note that it doesn't test well,
since it compares only the always-stat'd command-line arguments.
* NEWS (Bug fixes): Mention it.
2009-09-01 07:07:45 +02:00
Jim Meyering
a4e123abd3 maint: revert my stdbuf change: the result didn't even compile
This reverts commit c1e158489d.
2009-08-31 09:44:30 +02:00
Jim Meyering
c1e158489d maint: stdbuf: move a declaration; no-semantic-change
* src/stdbuf.c (set_program_path): Move a declaration down into
the scope where it's used.
2009-08-30 22:34:06 +02:00
Jim Meyering
12a104b45e build: quiet "make check" in src/
* src/Makefile.am (check-duplicate-no-install): Use $(AM_V_GEN).
(check-README): Likewise.  And $(AM_V_at).
2009-08-30 12:22:30 +02:00
Jim Meyering
e3ccc324d3 doc: cp: update note on preserving symlink time stamps
* doc/coreutils.texi (cp invocation): Now, we *do* preserve time
stamps on symlinks, when possible.
2009-08-30 12:02:02 +02:00
Jim Meyering
a10ba58f3c build: update bootstrap from gnulib
* bootstrap: Merge from gnulib.
2009-08-30 12:02:02 +02:00
Pádraig Brady
56300b1dc2 tests: don't misbehave if $TMPDIR contains spaces
* tests/misc/xattr: Add quotes.
* tests/mv/acl: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
2009-08-30 10:58:13 +01:00
Jim Meyering
0a859a6cb0 tests: other-fs-tmpdir: don't misbehave for quote-unfriendly $TMPDIR
* tests/other-fs-tmpdir: Quote uses of variables that might expand
to strings containing e.g., whitespace.
2009-08-29 19:19:37 +02:00
Jim Meyering
450df0f26d build: update from gnulib
* gnulib: Update submodule to latest.
2009-08-29 17:30:14 +02:00
Jim Meyering
98ec4beba5 tests: move a coreutils-specific test from maint.mk to Makefile.am
* Makefile.am (distcheck-hook): Make taint-distcheck here, since it's
no longer done via maint.mk.
2009-08-29 17:29:45 +02:00
Jim Meyering
6c497c6c2d tests: cp/reflink-auto guard against a pathological $TMPDIR
* tests/cp/reflink-auto: Add quotes.
2009-08-29 17:29:32 +02:00
Pádraig Brady
9e59f8c47c cp --reflink: preserve attributes on cloned files if asked
* src/copy.c (copy_reg): When cloning only skip the data copying
* tests/cp/reflink-perm: New test to check times and modes copied
* tests/Makefile.am: Reference the new test
* NEWS: Mention the fix
2009-08-29 01:37:05 +01:00
Pádraig Brady
72f98388c3 cp --reflink: add an "auto" parameter to fall back to a normal copy
* doc/coreutils.texi (cp invocation): Document the new
"auto" and "always" options to --reflink.
* src/copy.c (copy_reg): Fall back to a standard copy
when reflink() is not supported and --reflink=auto specified.
* src/copy.h [struct cp_options] (reflink): Change type s/bool/enum/.
* src/cp.c (usage): Describe the --reflink={always,auto} options
and expand a little on what --reflink does.
(main): parse the new parameters to --reflink and allow all
--sparse options with --reflink=auto.
* src/install.c (cp_option_init): Init the enum instead of bool.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/reflink-auto: A new test for falling back to normal copy.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature.
2009-08-29 00:24:49 +01:00
Pádraig Brady
f296cf4052 stdbuf: fix a small typo in --help output
* src/stdbuf.c (usage): s/then/the/
2009-08-28 23:35:48 +01:00
Eric Blake
359fa92f2a build: avoid unused variable warnings on cygwin
* src/copy.c (clone_file, copy_attr_by_fd, copy_attr_by_name):
Mark up unused variables.
* src/remove.c (dirent_inode_sort_may_be_useful): Likewise.
2009-08-28 12:56:53 -06:00
Eric Blake
31fa922e57 dd: detect closed stderr
* src/dd.c (maybe_close_stdout): Always flush stderr; regression
introduced in commit 381e69ea.
* tests/misc/close-stdout (p): Use consistent style.
* tests/dd/stderr: New test, borrowing from misc/close-stdout.
* tests/Makefile.am (TESTS): Run it.
* NEWS: Mention this.
2009-08-28 12:56:51 -06:00
Jim Meyering
59a6ddfca3 maint: ignore only man/*.1, not all *.1 files
* .gitignore: Ignore *.1 only in man/
2009-08-28 14:29:02 +02:00
Jim Meyering
de619c8fa5 build: prefix a few rules with $(AM_V_GEN)
* Makefile.am (.version, dist-hook, gen-ChangeLog): Use $(AM_V_GEN)
and $(AM_V_at), so that automake's silent-rules option (make V=1/V=0)
now controls whether the commands are printed at build time.
(THANKS-to-translators, check-ls-dircolors): Likewise.
2009-08-27 10:18:08 +02:00
Jim Meyering
847359b11d build: stop earlier if touching ChangeLog fails
* bootstrap.conf: Exit right away if touching ChangeLog fails.
Otherwise, the touch failure message is buried under configure output.
2009-08-26 18:21:12 +02:00
Jim Meyering
d6639ee63b tests: mkdir/selinux: avoid spurious failure on some SELinux systems
* tests/test-lib.sh (require_selinux_enforcing_): New function.
* tests/mkdir/selinux: Use it.
Otherwise, this test would fail on Rawhide with SELinux disabled.
2009-08-26 10:06:53 +02:00
Jim Meyering
be8531206b tests: tail-2/assert: avoid risk of race condition
* tests/tail-2/assert: Avoid spurious failure due to race condition.
Rather than sleeping for 1 second and crossing fingers,
wait explicitly for backgrounded tail process to start.
Otherwise, this test would fail under heavy load.
2009-08-26 09:25:21 +02:00
Jim Meyering
899c1d00fa maint: ensure we don't embed Emacs indent-tabs-mode setting lines
Now that we prohibit indentation via TABs, there's no need for
Emacs indent-tabs-mode setting lines, so prohibit those, too.
* cfg.mk (sc_prohibit_emacs__indent_tabs_mode__setting): New rule.
2009-08-25 09:21:00 +02:00
Jim Meyering
e2808a3999 maint: remove Local Variables: indent-tabs-mode: nil from all sources
* src/getlimits.c: Likewise.
* src/group-list.c: Likewise.
* src/groups.c: Likewise.
* src/mktemp.c: Likewise.
* src/setuidgid.c: Likewise.
* src/stdbuf.c: Likewise.
* src/timeout.c: Likewise.
* src/truncate.c: Likewise.
* gl/lib/mbsalign.c: Likewise.
* tests/test-lib.sh: Likewise.
* bootstrap: Likewise.
* README-hacking: Likewise.
2009-08-25 09:21:00 +02:00
Jim Meyering
ddfcccce51 doc: HACKING: mention the new space-only indentation policy 2009-08-25 09:21:00 +02:00
Jim Meyering
1130e181ee maint: teach "make syntax-check" the space-only indentation rule
* cfg.mk (sc_prohibit_tab_based_indentation): New rule.
* .x-sc_prohibit_tab_based_indentation: New file.
* Makefile.am (syntax_check_exceptions): Add file,
.x-sc_prohibit_tab_based_indentation.
2009-08-25 09:21:00 +02:00
Jim Meyering
5e778f7c8d global: convert indentation-TABs to spaces
Transformed via this shell code:
t=$'\t'
git ls-files \
  | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
  | grep -vE 'tests/pr/|help2man' \
  | xargs grep -lE "^ *$t" \
  | xargs perl -MText::Tabs -ni -le \
    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-08-25 09:21:00 +02:00
Jim Meyering
2bc0f3caaa cp: ignore obscure failure to preserve symlink time stamps,
...when run on a kernel older than what was implied by headers and
libraries tested at configure time.
* src/copy.c (utimens_symlink): Ignore failure when errno == ENOSYS.
* NEWS (Bug fixes): Mention it.
Reported by Todd Zullinger and Kamil Dudka.
Details in this thread:
http://thread.gmane.org/gmane.linux.redhat.fedora.devel/119834
2009-08-24 12:44:13 +02:00
Jim Meyering
831acb987e tests: skip (don't fail) a cp test, upon mount-related failure
* tests/cp/cp-mv-enotsup-xattr: Upon a set-up failiure, rather than
failing the test with a "framework failure" diagnostic, just skip it.
Russell Whitaker reported that this test failed on slackware.
2009-08-23 22:05:58 +02:00
Jim Meyering
1d651b954f build: update from *public* gnulib
* gnulib: Update submodule to latest.
Kamil Dudka reported that bootstrap was broken.
2009-08-23 10:13:36 +02:00
Jim Meyering
99e607b910 build: update from gnulib
* gnulib: Update submodule to latest.
2009-08-22 16:12:26 +02:00
Jim Meyering
04a31ad99d post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-08-20 21:48:45 +02:00
Jim Meyering
af1996dde2 version 7.5
* NEWS: Record release date.
2009-08-20 21:19:36 +02:00
Jim Meyering
7f242fadfa tests: skip the stdbuf tests when the abs build directory name is bogus
* tests/misc/stdbuf: Avoid spurious failure when the directory name
from which we'd set LD_PRELOAD contains unsafe characters.
2009-08-20 19:47:12 +02:00
Jim Meyering
3db7c2c03c install: avoid a portability bug when compiling with non-gcc
* src/install.c (extra_mode): Be careful to return only a 0 or 1
value, since this is a "bool" function, and there are still some
compilers for which this is necessary.  Without this change,
Bernhard Voelker reported that the Forte Developer 7 C 5.4 2002/03/09
compiler would produce a malfunctioning "install" binary.  Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17710/focus=17760
2009-08-20 10:46:22 +02:00
Jim Meyering
a70ac4ef32 tests: make install-C slightly less prone to confusion
* tests/install/install-C: Invoke framework_failure, if necessary.
2009-08-19 17:10:23 +02:00
Jim Meyering
112bccb26b build: avoid "make dist" failure in man/
Now that "make check" no longer builds programs like arch, ...
* src/Makefile.am (dist-hook): Depend on $(all_programs), so that the
subsequent build in man/ doesn't fail due to lack of a program like
arch that is not going to be installed.
2009-08-19 08:44:40 +02:00
Jim Meyering
611870a8f3 build: update from gnulib
* gnulib: Update submodule to latest.
2009-08-18 21:07:44 +02:00
Giuseppe Scrivano
718b2790c0 nl: deprecate --page-increment in favor of --line-increment
* NEWS: Mention the change.
* doc/coreutils.texi: Document the new --line-increment option.
* src/nl.c (struct option): Add --line-increment,
(usage): Describe it,
(main): Use it.
2009-08-18 18:40:41 +02:00
Jim Meyering
6f6599a006 tests: stdbuf: fix a bug in test script
* tests/misc/stdbuf: Use skip_test_ only after it's defined.
Reported by Berhnard Voelker.

(sc_check-AUTHORS): Rename rule from check-AUTHORS.
2009-08-18 17:53:20 +02:00
Jim Meyering
d25101cc30 build: perform check-AUTHORS via syntax-check, not via "make check"
* src/Makefile.am (check): Don't depend on check-AUTHORS.
That check fails on systems for which a program like stdbuf is
not built.  Instead, move this check to "make syntax-check".
(sc_check-AUTHORS): Rename rule from check-AUTHORS.
* cfg.mk (sc_check-AUTHORS): New rule.
Reported by Berhnard Voelker.
2009-08-18 12:16:36 +02:00
Jim Meyering
ea57d46482 sort: use more portable initialization syntax
* src/sort.c (find_unit_order): Spell out 256-element static
initializer, rather than relying on C99 syntax.
Required for Forte Developer 7 C 5.4 2002/03/09 on Solaris 10.
Reported by Bernhard Voelker.
2009-08-18 11:02:36 +02:00
Jim Meyering
eca6a4a21a build: suppress warnings due to gcc's new -Wjump-misses-init
* configure.ac: Ignore -Wjump-misses-init violations in remove.c.
2009-08-17 19:37:47 +02:00
Jim Meyering
60d0413fe6 build: update from gnulib
* gnulib: Update submodule to latest.
2009-08-17 19:17:18 +02:00
Jim Meyering
dc1618fbd8 tests: tail-2/append-only: don't discard stderr
* tests/tail-2/append-only: Don't discard a diagnostic that
may help explain why this test fails for some.  Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17621/focus=17641
2009-08-16 13:54:40 +02:00
Jim Meyering
e4dcb20e83 tests: skip the misc/stdbuf test if stdbuf was not built
* tests/misc/stdbuf: Skip this test when stdbuf is not built.
Reported by Eric Blake.
2009-08-14 21:34:05 +02:00
Jim Meyering
ea5b7124b4 build: use gnulib's getopt-gnu module (getopt is now deprecated)
* bootstrap.conf (gnulib_modules): Gnulib's getopt module is now
deprecated; use the new, preferred name, getopt-gnu.
* gnulib: Update to latest.
2009-08-14 17:15:50 +02:00
Pádraig Brady
f0a1f0df22 cp,mv: fix issues with preserving timestamps of copied symlinks
* src/copy.c (copy_internal): On systems without utimensat don't
use utimens on a symlink, as that would dereference the symlink.
* tests/cp/abuse: To work around possible attribute preservation
failures breaking the test, use cp -dR rather than cp -a.
2009-08-14 17:10:53 +02:00
Pádraig Brady
8574c74325 doc: clarify the cp --reflink NEWS
* NEWS: Remove the description associated with the removed
experimental code which unconditionally tried to reflink() on copy.
Also clarify where --reflink works exactly.
2009-08-14 10:48:07 +01:00
Jim Meyering
11ccbdab27 tests: raise ulimit virt-mem limit to avoid new failure
* tests/cp/link-heap: Raise limit from 16MB to ~20MB,
to avoid spurious failure on rawhide.
2009-08-13 17:25:39 +02:00
Pádraig Brady
f43f028652 tail: fix tail -f failure when inotify used
* src/tail.c (tail_forever_inotify): Remove the redundant and
incorrect error check of the return from inotify_add_watch().
Also initialize the wd member of each File_spec to an invalid value.
Reported by C de-Avillez.
2009-08-13 16:09:27 +01:00
Pádraig Brady
e4caea5775 dd: fix a signal handling race
* src/dd.c (main): Install the signal handlers at startup
rather than just before the copy starts. In this way signals
received before the copy (like during a slow truncate for e.g.)
will be deferred and handled consistently.
* THANKS: Add Bernhard's email address.
* NEWS: Mention the fix.
Reported by Bernhard Voelker.
2009-08-13 16:06:50 +01:00
Pádraig Brady
ab274c428d tests: improve one of the tail --pid tests
* tests/tail-2/pid: Speed up the test by specifying a
timeout of 100ms rather than the default 1s.  Also
skip the test instead of failing in the unlikely case
were the pid required to be missing pid is present.
2009-08-12 22:03:33 +01:00
Jim Meyering
e32320de66 nl, pinky: replace uses of strcat
* src/nl.c (main): Avoid strcat, on principle.  Use stpcpy instead.
* src/pinky.c (print_long_entry): Likewise.
2009-08-10 09:17:07 +02:00
Jim Meyering
eb2f9e84b9 build: update from gnulib, for HOST_NAME_MAX on solaris 10
* gnulib: Update submodule to latest.
2009-08-10 09:16:57 +02:00
Giuseppe Scrivano
a1d7469835 cp: accept the --reflink option
* NEWS: Mention it.
* doc/coreutils.texi (cp invocation): Describe it.
* src/copy.h (struct cp_options) [reflink]: New member.
* src/copy.c (usage): Describe it.
(copy_reg): If reflink is true try to clone the file.
(main): Check for --reflink.
(cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Initialize the new member.
* src/mv.c (cp_option_init): Likewise.
* tests/cp/sparse: Add a new test case.
2009-08-07 17:14:22 +02:00
Jim Meyering
ff159a605e dd: preserve semantics of O_DIRECT even for final block
* src/dd.c: Include "ignore-value.h"
(iwrite): When disabling O_DIRECT, try to compensate
via POSIX_FADV_DONTNEED and fsync.
Suggested by Eric Sandeen.
2009-08-07 16:21:35 +02:00
Jim Meyering
c5c15884df maint: move selinux-at module from gl/ to gnulib
* gl/lib/selinux-at.c: Remove file.
* gl/lib/selinux-at.h: Likewise.
* gl/modules/selinux-at: Likewise.
* gnulib: update to latest, to get the new module.
2009-08-06 14:32:38 +02:00
Jim Meyering
5929322ccb dd: work around buffer length restrictions with oflag=direct (O_DIRECT)
dd oflag=direct would fail to copy a file with size that is
not a multiple of 512 (destination file system specific)

* NEWS (Bug fixes): Mention it.
* src/dd.c (iwrite): Turn off O_DIRECT for any
smaller-than-obs-sized write.  Don't bother to restore it.
* tests/dd/direct: New test for the above.
* tests/Makefile.am (TESTS): Add dd/direct.
* doc/coreutils.texi (dd invocation): Mention oflag=direct
buffer size restriction.
Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586
Reported by Eric Sandeen.
2009-08-06 09:41:50 +02:00
Jim Meyering
365fb90eaa dd: remove unnecessary #if HAVE_FTRUNCATE
* src/dd.c (main): Remove unnecessary cpp directives.
Gnulib guarantees that ftruncate is usable.
2009-08-04 20:06:03 +02:00
Jim Meyering
eae535e1a3 cp -pP (and e.g., -a): preserve time stamps on symlinks, too
* src/copy.c (utimensat_if_possible): New function.
(copy_internal): Remove variable, "preserve_metadata".
Replace with "dest_is_symlink".  That covers all cases but one:
the one in which cp --link has created hard links to non-directories.
In that case, there is no need to update attributes of the links.
Use utimensat_if_possible, to preserve timestamps of symlinks.
* NEWS (New features): Mention this.
* tests/Makefile.am (TESTS): Add cp/preserve-slink-time.
* tests/cp/preserve-slink-time: New file.
* m4/jm-macros.m4 (coreutils_MACROS): Test for utimensat.
Reported in http://bugzilla.redhat.com/230866
2009-08-04 17:38:54 +02:00
Kamil Dudka
1762092901 install runs faster again with SELinux enabled
* m4/jm-macros.m4: Pull in SELinux libraries while checking for
matchpathcon_init_prefix ().  Emit configure warning when not found
with SELinux enabled.
* NEWS (Bug fixes): Mention it.
The bug was introduced in coreutils-7.0 via commit 0647f3eb, 2008-06-02,
"accommodate older SELinux which lacks matchpathcon_init_prefix".
2009-08-04 16:51:52 +02:00
Jim Meyering
c60f151ebd maint: move the update-copyright rule to gnulib's maint.mk
* gnulib: Update submodule to get latest maint.mk.
* Makefile.am (update-copyright): Remove rule; now it's in maint.mk.
* m4/check-decl.m4: Update sole remaining copyright year list.
2009-08-04 12:06:32 +02:00
Jim Meyering
48726556ca build: *really* update to a usable gnulib commit 2009-07-31 18:05:10 +02:00
Jim Meyering
81ae3611d3 build: update to a usable gnulib commit
The commit, 5ef90695, 2009-07-29, "maint: move update-copyright
to gnulib" recorded a local-only commit.
Reported by Pádraig Brady.
2009-07-31 09:05:25 +02:00
Jim Meyering
c06547cade tests: new function: require_openat_support_
* tests/rm/inaccessible: Factor out openat-support-detection code...
* tests/test-lib.sh (require_openat_support_): ...into this new function.
2009-07-30 17:47:21 +02:00
Jim Meyering
28e3946ef0 tail: tweak indentation
* src/tail.c (tail_forever_inotify): Adjust indentation of continued line.
2009-07-30 17:45:53 +02:00
Pádraig Brady
c9871986eb tail: properly parse fractional seconds when monitoring a pid
* src/tail.c (tail_forever_inotify): The fractional
part of the delay was 1000 times too large.
* tests/tail-2/pid: Add a test to ensure the
timeout happens for this case.
2009-07-30 17:40:43 +02:00
Jim Meyering
2ac2cace15 tests: test for just-fixed tail --pid bug
* tests/tail-2/pid: Ensure tail exits successfully when PID dies.
2009-07-30 10:27:51 +02:00
Giuseppe Scrivano
d3feea0181 tail: exit successfully upon watched process death
* src/tail.c (tail_forever_inotify): If a PID is specified and the
watched process dies, exit with status EXIT_SUCCESS, rather than
falling through to an EXIT_FAILURE.
2009-07-30 10:24:17 +02:00
Jim Meyering
5ef9069576 maint: move update-copyright to gnulib
* build-aux/update-copyright: Remove file.
* bootstrap.conf (gnulib_modules): Add update-copyright.
* gnulib: Update submodule to latest.
2009-07-29 19:30:58 +02:00
Jim Meyering
e40c5f735c maint: make update-copyright work in yet another case
* build-aux/update-copyright: Handle the case in which "\n#"
appears between the final year number and the copyright holder name.
* m4/lib-check.m4: Update copyright year list.
Reported by Joel E. Denny.
2009-07-29 15:39:25 +02:00
Jim Meyering
bc51349ccd maint: update NEWS
* NEWS (New features): Mention it.
2009-07-29 12:27:08 +02:00
Giuseppe Scrivano
4533017669 cp: support btrfs' copy-on-write file clone operation
* src/copy.c [HAVE_SYS_IOCTL_H]: Include <sys/ioctl.h>.
(BTRFS_IOCTL_MAGIC, BTRFS_IOC_CLONE): Define.
(clone_file): New function.
(copy_reg): Use the btrfs clone operation if possible.
2009-07-29 12:15:50 +02:00
Jim Meyering
095861179c maint: update sleep.c's copyright year list
* src/sleep.c: Update copyright year list to include 2009.
* tests/sort-time/rand-gen: Remove long-unused file.
* tests/sort-time/README: Likewise.
2009-07-29 11:21:21 +02:00
Joel E. Denny
1bc5395e92 maint: improve update-copyright rule
* Makefile.am (update-copyright): Relax the selection rule
to match any file containing the word "Copyright".
Correct the exclusion rule so that it also excludes ChangeLog
and COPYING files that are not in the top level directory.
2009-07-29 11:05:54 +02:00
Jim Meyering
c91c85647c maint: update-copyright: fix just-introduced bug
* build-aux/update-copyright: ... and revert-for-now the
change that made this script invoke localtime only once.
2009-07-29 10:56:10 +02:00
Jim Meyering
9d87a45b2f maint: make update-copyright handle more cases
* build-aux/update-copyright: Handle cases in which the final
year number and copyright holder are on separate lines.
Prompted by a report from Joel E. Denny.
Also, do not invoke localtime for each line we process.
2009-07-29 10:25:24 +02:00
Pádraig Brady
8aeda9b930 doc: fix the generated HTML index
* doc/coreutils.texi: Move the "SELinux context" section
down below the "System context" nodes so that the HTML
index is generated correctly. Also some extraneous and missing
'.' characters were corrected in the index.
Reported by Benno Schulenberg.
2009-07-28 23:21:43 +01:00
Giuseppe Scrivano
e81c4d88c2 tail: use the inotify backend also with --pid=PID
* src/tail.c (tail_forever_inotify): When a PID is specified, use
select to block for no more than sleep_interval seconds at a time,
and check for process death upon timeout.
(main): Adapt to new tail_forever_inotify interface.
2009-07-28 09:31:54 +02:00
Jim Meyering
5874a8215d tests: new test for bug in ls -1U dir arg ...
* tests/misc/ls-misc (multi-arg-U1): New test.
2009-07-27 17:12:58 +02:00
Kamil Dudka
493c481684 ls -1U dir arg ... now works again
* src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and
possibly printing) directory entry names.
The bug was introduced in coreutils-7.0 via commit
8d974b00, 2008-07-30, "ls -U1 now uses constant memory".
Reported by Julian Bradfield.
* NEWS (Bug fixes): Mention it.
2009-07-27 17:10:39 +02:00
Heikki Orsila
6edc9c972e tr: improve --help's description of --complement (-c) 2009-07-27 11:55:35 +02:00
Pádraig Brady
2f4188ebec doc: add a sort by line length example
* doc/coreutils.texi (sort invocation): Add an example showing how
to sort data not directly supported by the sort command.
2009-07-27 01:34:35 +01:00
Pádraig Brady
0bf77fc8ec doc: mention realpath in the readlink info
* doc/coreutils.texi (readlink invocation): Add realpath to the index,
and also mention it in the readlink description so people
searching for that functionality can easily make the connection.
2009-07-27 00:53:04 +01:00
Jim Meyering
394e3ef72a build: use a fixed-name temporary in man/Makefile.am
* man/Makefile.am (check-x-vs-1): Using a fixed-name temporary file
is better than one ending in -$$, because many -$$-suffixed files
may accumulate over time.
2009-07-26 20:42:31 +02:00
Kamil Dudka
9f9e2d81d1 doc: improve readlink description here, too
* doc/coreutils.texi (readlink invocation): Update menus.
Add @cindex entries.
2009-07-24 10:25:23 +02:00
Jim Meyering
571b7e3eee readlink: improve one-line summary: prints canonical file names, too
* src/readlink.c (usage): Adjust one-line summary.
* man/readlink.x: Likewise.
Suggested by Kamil Dudka.
2009-07-24 09:33:38 +02:00
Jim Meyering
954dba24d4 build: update from gnulib
* gnulib: Update submodule to latest.
2009-07-21 18:35:28 +02:00
Jim Meyering
4612670f46 doc: point to Guile's ChangeLog-writing guidelines
* HACKING (Commit log requirements): Point to Guile's
http://www.gnu.org/software/guile/changelogs/guile-changelogs_3.html.
Mention that a bit of prose can be welcome.
2009-07-14 20:43:49 +02:00
Jim Meyering
8f3171bbc4 tail: adjust type of a local variable
* src/tail.c (tail_forever_inotify): Declare "len" to be of type
size_t, not ssize_t, since the former is what safe_read returns.
2009-07-11 09:43:25 +02:00
Jim Meyering
68149832bd tests: avoid false-positive cp/link-heap failure
* tests/cp/link-heap: Increase address space limit from 14000KB
to 16000KB, to avoid failure with Debian unstable's libc6-dev-2.9-19
2009-07-09 15:50:49 +02:00
Jim Meyering
a9461064b8 build: avoid build warn/failure due to -Wstack-protector
* configure.ac: Do not enable -Wstack-protector.
Otherwise, at least df.c would provoke a warning.
2009-07-09 15:21:53 +02:00
Ondřej Vašík
ad7b37bfd4 copy.c: remove a duplicate expression
* src/copy.c (copy_attr_error): remove a redundant expression
added in commit e0cf592f, 2009-04-27, "factor out test for errno ...".
2009-07-08 22:59:56 +01:00
Jim Meyering
0d64bc4429 build: update from gnulib
* gnulib: Update submodule to latest.
2009-07-08 22:37:29 +02:00
Jim Meyering
0e93175301 tail: use size_t for counter and index variables, ...
* src/tail.c (any_live_files): ... not "int" or even unsigned int
(tail_forever, tail_forever_inotify, main): Likewise.
2009-07-08 19:53:43 +02:00
Jim Meyering
3639a880aa tail: declare "file descriptor" variable to be "int", not size_t
* src/tail.c (tail_forever_inotify): Use "int", not size_t
as the type of a file descriptor variable.
2009-07-08 19:52:58 +02:00
Jim Meyering
ec34511ccf move argv-iter module to gnulib
* gl/lib/argv-iter.c: Remove file.
* gl/lib/argv-iter.h: Remove file.
* gl/modules/argv-iter: Remove file.
* gl/modules/argv-iter-tests: Remove file.
* gl/tests/test-argv-iter.c: Remove file.
* gnulib: Update submodule, to get argv-iter
2009-07-04 17:41:39 +02:00
Giuseppe Scrivano
2c20fd053b tests: refactor code to use require_proc_pid_status_
* tests/tail-2/tail-n0f: Read the process status using the test-lib.sh
require_proc_pid_status_ function.
2009-07-04 10:47:56 +02:00
Giuseppe Scrivano
42cd6653b0 tests: use the "nobody" user's group as the default group id
* tests/chroot/credentials: Use the group id, not its name.
* tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in
place of "nogroup".
2009-07-04 10:47:56 +02:00
Jim Meyering
065ce24361 build: update from gnulib
* gnulib: Update submodule to latest.
2009-07-03 20:28:33 +02:00
Pádraig Brady
acc01947af sort: allow SI and IEC units on separate human sort fields
* src/sort.c: Store the si_present state per key rather than globally
* tests/misc/sort: Add a check that would have previously failed.
Also add a test to demonstrate that invalid IEC/SI mixtures are not
always noticed when they're not significant to the sort.
2009-07-03 17:00:55 +01:00
Giuseppe Scrivano
d9f83f9a60 tail: avoid an inotify portability problem in kernels prior to 2.6.21
* src/tail.c (tail_forever_inotify): Handle the special case in which
an old inotify watcher returns 0.  Affects kernels in [2.6.13, 2.6.21).
2009-07-03 17:52:30 +02:00
Jim Meyering
66ac50e723 tests: tail-2/wait: rename internal file name
* tests/tail-2/wait: Rename file from not_accessible to unreadable,
since all the test cares about is readability.
2009-07-03 17:52:30 +02:00
Giuseppe Scrivano
d106277d45 tests: tail-2/wait: don't fail when run as root
* tests/tail-2/wait: Ensure that the unreadable file really is not
readable before trying to run "tail -f" on it.
2009-07-03 17:52:30 +02:00
Pádraig Brady
962878499c doc: update the info on sort -b and -k
* doc/coreutils.texi (sort invocation): Mention in the description
of -b, that the locale can also affect whether blanks are significant.
Update the list of ordering options for a --key that cause it
to not inherit any global ordering options.
Update the list of ordering options that implicitly skip whitespace.
2009-07-03 16:49:04 +01:00
Pádraig Brady
3e565eb3a6 maint: generalize the development prerequisites docs
* README-hacking: Add a little more high level info and
merge notes on specific developer prerequisites into README-prereq
* README-prereq: Remove the Fedora 8 specific information
and generalize the information to be applicable to any system.
2009-07-03 16:47:17 +01:00
Jim Meyering
6d0d1c47b2 tail: add comments noting potential inotify-related problems
* src/tail.c (tail_forever_inotify): Add two FIXME comments.
2009-06-29 20:43:26 +02:00
Jim Meyering
5718733510 maint: bootstrap: merge changes from gnulib
* bootstrap: Indent using spaces, not TABs.
2009-06-28 12:16:28 +02:00
Jim Meyering
f24b825171 maint: bootstrap: sync submodule usage from gnulib
* bootstrap: Config for git submodule use only if .gitmodules exists.
2009-06-28 11:25:13 +02:00
Jim Meyering
07c6f21b81 maint: bootstrap: split a few long lines
* bootstrap (found_aux_dir): Avoid lines longer than 80 columns.
2009-06-28 11:17:50 +02:00
Jim Meyering
b3f293c61b maint: don't change COPYING
* COPYING: Don't modify Copyright date list in imported file.
This file is one of very few exceptions in that we version-control it,
even though its primary source is another package.
Spotted by Eric Blake.
2009-06-27 09:16:59 +02:00
Jim Meyering
e472f8fece maint: add a rule to automate the annual copyright-year-update process
* build-aux/update-copyright: New file.
* Makefile.am (changelog_etc): Add update-copyright.
(update-copyright): New rule.
2009-06-27 09:16:59 +02:00
Pádraig Brady
1c16c9598e stdbuf: fix to stop -i option causing an assertion
* src/stdbuf.c (main): Fix the array bounds check in the assert
* tests/misc/stdbuf: Add a test for all standard streams
2009-06-27 02:21:43 +01:00
Pádraig Brady
9c6c621c32 doc: clarify the tail inotify NEWS
* NEWS: Say why inotify was used
2009-06-25 14:50:05 +01:00
Jim Meyering
2232b4d08f maint: update all Copyright year lists to include 2009 2009-06-23 22:33:15 +02:00
Jim Meyering
ec00727a72 maint: remove old TODO files
* lib/TODO: Remove file.
* tests/join/TODO: Likewise.
2009-06-23 22:30:29 +02:00
Jim Meyering
f9554bbe25 doc: README-hacking tweak
* README-hacking: Move the "While building..." sentence down
to where it belongs.
2009-06-23 16:54:38 +02:00
Jim Meyering
fc66fb4d99 tests: tail-2/pid: include more info upon failure
* tests/tail-2/pid: Print unexpected $state upon failing.
2009-06-23 16:53:43 +02:00
Jim Meyering
0975852c50 doc: typo fix in README-hacking
* README-hacking: Fix a typo.
Don't make building from a git-cloned tree sound so hard.
2009-06-20 14:48:59 +02:00
Jim Meyering
0c131d4c10 build: update from gnulib (hash module updates; maint.mk tweak)
* gnulib: Update submodule to latest.
2009-06-20 00:06:42 +02:00
Jim Meyering
25a18dafb8 doc: fix a typo
* doc/coreutils.texi (stdbuf invocation): Insert missing "to".
2009-06-17 16:17:19 +02:00
Pádraig Brady
a5a2a406f8 stdbuf: A new program to run a command with modified stdio buffering
* AUTHORS: Register as the author.
* NEWS: Mention this change.
* README: Add stdbuf command to list.
* configure.ac: Only enable on ELF systems with GCC.
* cfg.mk (sc_system_h_headers): Use VC_LIST_EXCEPT rather than
VC_LIST, so we can add an exception, if needed.
* .x-sc_system_h_headers: New file.  Exempt libstdbuf.c.
* Makefile.am (syntax_check_exceptions): Add .x-sc_system_h_headers.
* doc/coreutils.texi (stdbuf invocation): Add stdbuf info.
* man/.gitignore: Ignore generated manpage.
* src/.gitignore: Ignore stdbuf and libstdbuf.so binaries.
* man/Makefile.am (stdbuf.1): Add dependency.
* man/stdbuf.x: New file with example usage.
* po/POTFILES.in: Reference new command and shared library sources.
* src/Makefile.am (build_if_possible__progs): Add stdbuf and libstdbuf,
(pkglib_PROGRAMS): Reference optional shared lib,
(libstdbuf_so_LDADD): Ensure we don't link with non PIC libcoreutils.a.
(libstdbuf_so_LDFLAGS): Add -shared GCC option,
(libstdbuf_so_CFLAGS): Add -fPIC GCC option.
(check-README): Exclude libstbuf.
(check-AUTHORS): ditto.
(sc_tight_scope): Exclude functions starting with __.
* src/libstdbuf.c: The LD_PRELOAD shared library to control buffering.
* src/stdbuf.c: New file to setup env variables before execing command.
* tests/Makefile.am: Reference new test file.
* tests/misc/help-version: Set expected exit codes.
* tests/misc/invalid-opt: ditto.
* tests/misc/stdbuf: Add 9 tests.
2009-06-17 14:54:29 +01:00
Jim Meyering
ff6fe3d17d doc: cp: describe an oddity of combining -H/-L and --preserve=links
* doc/coreutils.texi (cp invocation) [-L]: Elaborate.
[--preserve=links]: Remove comments saying that we need documentation
for just this situation.  Provide more explanation and examples.
Reported by Brian M. Carlson in http://bugs.debian.org/525048.
2009-06-16 18:08:01 +02:00
Jim Meyering
f51a401bc2 maint: revert last change: we're not ready for "local" in scripts, yet
Revert "use a local var: more readable"
This reverts commit c0d8245288.
2009-06-15 19:37:42 +02:00
Jim Meyering
c0d8245288 use a local var: more readable 2009-06-15 18:34:21 +02:00
Giuseppe Scrivano
ae494d4be8 tail: use inotify if it is available
* NEWS: Document the new feature.
* m4/jm-macros.m4: Check if inotify is present.
* src/tail.c (tail_forever_inotify): New function.
(main): Use the inotify-based function, if possible.
* tests/Makefile.am: Add new tests for tail.
* tests/test-lib.sh (require_proc_pid_status_, get_process_status_):
New functions.
* tests/tail-2/pid: New file.
* tests/tail-2/wait: New file.
* tests/tail-2/tail-n0f: Refactor code into the test-lib.sh
require_proc_pid_status_ function.
2009-06-15 18:34:14 +02:00
Jim Meyering
358aca5fb9 diag: say "failed to...", rather than "cannot..." in a few diagnostics
* src/chroot.c (main): ...it's more precise.
* src/nohup.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/timeout.c (main): Likewise.
2009-06-13 16:37:13 +02:00
Cliff Miller
24c727d3c2 sort: Ignore fields where end position is before the start position
* NEWS: Mention the fix
* THANKS: Add Cliff Miller
* src/sort.c (keycompare): Ensure lima >= texta
* tests/misc/sort: Add 3 corresponding tests

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-13 01:25:06 +01:00
Pádraig Brady
ba1c5239bc tests: ls --color, permissions override hardlink coloring
* tests/ls/multihardlink: Add a test case to demonstrate
and test this non obvious behavior.
2009-06-11 11:39:24 +01:00
Kamil Dudka
0df338f671 ls --color: do not colorize files with multiple hard links by default
* src/ls.c: Rename hl->mh, do not colorize files with multiple
hard links by default.
* src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh.
* src/dircolors.hin: Do not colorize files with multiple hard links by
default.
* tests/Makefile.am: Rename the test case accordingly.
* tests/ls/multihardlink: Additionally test ls' default behavior
and factor out some duplication.
* NEWS: Mention the change in behavior.
2009-06-11 09:53:50 +02:00
Pádraig Brady
502be19e0f maint: Add a syntax-check to ensure all .x-sc_ files are distributed
* Makefile.am: Add a couple of missing entries to
syntax_check_exceptions for distribution.
* cfg.mk: Add a rule to ensure the syntax_check_exceptions list
stays in sync with the .x-sc_* files in the repository.
2009-06-08 15:35:31 +01:00
Jim Meyering
523c40505c build: update from gnulib
* gnulib: Update submodule to latest.
2009-06-07 13:58:24 +02:00
Jim Meyering
f9a950b87f sort: die immediately upon heap allocation failure
* src/sort.c (register_proc): Handle hash_insert failure.
2009-06-07 13:58:24 +02:00
Mike Frysinger
5424a74725 dircolors: add screen-256color-bce to TERM list
* src/dircolors.hin: Add screen-256color-bce.
2009-06-04 07:16:06 +02:00
Jim Meyering
d8243c25cd doc: HACKING: minor adjustments, additions
* HACKING (Amending...): Remove spurious "-e" used with commit --amend.
(log message policy): Mention the 72-column limit.
"build:" and "maint:" are common prefixes, these days.
2009-06-03 18:30:40 +02:00
Jim Meyering
59400b2884 doc: adjust wording in README-prereq 2009-06-03 14:58:57 +02:00
Jim Meyering
d7397c1e7b dircolors: recognize .xz, .txz, .tbz and .tlz suffixes
* src/dircolors.hin: Add .xz, .txz, .tbz and .tlz.
2009-06-03 14:07:27 +02:00
Jim Meyering
a65957da77 doc: use newer URL for XZ utils
* README-hacking: Use <http://tukaani.org/xz/>
* README-prereq: Mention xz, not lzma.
2009-06-03 07:19:20 +02:00
Matěj Cepl
ba6e08c627 doc: adjust README-prereq instructions
* README-prereq: Mention new requirement on automake-1.11,
with its new location and updated dependency on autoconf-2.62.
Remove the reference to coreutils-7.0 so that this file
implicitly refers to the latest or release version of coreutils.
Fix and clarify the instructions for updating the $PATH.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-06-03 01:03:47 +01:00
Jim Meyering
18db64ba7e doc: HACKING: mention the GNU Coding Standards
* HACKING (Add documentation): Add a link to the GCS.
2009-06-02 16:35:14 +02:00
Jim Meyering
4dbfbf3fd0 build: no longer list gnulib's "memchr" module as obsolete
* bootstrap.conf (obsolete_gnulib_modules): Remove memchr from
the list, now that it fixes a problem in some modern C libraries.
(gnulib_modules): Add it here.
2009-06-02 16:35:14 +02:00
Jim Meyering
0818c52874 build: make generated man/*.1 files read-only
This should help people notice that they are generated.
Note: each file already has a comment to that effect from help2man.
* man/Makefile.am (.x.1): Make generated files read-only.
Also, don't redirect directly to the target, $@.
2009-06-02 16:35:14 +02:00
Jim Meyering
a5c627f9c6 build (man/): use automake's new $(AM_V_GEN) variable
* man/Makefile.am (.x.1, check-x-vs-1, check-programs-vs-x):
Mark with $(AM_V_GEN), so that automake-1.11 prints
"GEN $@" by default (stick with "GEN" in spite of the latter two
rules not officially generating anything -- they're just tests).
2009-06-02 16:35:14 +02:00
Jim Meyering
b96cd035ff chroot: make --groups= work without --userspec=; be more robust
* src/chroot.c (set_additional_groups): Add comments.
Given an empty or all-comma group list, diagnose it and return nonzero.
When more than one group is invalid, diagnose all of them,
not just the first.
(main): Honor --groups= also when --userspec= is not specified.
Now that set_additional_groups consistently diagnoses its failures,
don't diagnose it separately here.
* tests/chroot/credentials: Do not invoke with an empty group list.
2009-06-02 16:34:54 +02:00
Jim Meyering
2e62250e98 chroot: don't set bogus user-ID or group-ID for --u=U: or --u=:G
* src/chroot.c (main): Initialize both "uid" and "gid".  To -1.
This also allows one to set the user-ID or primary group-ID to 0,
in case it's not that already.
* tests/chroot/credentials: Test for the above.
2009-06-02 16:34:53 +02:00
Jim Meyering
bb7ff3bccd chroot: set-*-ID failure must provoke nonzero exit before execvp
* src/chroot.c (main): Exit upon set-group-ID or set-user-ID failure.
2009-06-02 16:34:53 +02:00
Jim Meyering
df356c22ba tests: use "nobody" as the default group name in chroot test
* tests/test-lib.sh (NON_ROOT_GROUP): Use "nobody", not "nogroup".
2009-06-02 16:34:53 +02:00
Jim Meyering
f9bb168f56 build: make distcheck rules use --enable-gcc-warnings
* dist-check.mk (warn_cflags): Remove definition, now that it's
been subsumed by --enable-gcc-warnings.
(my-distcheck): Use configure with --enable-gcc-warnings and remove
use of $(warn_cflags).
2009-06-02 16:34:36 +02:00
Eric Blake
c43333419b head, tail: make --help less ambiguous
* src/head.c (usage): Use -n K, not -n N, to avoid confusion.
* src/tail.c (usage): Likewise.
* doc/coreutils.texi (head invocation, tail invocation):
Likewise.
Reported by Christophe Lyon.
2009-05-29 16:14:56 -06:00
Michael Speer
159faba137 sort: new --human-numeric-sort option to sort KiB MB etc.
* NEWS: Document the new option
* doc/coreutils.texi (sort invocation): ditto
* src/sort.c (main): handle the new --human-numeric-sort option (-h).
(human_numcompare): A new function to compare SI and IEC suffixes
before falling back to the standard --numeric comparison.
(find_unit_order): A new helper function to find the order
of magnitude of a number string as determined by its suffix.
(check_mixed_SI_IEC): A new helper function to exit with error
if both SI and IEC suffixes are presented.
* tests/misc/sort: Add 8 tests to test the new functionality.
* THANKS: Update
2009-05-26 14:49:17 +01:00
Giuseppe Scrivano
c45c51fe97 chroot: accept new options --userspec=U:G and --groups=G1,G2,G3
* NEWS: Note chroot's new options.
* doc/coreutils.texi: Document them.
* src/chroot.c (main): Add support for --userspec and --groups.
* tests/Makefile.am (root-tests): Add chroot/credentials.
* tests/chroot/credentials: New file.
* tests/test-lib.sh: Define NON_ROOT_GROUP to a default value.
2009-05-26 15:10:22 +02:00
Pádraig Brady
39285f6008 doc: clarify the operation of the comm -123 parameters
* src/comm.c (usage): give more information on the -123 parameters,
with examples to show that they can be combined.
Addresses <http://savannah.gnu.org/bugs/?24974>.
* doc/coreutils.texi (comm invocation): Mention that the
column separators are suppressed along with the column.
Suggestion from Dan Jacobson.
* man/comm.x: Reference other commands that match adjacent lines.
* man/join.x: ditto.
* man/uniq.x: ditto.
2009-05-18 16:17:31 +01:00
Jim Meyering
b7f6e0d516 build: require automake-1.11
* bootstrap.conf (buildreq): Require automake-1.11, not 1.10b,
for our use of AM_SILENT_RULES.
* configure.ac (AM_INIT_AUTOMAKE): Likewise.
2009-05-18 07:06:34 +02:00
Jim Meyering
088a7ca9b1 maint: HACKING: mention a few more useful git commands
* HACKING (Miscellaneous useful git commands): Add a few.
2009-05-17 17:51:13 +02:00
Jim Meyering
564622fbea build: avoid new "make distcheck" failure with gcc 4.5.0 20090517
* dist-check.mk (warn_cflags): Add -Wno-enum-compare.
2009-05-17 15:55:35 +02:00
Jim Meyering
2726826c72 build: avoid new warnings from gcc 4.5.0 20090517
* configure.ac: Add an explicit -Wno-logical-op,
now that not listing -Wlogical-op is insufficient.
2009-05-17 13:59:12 +02:00
Jim Meyering
9593a3d8e7 maint: use ARRAY_CARDINALITY more
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it.
* src/factor.c (WHEEL_END): Likewise.
* src/csplit.c (main): Likewise.
* src/od.c: Likewise,
* src/ls.c (main): Likewise.
(N_ENTRIES): Remove definition.  Use ARRAY_CARDINALITY instead.
* src/dircolors.c: Likewise.
(array_len): Remove definition.
2009-05-17 13:59:12 +02:00
Jim Meyering
65ed4ca07b build: tr: avoid a warning due to newer gcc's -Wenum-compare
* src/tr.c (N_CHAR_CLASSES): Remove anonymous enum definition.
(look_up_char_class): Use ARRAY_CARDINALITY, rather than N_CHAR_CLASSES.
2009-05-17 13:59:12 +02:00
Jim Meyering
9b54961b13 maint: define ARRAY_CARDINALITY in system.h
* src/system.h (ARRAY_CARDINALITY): Define if not already defined.
2009-05-17 13:59:12 +02:00
Jim Meyering
50ca12c28d build: turn off -Wlong-long
* configure.ac: With --enable-gcc-warnings, -Wlong-long would
cause compilation failure due to inclusion of lib/gethrxtime.h.
Initialize "nw".
2009-05-17 13:59:12 +02:00
Jim Meyering
242f801adf maint: cfg.mk: remove now-unnecessary gnulib_dir definition
* cfg.mk (gnulib_dir): Remove definition, now that gnulib's
maint.mk provides the default we want.
* gnulib: Update submodule to latest.
2009-05-16 09:59:53 +02:00
Pádraig Brady
bba5fed6ba tests: fix date-next-dow failure on older systems
* tests/misc/date-next-dow: In the strftime call use %Y-%m-%d
rather than the newer %F equivalent which is not available
on Solaris 8 for example.
2009-05-15 15:46:11 +01:00
Jim Meyering
fc9fdd18b3 build: update from gnulib, for rename.m4 fix, improved tests, etc.
* gnulib: Update submodule to latest.
2009-05-14 09:55:44 +02:00
Jim Meyering
42e3278f8f maint: README-release: minor improvements
* README-release: Mention gnu_ftp_host-{alpha,...} settings in cfg.mk.
Now that XZ_OPT is set via maint.mk, don't mention it here.
2009-05-14 09:54:22 +02:00
Eric Blake
60e7332dc0 truncate: fix bug in use of isspace
* src/truncate.c (main): Pass unsigned characters to isspace.
* NEWS: Mention this.
2009-05-11 05:52:50 -06:00
Jim Meyering
034cbb3923 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-05-07 15:52:50 +02:00
Jim Meyering
4e54ea0480 version 7.4
* NEWS (Build-related): Mention make check fixes.
2009-05-07 15:35:19 +02:00
Jim Meyering
5aa7858385 admin: update NEWS
* NEWS (Bug fixes): Mention the date-related fixes.
(Portability): Mention the ACL-related fixes on *BSD.
2009-05-07 15:20:56 +02:00
Pádraig Brady
a6c9dd74d8 doc: note the use of LC_COLLATE in comm, join and uniq
* doc/coreutils.texi (uniq invocation): Simplify the
text to remove the inconsequential mentioning of order,
while implying that LC_COLLATE can alter equality comparisons.
* src/comm.c (usage): Mention LC_COLLATE is significant.
* src/join.c (usage): Ditto.
* src/uniq.c (usage): Ditto. Also improve the summary.
Suggestion from Andries Brouwer
2009-05-05 17:14:51 +01:00
Jim Meyering
8d00fb26f1 tests: rm/one-file-system: umount more reliably
* tests/rm/one-file-system: Run umount via trap, so it runs
also upon irregular termination.
2009-05-05 08:52:09 +02:00
Andreas Schwab
1d02be3b9d tests: fix typo in check-AUTHORS rule
* src/Makefile.am (check-AUTHORS): Set locale.
2009-05-05 08:52:03 +02:00
Jim Meyering
3a9072079c build: use a gnulib SHA1 that is not private
* gnulib: Update submodule to latest *public*.
2009-05-04 07:47:56 +02:00
Jim Meyering
975a38a267 build: update from gnulib, for ACL-related fixes
* gnulib: Update submodule to latest.
2009-05-04 07:10:12 +02:00
David Bartley
6249eb0596 mv, rm: adapt to new and improved gnulib interfaces
Use gnulib's new priv-set module and updated write-any-file.
With them, the remove-called can_write_any_file function no
longer tries to drop the unlink-directory privilege, so now
each caller of remove must do that separately, calling
priv_set_remove_linkdir.
* bootstrap.conf (gnulib_modules): Add priv-set.
* src/rm.c: Include "priv-set.h".
(main): Call priv_set_remove_linkdir.
* src/mv.c (main): Likewise.
* gnulib: Update submodule to latest.
2009-05-03 19:12:16 +02:00
Jim Meyering
181615b22a tests: correct the "make check"-run check-AUTHORS test
* src/Makefile.am (check-AUTHORS): Revert back to using
en_US.UTF-8, to ease parsing (English-only) text around the
list of names, even when .po files are not installed.
Reported by Andreas Schwab.
Along the way, use $(AM_V_GEN), not "@".
(sc_tight_scope): Use $(AM_V_GEN) here, too.
* gnulib: Update submodule to latest, for the proper_name_utf8 fix
that makes --version output print the UTF-8 rendering of author names
in more cases.
2009-05-03 15:51:27 +02:00
Jim Meyering
59e8a5e2b2 tests: add tests of e.g., date -d 'next monday'
* tests/misc/date-next-dow: New file.
* tests/Makefile.am (TESTS): Add misc/date-next-dow.
* gnulib: Update submodule to latest, for getdate.y that
handles "next Monday" properly when run on a Monday.
2009-05-03 12:03:50 +02:00
Jim Meyering
40d50b821f post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-05-01 18:19:19 +02:00
Jim Meyering
0ae4336f4f version 7.3
* NEWS: Record release date.
2009-05-01 18:03:50 +02:00
Jim Meyering
120118c7d8 maint: tweak release-building notes
* README-release: Specify -j1 on the command to run all tests.
Otherwise, running some in parallel would cause failures, e.g.,
for rm/ext3-perf and tail-2/assert-2.
2009-05-01 17:55:11 +02:00
Eric Blake
875cae47a9 stdopen: remove unused code
* m4/stdopen.m4: Delete now-unused file.
* lib/stdopen.h: Likewise.
* lib/stdopen.c: Likewise.
2009-04-30 16:47:13 -06:00
Jim Meyering
269bb7362f build: update from gnulib, for fixed lib/signbitl.c
* gnulib: Update submodule to latest.
2009-04-30 17:23:49 +02:00
Jim Meyering
0e945ebcc5 build: "make check" now fails in a friendlier manner for missing Perl
* doc/Makefile.am (sc-lower-case-var): Don't redirect stderr of
$(PERL) (which is sometimes build-aux/missing) to /dev/null,
so that a failing "make check" explains that Perl is not installed.
Reported by James Youngman.
2009-04-30 13:50:40 +02:00
Jim Meyering
71ebb443d8 build: doc: emit something for each "make check"-run rule
* doc/Makefile.am: Use $(AM_V_GEN) in place of each leading "@".
(check-texinfo): Align line-continuation backslashes.
2009-04-30 13:47:46 +02:00
Jim Meyering
428db13557 build: update from gnulib, for the lib/*-state.c compilation fixes
* gnulib: Update submodule to latest.
2009-04-29 07:35:43 +02:00
Pádraig Brady
0a28715b10 misc: correct NEWS entry about id -G portability
* NEWS (Portability): getgrouplist has the portability issues,
not getgroups.
2009-04-28 15:52:29 +01:00
Jim Meyering
74171b693c df: adjust comment to match recent code change
* src/df.c (main): Update comment to match.
2009-04-28 14:45:43 +02:00
Jim Meyering
c4dfd3138e misc: mention the df vs. automount change
* NEWS (Portability): Mention that df now accommodates the new
behavior of some automounters.
2009-04-28 14:32:26 +02:00
Jim Meyering
d76a1c2a2d misc: alphabetize NEWS entries 2009-04-28 14:32:26 +02:00
Tomas Smetana
dbd17157d7 df: use open(2), not stat, to trigger automounting
* src/df.c (main): When iterating over command-line arguments,
attempting to ensure each backing file system is mounted, use
open, not stat.  stat is no longer sufficient to trigger
automounting, in some cases.  Based on a suggestion from Ian Kent.
More details in http://bugzilla.redhat.com/497830
2009-04-28 14:32:17 +02:00
Ondřej Vašík
cb9fd93743 tests: ensure that cp's -a doesn't silence --preserve=context
* tests/cp/cp-a-selinux: Ensure that the -a option does not silence
error diagnostics from --preserve=context, when preserving context
is required.
2009-04-28 11:16:33 +02:00
Ondřej Vašík
8259a73a85 tests: add test for xattr diagnostics on dest. FS lacking xattr support
* tests/cp/cp-mv-enotsup-xattr: Ensure that xattr diagnostics are
displayed correctly when destination filesystem lacks xattr support.
* tests/Makefile.am (root_tests): Add new root-only test.
2009-04-28 11:16:29 +02:00
Jim Meyering
e0cf592f48 copy.c: factor out test for errno value indicating "unsupported"
* src/copy.c (errno_unsupported): New function.
(copy_attr_error, copy_internal): Use it.
2009-04-27 13:33:47 +02:00
Ondřej Vašík
1fa226772c cp -a: diagnose failure when preserving xattr/context required
* src/copy.c (copy_attr_by_fs): Always print diagnostics when preserving
xattrs is required.
(copy_attr_by_name): Likewise.
(copy_reg): Always print diagnostics when preserving SELinux
context is required.
(copy_internal): Likewise.  Also, do not ignore ENOTSUP and ENODATA
errors when preserving SELinux context is required.
* NEWS (Bug fixes): Mention it.
2009-04-27 13:33:42 +02:00
Ondřej Vašík
941bd48235 mv: ignore xattr-preservation failure when not supported by filesystem
*src/copy.c: Do not warn about xattr-preservation failure when xattrs
are not supported and preservation of xattrs is not explicitly required.
Reported by Eric Sandeen in http://bugzilla.redhat.com/496142
2009-04-27 13:26:03 +02:00
Jim Meyering
819ee4272b build: update from gnulib, for the vc-list-files fix
* gnulib: Update submodule to latest.
2009-04-25 10:29:55 +02:00
Jim Meyering
a81441557b build: adjust use of automake's new $(AM_V_GEN) variable
* src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h):
(version.c, version.h): Use $(AM_V_GEN) only as a prefix of an existing
command.  Otherwise, it provokes warnings from some "make" programs.
Suggestion from Ralf Wildenhues.
2009-04-25 09:23:48 +02:00
Ralf Wildenhues
6debf54e61 tests: fix check-AUTHORS skip logic
* src/Makefile.am (check-AUTHORS): When this test is skipped, be
sure to avoid all commands in the recipe, not just those passed
to the first shell.
2009-04-25 08:35:53 +02:00
Eric Blake
c86509d86e cfg.mk: update to latest gnulib change
* cfg.mk (bootstrap-tools): Override maint.mk default to include
bison.
* gnulib: Update to latest gnulib.
2009-04-24 20:16:27 -06:00
Jim Meyering
9e7edf0006 build: move coreutils-specific rules from maint.mk to new file
* dist-check.mk: New file: coreutils-specific rules extracted
from maint.mk, now that maint.mk has migrated to gnulib.
* Makefile.am (EXTRA_DIST): Add dist-check.mk.
* coreutils/cfg.mk: Include $(srcdir)/dist-check.mk.
* gnulib: Update submodule to latest.
2009-04-24 21:41:11 +02:00
Jim Meyering
b726914a4c tests: avoid unusual (~1-in-20) failure of a new test
* tests/misc/sort: Remove one of the generated tests.
363 remain in this file alone.
2009-04-24 21:34:59 +02:00
Jim Meyering
207daac5c1 build: use automake's new $(AM_V_GEN) and $(AM_V_at) variables
* src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, fs.h):
(version.c, version.h): Mark with $(AM_V_GEN) and $(AM_V_at),
so that the latest automake prints "GEN $@" by default.
2009-04-24 15:16:46 +02:00
Simon Josefsson
98dbd8cc53 build: use maint.mk from gnulib
* maint.mk: Remove file.  Now it's generated.
* .gitignore: Ignore it.
* bootstrap.conf (gnulib_modules): Add maintainer-makefile.
* gnulib: Update submodule to latest.
2009-04-24 07:40:14 +02:00
Jim Meyering
52c4018a9c build: make --enable-silent-rules the default
* configure.ac (AM_INIT_AUTOMAKE): Remove silent-rules.  Instead,...
(AM_SILENT_RULES): Use this, with it's undocumented [yes] argument.
Those who want verbose build output may configure with
--disable-silent-rules or use "make V=1".
2009-04-23 21:09:13 +02:00
Jim Meyering
0e414d9e4a * gnulib: Update submodule to latest. 2009-04-23 21:04:51 +02:00
Jim Meyering
25eb4c6909 sort -m: don't segfault when output file is also an input file
* src/sort.c (avoid_trashing_input): Fix an off-by-one error and
guard the use of memmove.
* NEWS (Bug fixes): Mention it.
* tests/misc/sort: Add tests to exercise the offending code.
* THANKS: Update.
Reported by Otavio Salvador in http://bugs.debian.org/525048.
2009-04-23 21:03:14 +02:00
Jim Meyering
f41f926aab tests: make the check-AUTHORS test more portable, now that it's...
run as part of "make check".
* src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8.
Instead, use the French UTF8 locale, if configure found one.
If not found, just skip the test.
2009-04-23 21:02:43 +02:00
Jim Meyering
cbc4d9bd13 avoid parallel "make distcheck" failure due to two run-in-src/ rules
Move the check-AUTHORS rule from "syntax-check" to "check".
* maint.mk (local-checks-available): Remove check-AUTHORS.
(check-AUTHORS): Remove rule.
* src/Makefile.am (CLEANFILES): Add $(no_install__progs),
since they too are built sometimes.
(check-AUTHORS): Split a longer-than-80 sed command.
(../AUTHORS): Remove obsolete rule.
2009-04-23 21:01:52 +02:00
Jim Meyering
c74fbaefeb cp: work around linux kernel bug: short-read != EOF on /proc
Remove the optimization that avoided up to 50% of cp's read syscalls.
Do not assume that a short read on a regular file indicates EOF.
When reading from a file in /proc on linux [at least 2.6.9 - 2.6.29]
into a 4k-byte buffer or larger, a short read does not
always indicate EOF.  For example, "cp /proc/slabinfo /tmp"
copies only 4068 of the total 7493 bytes.  This optimization
(25719a3315, Improve performance a bit
by optimizing away; 2005-11-24) appears to have been worth less than
a 2% speed-up (and usually much less), so the impact of removing it
is negligible.

* src/copy.c (copy_reg): Don't exit the loop early.
* tests/cp/proc-short-read: New test, lightly based on a suggestion
from Mike Frysinger, to exercise this fix.
* tests/Makefile.am (TESTS): Add cp/proc-short-read.
* NEWS (Improve robustness): Mention this change.
2009-04-22 21:52:11 +02:00
Jim Meyering
2ad7da7594 tests: avoid new "make distcheck" failure due to newer File::Temp
With newer perl (e.g., Fedora 10's 4:5.10.0-68.fc10), tests/CuTmpdir.pm
stopped removing its temporary directories, with diagnostics like this:
  cannot remove path when cwd is /c/coreutils/tests/misc/seq.tmp-e2up \
  for /c/coreutils/tests/misc/seq.tmp-e2up: at \
  /usr/lib/perl5/5.10.0/File/Temp.pm line 902
Chdir out of the target directory before that code runs:
* tests/CuTmpdir.pm (END): chdir '..'.
(chmod_tree): Remove explicit "chdir $dir".
2009-04-22 21:45:24 +02:00
Jim Meyering
4298108f46 doc: update README
* README: (Reporting bugs): List the bug-reporting address here, too,
not just in the following more test-oriented paragraph.
Reported by Tim Mooney.
All changes are no longer listed in version-controlled ChangeLog
files, so note that contributions are attributed in the commit logs.
Mention bootstrap.conf, now that it's the authoritative source of
minimal prerequisite program/version# pairs.
2009-04-19 23:11:16 +02:00
Aurelien Jarno
e453e720b9 tests: avoid failure of install-C test on FreeBSD UFS file system
* tests/install/install-C: Use 2755 (set-gid), not 1755 (sticky),
to test install -C with non-permission mode bits set.  At least on
FreeBSD with a UFS file system, a non-root user may not set the
sticky bit on a non-directory.
2009-04-19 22:17:08 +02:00
Jim Meyering
51a6c63496 comment touch up: insert a space between "#" and text of comment
* bootstrap: It's easier to read that way.
2009-04-19 21:49:14 +02:00
Ralf Wildenhues
2977df8e7d fix comment typos
* bootstrap: Fix comment typos.
* src/pr.c: Likewise.
2009-04-19 21:28:43 +02:00
Jim Meyering
48430d6a4a maint: bootstrap: sync a tiny change from gnulib
* bootstrap: rename variable to sync with gnulib: s/\$depth/$shallow/
2009-04-17 09:10:57 +02:00
Jim Meyering
f08504b43b * gnulib: Update submodule to latest. 2009-04-16 07:42:20 +02:00
Jim Meyering
ea6abe343d build: use '.'-relative name, gnulib_dir
* cfg.mk (gnulib_dir): Use "gnulib", not "/gnulib", now that
the former is a git submodule, and guaranteed to exist.
2009-04-16 07:03:59 +02:00
Jim Meyering
a46c077467 maint: clean up skipped syntax-check rules
* cfg.mk (local-checks-to-skip): Remove patch-check and changelog-check.
* maint.mk (patch-check): Remove rule.
(local-checks-available): Remove patch-check.
(changelog-check): Remove rule.
2009-04-15 20:18:24 +02:00
Ralf Wildenhues
4404198c12 build: avoid parallel distcheck failure
* Makefile.am (ALL_RECURSIVE_TARGETS): Initialize here, too,
to please automake.  Add install-root, check-root, distcheck-hook.
* cfg.mk (ALL_RECURSIVE_TARGETS): Add sc_tight_scope.
* maint.mk (ALL_RECURSIVE_TARGETS): Add patch-check,
check-AUTHORS, maintainer-distcheck, vc-dist, taint-distcheck,
my-distcheck, alpha, beta, major.
2009-04-11 15:20:37 +02:00
Jim Meyering
0523f45f66 doc: fix a typo: s/is a is a/is a/
* doc/coreutils.texi (Putting the tools together): Fix typo.
2009-04-10 12:50:14 +02:00
Jim Meyering
b571b61970 build: tight-scope test: don't build excluded programs
* src/Makefile.am (sc_tight_scope): Depend on $(bin_PROGRAMS),
not $(all_programs)
2009-04-10 11:35:10 +02:00
Jim Meyering
03490e3565 gnulib: update to latest: fix ls -v & sort -V
* NEWS (Bug fixes): Mention it.
2009-04-10 10:15:24 +02:00
Jim Meyering
854f76ed4f maint: remove obsolete utime module
* bootstrap.conf (obsolete_gnulib_modules): Remove utime.
2009-04-10 08:42:10 +02:00
Jim Meyering
6a51c69b05 maint: put each module name on its own line; sort
* bootstrap.conf (gnulib_modules): List them one per line.
2009-04-10 08:20:13 +02:00
Jim Meyering
0df3a91b25 tests: misc/ls-misc: avoid shadowing local decl of $e
* tests/misc/ls-misc (make_j_d): Rename latter $e to $env
2009-04-09 15:29:59 +02:00
Pádraig Brady
bf87a2c8ea id: fix infinite loop on some systems
Steven Parkes reported that `id -G $USER` went into an infinite loop
on Darwin systems for users in more than 10 groups:
http://bugs.gentoo.org/show_bug.cgi?id=264007
* gl/lib/mgetgroups.c (mgetgroups): Work around buggy getgrouplist
implementations that don't update the required size correctly,
by doubling the result buffer and retrying. Also return the
parameter updated by getgrouplist rather than its return value,
as the documentation doesn't actually state the number of groups
stored is returned by getgrouplist.
* tests/misc/id-groups: Add test to exercise this logic
* tests/Makefile.am: Reference new test
* NEWS: Mention the fix
* THANKS: Update
2009-04-09 14:07:29 +01:00
Jim Meyering
148ddb3232 maint: avoid "make syntax-check" failure
* src/install.c (main): Tweak syntax of new diagnostic.
2009-04-07 20:16:00 +02:00
Pádraig Brady
6fb27500ee install: deprecate the --preserve_context option
src/install.c: Print a warning when --preserve_context
rather than --preserve-context is used as per FIXME.
2009-04-07 19:10:16 +01:00
Pádraig Brady
0f1b8c021d maint: remove compiler warnings from randint and randread modules
* gl/lib/randint.c: Remove unused MAX macro
* gl/lib/randread.c (randread_error): Add __attribute__((__noreturn__))
2009-04-07 19:08:32 +01:00
Pádraig Brady
af5723c71e shred,sort,shuf: don't use /dev/urandom by default
Suggestion from Steven Schveighoffer at:
http://savannah.gnu.org/patch/?6797
to greatly speed up the random passes done by shred.
* gl/lib/randread.c: Default to using the internal
pseudorandom generator, rather than reading /dev/urandom
* src/shred.c (usage): remove mention of /dev/urandom
* src/shuf.c (usage); ditto
* src/sort.c (usage): ditto
* doc/coreutils.text: Document the new behaviour
for aquiring random data.
2009-04-07 19:01:46 +01:00
Pádraig Brady
9fdf5845fc maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systems
* README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_
* README-valgrind: ditto
* src/chown-core.c: ditto
* src/dd.c: ditto
* src/df.c: ditto
* src/ls.c: ditto
* src/mv.c: ditto
* src/pwd.c: ditto
* src/remove.c: ditto
* src/shred.c: ditto
* src/stat.c: ditto
* src/su.c: ditto
* src/system.h: ditto
* src/timeout.c: ditto
* src/truncate.c: ditto
2009-04-07 18:57:53 +01:00
Pádraig Brady
e22f096d10 doc: add missing documentation for some SELinux options
* doc/coreutils.texi (ls invocation): Describe the --context (-Z) option
(install invocation): Describe the --preserve-context and -Z options
(id invocation): Describe the --context (-Z) option
(mkdir invocation): ditto
(mknod invocation): ditto
(mkfifo invocation): ditto
* TODO: remove the todo item
2009-04-07 18:53:51 +01:00
Jim Meyering
33e7070464 * doc/code-vs-command: Remove long-unused, never-distributed file. 2009-04-06 07:59:52 +02:00
Jim Meyering
1974dc34b6 gnulib: update to latest: includes Solaris 8 portability fixes 2009-04-04 22:53:56 +02:00
Jim Meyering
8e8b025c90 maint: clean up Makefile.am, rename remaining ChangeLog files
* Makefile.am (changelog_etc, syntax_check_exceptions): Define.
(EXTRA_DIST): Use.  Remove names that are now automatically
included: build-aux/git-version-gen, build-aux/vc-list-files.
* build-aux/ChangeLog-2007: Rename from */ChangeLog.
* doc/ChangeLog-2007: Likewise.
* lib/ChangeLog-2007: Likewise.
* m4/ChangeLog-2007: Likewise.
* po/ChangeLog-2007: Likewise.
2009-04-04 12:40:58 +02:00
Jim Meyering
7008e33441 tests: tweak po_check syntax check
* maint.mk (sc_po_check): Don't let dangling lib/*.[ch] links cause
spurious "grep: lib/file.h: No such file or directory" warnings.
2009-04-04 10:49:36 +02:00
Jim Meyering
100d4983e7 tests: improve ChangeLog syntax check
* maint.mk (sc_changelog): Use $(VC_LIST_EXCEPT), not find.
Don't hang when there are no ChangeLog files.
(sc_require_config_h): For the file-name-filter, use grep -l
to be slightly more efficient.
(sc_require_config_h_first, _header_without_use, sc_program_name):
Likewise.
2009-04-04 10:49:36 +02:00
Ralf Wildenhues
d75bcea4cf tests: make syntax-checks more robust
* maint.mk (_prohibit_regexp): Add ';' at end of ':'-introduced
comment so that the comment doesn't gobble up the following test
for a missing regexp definition.
(_header_without_use): Escape all '.'s in a header file name,
not just the first one.
2009-04-04 10:25:18 +02:00
Jim Meyering
eaacc89a45 * cfg.mk (old_NEWS_hash): Regenerate once more. 2009-04-03 22:05:10 +02:00
Jim Meyering
e1e5963a9d doc: adjust 7.2 "cat,cp,install,mv,split speed-up" NEWS item
* NEWS: Reword an entry from 7.2 and change "linux" to "GNU/Linux".
The latter was requested by Richard Stallman.
* cfg.mk (old_NEWS_hash): Regenerate.
2009-04-03 21:53:50 +02:00
Pádraig Brady
612b647dd1 ls: fix alignment when month names have varying widths
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR
locale has recently changed to use the official but variable width
abbreviated month names. Other glibc locales also have variable widths.
http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html
http://sourceware.org/bugzilla/show_bug.cgi?id=9859
* NEWS: Mention the fix
* gl/lib/mbsalign.c: A new module to align and truncate a
string in a specified number of screen cells, while handling
multi-byte characters appropriately.
* gl/lib/mbsalign.h: Ditto
* gl/modules/mbsalign: Ditto
* bootstrap.conf: Reference the new module
* src/ls.c (abmon_init): New function, precompute the abbreviated
months aligned left in a minimum width column <= 5 screen cells.
(align_nstrftime): New function, replace the first %b in the
format specification to strftime with the precomputed month string.
Note using the cached month strings speeds up `ls -lU` by around 17%
on glibc-2.7-2 on linux at least.  Also if we implement this function
using heap storage rather than automatic storage, and use snprintf
instead of strcpy, ls will slow down by 2% and 1% respectively
(i.e. a net gain of 14% rather than 17%).
* tests/ls/abmon-align: A new test to test ls alignment for
various formats and locales
* tests/Makefile.am: Reference the new test
2009-04-03 00:34:11 +01:00
Pádraig Brady
34f0c3e522 doc: Clarify the help for version sorting in ls and sort
* src/ls.c: Update the -v help description
* src/sort.c: Update the -V help description
2009-04-02 13:53:43 +01:00
Jim Meyering
a5ba6c8ef8 doc: adjust README-prereq instructions
* README-prereq: Reverse order of -b/--track options.
 Pádraig Brady mentioned that is required with at least git-1.5.3.6.
Invoke automake's own bootstrap script.
2009-04-02 14:45:49 +02:00
C de-Avillez
2ade7643de build: require automake-1.10b or newer
* bootstrap.conf: Require at least automake-1.10b.
* README-prereq: Mention 1.10b, not 1.10a.
2009-04-02 08:56:32 +02:00
Jim Meyering
4145a1e54c tests: skip mv/i-3 if /dev/stdin is unreadable
* tests/mv/i-3: Skip if /dev/stdin is unreadable.
Reported by Sergei Steshenko.
2009-04-02 08:44:12 +02:00
Jim Meyering
1417251e29 build: set automake's silent-rules option via configure.ac
* bootstrap: Revert commit 9f39fa855, 2009-03-28,
"build: use automake's --silent-rules option when possible".
* configure.ac (AM_INIT_AUTOMAKE): Instead, set it here.
Require the just-released version of automake: 1.10b.
2009-03-31 20:57:11 +02:00
Jim Meyering
30071248c9 tests: enable automake's color-tests and parallel-tests via configure.ac
* gnulib-tests/Makefile.am (AUTOMAKE_OPTIONS): Don't define here.
* tests/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
* configure.ac (AM_INIT_AUTOMAKE): Instead, add color-tests and
parallel-tests here.
2009-03-31 20:29:01 +02:00
Ralf Wildenhues
f8268d3bae build: use Automake's new parallel-tests feature
* build-aux/check.mk: Remove, not needed any more.
* tests/Makefile.am (AUTOMAKE_OPTIONS): Add parallel-tests and
color-tests.
* tests/check.mk: Do not include build-aux/check.mk any more.
(SUFFIXES, TEST_LOGS): Remove.
(TESTS_ENVIRONMENT): Use $$f rather than $$tst in $PERL invocation.
* gnulib-tests/Makefile.am: Do not include build-aux/check.mk.
(AUTOMAKE_OPTIONS): New macro, add parallel-test and color-tests.
(TEST_LOGS): Remove.
2009-03-31 20:29:01 +02:00
Jim Meyering
7a21310eb3 * README-release (savannah news): Also mention the Subject: to use. 2009-03-31 20:28:41 +02:00
Jim Meyering
278ae924be post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-03-31 14:48:50 +02:00
Jim Meyering
3dcf7a4d23 version 7.2
* NEWS: Record release date.
2009-03-31 14:11:57 +02:00
Jim Meyering
eeeccb3d0f tests: don't use lang-default from individual tests
* tests/sample-test: Don't recommend using lang-default here.
It is now run for each test automatically, via TESTS_ENVIRONMENT.
* tests/dd/reblock: Don't source lang-default here.
* tests/misc/truncate-fail-diag: Likewise.
2009-03-29 19:54:54 +02:00
Jim Meyering
6fa5f12107 tests: other-fs-tmpdir: remove just-added duplicate /usr/tmp
* tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Remove 2nd /usr/tmp.
2009-03-29 19:42:34 +02:00
Jim Meyering
d99c479311 tests: other-fs-tmpdir: avoid bogus "skipped **********..." diagnostic
* tests/other-fs-tmpdir (CANDIDATE_TMP_DIRS): Add /dev/shm to the list.
Don't use a line of asterisks as the first line of the "why skipped"
diagnostic, now that that line is printed on 'make check's stderr.
2009-03-29 09:59:23 +02:00
Jim Meyering
9f39fa8559 build: use automake's --silent-rules option when possible
* bootstrap: Use automake's --silent-rules option.
2009-03-28 13:46:02 +01:00
Jim Meyering
00f84872e4 tests: test-argv-iter.c: avoid declaration-after-stmt
* gl/tests/test-argv-iter.c: Move declaration "up", so as not
to ruffle feathers of crufty compilers.  We accommodate such
compilers here solely because this module may migrate to gnulib.
Tiny patch by Matthew Woehlke.
2009-03-27 17:33:26 +01:00
Eric Blake
a8fde98844 tests: fix 'make sc_tight_scope' on cygwin
* src/Makefile.am (sc_tight_scope): Ignore leading underscores in symbols.
2009-03-27 06:24:48 -06:00
Jim Meyering
e412e5cb49 tests: avoid spurious test failure in set-GID build dir
* tests/install/install-C-root: Skip this test if in set-gid directory.
Reported by Sven Joachim and C de-Avillez.
2009-03-27 09:39:51 +01:00
Jim Meyering
e65d0d0525 tests: migrate setgid-check into test-lib.sh
* tests/test-lib.sh (skip_if_setgid_): New function.
* tests/setgid-check: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove setgid-check.
* tests/chmod/c-option: Use the new function rather than sourcing
the separate file.
* tests/cp/cp-parents: Likewise.
* tests/install/install-C: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
2009-03-27 09:28:08 +01:00
Jim Meyering
9b6538aa8d tests: mark the rm/ext3-perf test as "very" expensive
* tests/rm/ext3-perf: Relegate this test to the very_expensive
category, since it is failing too often for me, when run in
parallel (-j4) with other disk-hammering tests.  This test fails
when it takes too long, so the fact that it fails under pressure
is an inconvenience more than a real problem.
2009-03-26 10:35:03 +01:00
Jim Meyering
843a0f1a23 * gnulib: Update submodule to latest. 2009-03-26 10:20:43 +01:00
Paul Eggert
22fa69e27d df: port the known-value fix to AIX as well
* src/df.c (known_value): New function, which also works on AIX
/proc file systems.
(df_readable, show_dev): Use it instead of hardcoding comparison to
UINTMAX_MAX.  Suggested by Jim Meyering and Matthew Woehlke.
2009-03-26 08:53:21 +01:00
Paul Eggert
c04cb1274c df: fix a bug when totaling unknown values
* src/df.c (show_dev): Don't add UINTMAX_MAX to grand totals, as that
value indicates that the true value is unknown; adding it effectively
subtracts 1 from the total, whereas we want to leave the total alone.
2009-03-26 08:53:21 +01:00
Jim Meyering
b102ed9ba6 tests: don't fail "make syntax-check" on cygwin
* maint.mk (NEWS_hash): Remove trailing " -" or " *-".
* cfg.mk (old_NEWS_hash): Regenerate, removing " -".
Reported by Eric Blake.
2009-03-25 22:51:55 +01:00
Eric Blake
9b4aa5e268 pwd: support -L and -P
* src/pwd.c (longopts): New variable.
(logical_getcwd): New function.
(main): Use it.
(usage): Document new options.
* doc/coreutils.texi (pwd invocation): Likewise.
* NEWS: Likewise.
* TODO (pwd): Mark it done.
* tests/misc/pwd-option: New file.
* tests/Makefile.am (TESTS): Add test.
* THANKS: Update.
Reported by Paul D. Smith, in savannah bug 24949.
2009-03-25 06:33:32 -06:00
Ondřej Vašík
53191d01e2 doc: update suffix regex in version sort
* doc/coreutils.texi: Reflect current filevercmp regex.
2009-03-25 12:28:03 +01:00
Ralf Wildenhues
26559b513d tests: CuTmpdir.pm: avoid use of undefined variable in warning
* tests/CuTmpdir.pm (chmod_tree): Do not warn if $dir is undefined.
2009-03-25 10:16:34 +01:00
Jim Meyering
b498eb071d tests: ls -v: exercise yet another change in gnulib's new filevercmp
* tests/misc/ls-misc: Add names with ~ and ~.1~ suffixes.
2009-03-24 22:33:47 +01:00
Jim Meyering
991a1d6de9 * gnulib: Update submodule to latest. 2009-03-24 21:49:03 +01:00
Kamil Dudka
2827bb5704 ls: make it possible to disable coloring of hard links
* src/ls.c (print_color_indicator): Don't color hard links if disabled
(when there is an empty hl= in the LS_COLORS environment variable).
* tests/ls/hardlink: Add test case for disabled hard link highlighting.
* NEWS: Mention the change.
2009-03-24 16:11:00 +00:00
Jim Meyering
d1df6ef183 tests: search only files that are under version control
* maint.mk (sc_error_exit_success): Search only files
that are under version control.
(sc_makefile_path_separator_check): Likewise.
Check *.mk files, too, not just Makefile.am files.
2009-03-21 09:58:43 +01:00
Jim Meyering
e45c9a02a4 tests: follow own advice: use $(PATH_SEPARATOR), not ":"
* maint.mk (coreutils-path-check): Use the variable, not the literal.
2009-03-21 09:58:37 +01:00
Jim Meyering
1f95a45099 tests: modernize: use $(var) makefile notation, not @var@
* maint.mk (sc_makefile_path_separator_check): Recommend
the use of $(PATH_SEPARATOR), not @PATH_SEPARATOR@.
Remove an obsolete comment.
2009-03-21 09:58:32 +01:00
Jim Meyering
143bfd67c9 tests: teach sc_dd_O_FLAGS about new syntax in dd.c
* cfg.mk (sc_dd_O_FLAGS): Adapt to new syntax.
2009-03-20 15:20:09 +01:00
Eric Blake
0b47305caa dd: use a more portable definition of O_FULLBLOCK
* src/dd.c (O_FULLBLOCK): Compute its value without using a 180KB
macro.  This avoids triggering a compilation failure with HP-UX's cc.
Reported by Matthew Woehlke.
2009-03-20 15:16:50 +01:00
Jim Meyering
25bbb44dbb tests: avoid spurious mkdir/selinux test failure on HP-UX 11.23
* tests/mkdir/selinux: Accept yet another diagnostic.
Reported by Matthew Woehlke.
2009-03-20 15:08:50 +01:00
Jim Meyering
25507a54f7 tests: df/total-verify: avoid test failure with older Perl
* tests/df/total-verify: Don't use perl's -f option.
Reported by Matthew Woehlke.
2009-03-19 18:49:57 +01:00
Jim Meyering
8e6a68e2fd * gnulib: Update submodule to latest. 2009-03-19 07:55:03 +01:00
Jim Meyering
5b86dc69d7 tests: adjust sort-continue not to fail under valgrind
* tests/misc/sort-continue: Don't run cat inside fd-limited shell.
If sort fails to run in an fd-limited shell, skip the test.
2009-03-18 21:44:45 +01:00
Paul Eggert
f31ea18146 tests: add another sort/nmerge test
* tests/Makefile.am (TESTS): Add sort-merge-fdlimit.
* tests/misc/sort-merge-fdlimit: New file.
* doc/coreutils.texi (sort invocation): Document that we now silently
lower nmerge if necessary.
Patch by Paul Eggert, Nima Nikzad, Max Chang, Alexander Nguyen,
Sahil Amoli, and Nick Graham.
2009-03-18 21:44:45 +01:00
Paul Eggert
8f7fae5972 sort: handle fd exhaustion better when merging
This is an alternative to my 9 March patch labeled "Silently lower
nmerge; don't (sometimes incorrectly) range-check"
<http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00070.html>.
It differs by not using 'dup' to probe for extra file descriptors;
instead, it simply calls 'open' (and 'pipe') to open files and pipes,
until one of these calls fails due to file descriptor exhaustion; it
then backs off by 1, does a merge with the files that it has opened,
and then retries with the (now-smaller) number of files.

This patch requires quite a few more changes to the source code than
the earlier patch, but it is in some sense "better" because it doesn't
need to call "dup" ahead of time in order to decide whether "open" or
"pipe" will fail.  Also, it's more robust in the case where "open" or
"pipe" fails with errno==EMFILE because some system-wide limit is
exhausted.

* src/sort.c (create_temp_file): New arg SURVIVE_FD_EXHAUSTION.
(stream_open): New function, containing guts of xfopen.
(xfopen): Use it.
(pipe_fork): Set errno on failure.
(maybe_create_temp): New function, containing guts of create_temp.
(create_temp): Use it.
(open_temp): Distinguish failures due to file descriptor exhaustion
from other failures, and on fd exhaustion return a notice to caller
rather than dying.  Don't test execlp's return value; when it returns,
it *always* returns -1.
(open_input_files): New function.
(mergefps): New arg FPS. It's now the caller's responsibility to open
the input and output files.  All callers changed.
(mergefiles): New function.
(avoid_trashing_input, merge): Handle the case where a single merge
can't merge as much as we wanted due to file descriptor exhaustion, by
merging as much as we can and then retrying.
* tests/Makefile.am (TESTS): Add misc/sort-continue.
* tests/misc/sort-continue: New file.
* THANKS: Add Glen Lenker and Matt Pham who coauthored this patch.
2009-03-18 21:44:37 +01:00
Jim Meyering
e6d2d94794 maint: normalize leading-TAB indentation in Makefiles
* maint.mk (sc_makefile_TAB_only_indentation): New rule.
Replace each TAB+8-space sequence with two TABs.
* man/Makefile.am: Likewise.
* build-aux/check.mk: Likewise.
I used this command (run it more than once, if needed):
t=$'\t'; git grep -l -E "$t {8}"|grep -E 'Makefile|\.mk$' \
| xargs perl -pi -e 's/\t {8}/\t\t/'
2009-03-18 12:40:07 +01:00
Jim Meyering
fd53921a68 maint: remove long-unused Makefile
* tests/sort-time/Makefile: Remove long-unused file.
2009-03-15 21:40:54 +01:00
Jim Meyering
20d523bfa2 maint: remove unused include and definitions
* gl/lib/randread.c (__attribute__): Remove unused definition.
(ATTRIBUTE_UNUSED): Likewise.
* gl/lib/selinux-at.c (_): Remove unused definition.
Don't include <gettext.h>.  No longer needed.
2009-03-15 08:17:41 +01:00
Jim Meyering
bd23509bef * gnulib: Update submodule to latest. 2009-03-15 08:09:53 +01:00
Jim Meyering
a4780e67f4 system.h: correct compilation error: MAX not defined
* src/system.h (io_blksize): Move definition down, so it follows that
of MAX -- to avoid compilation failure on OpenSolaris.  Reported by
David Bartley.  Details in
http://lists.gnu.org/archive/html/bug-coreutils/2009-03/msg00190.html
2009-03-14 21:46:35 +01:00
Jim Meyering
b581752137 * gnulib: Update to pull in select/interix work-around. 2009-03-14 11:49:56 +01:00
Kamil Dudka
558525592b doc: update "version sort" documentation
* doc/coreutils.texi: Reflect current filevercmp behavior.
2009-03-13 12:20:06 +01:00
Jim Meyering
ba5a1036f1 tests: groups-version: don't require that id be built
* tests/misc/groups-version: groups is now independent of id.
2009-03-12 19:48:29 +01:00
Jim Meyering
d16b4760d7 tests: skip the groups-dash test when "groups" is not built
* tests/misc/groups-dash: Skip if groups is not being installed.
Suggested by Mike Frysinger.
Also fail if groups exits with nonzero status.
2009-03-12 19:48:21 +01:00
Pádraig Brady
98aec338ef maint: mention Autoconf version required to build Automake
* README-prereq: coreutils currently requires an unreleased
version of Automake, so mention the minimum version of Autoconf
required to build that. Suggestion from James Youngman.
2009-03-12 14:19:01 +00:00
Jim Meyering
ebb9617fde * gnulib: Update submodule to latest. 2009-03-12 10:46:31 +01:00
Ondřej Vašík
c160afe902 cp: make -a option preserve xattrs, but with reduced diagnostics
* copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'.
(copy_attr_by_name): Likewise.
* cp.c (main): Preserve xattrs with -a option, when possible.
* doc/coreutils.texi: Document that xattrs are preserved with
cp -a, with no added diagnostics.
* NEWS: Mention the change.
* tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.
2009-03-11 17:32:44 +01:00
Pádraig Brady
cf0bb5e05d maint: Document how to best to enable gcc warnings for developers
* README-hacking: Mention --enable-gcc-warnings configure option
* configure.ac: Don't scare developers away from using gcc warnings
2009-03-11 14:52:52 +00:00
Jim Meyering
20dc2a6a61 maint: remove an obsolete FIXME comment
* src/Makefile.am (../AUTHORS): Remove obsolete FIXME comment.
There are no longer any installed *.sh programs.
2009-03-11 15:43:53 +01:00
Pádraig Brady
1644e58905 cat: Fix immediate output of processed data
Introduced by commit 790892db, 2006-06-08 "Ensure that cat works ...".
* NEWS: Mention the bugfix.
* src/cat.c (cat): Fix the typo which stopped the writing
of processed data before a blocking read() is done.
* tests/misc/cat-buf: Add to ensure processed data is not buffered.
* tests/Makefile.am: Reference the new test.
2009-03-11 14:27:39 +00:00
Pádraig Brady
55efc5f3ee cat,cp,mv,install,split: Set the minimum IO block size used to 32KiB
This is following on from this change:
[02c3dc9d 2008-03-06 cat: use larger buffer sizes ...]
which increased the IO block size used by cat by 8 times,
but also capped it at 32KiB.
* NEWS: Mention the change in behavior.
* src/system.h: Add a new io_blksize() function that
returns the max of ST_BLKSIZE or 32KiB, as this was
seen as a good value for a minimum block size to use
to get good performance while minimizing system call overhead.
* src/cat.c: Use it.
* src/copy.c: ditto
* src/split.c: ditto
2009-03-11 14:19:08 +00:00
Jim Meyering
93f6771e82 tests: add a test for newly-fixed bug in comm --check-order
* tests/misc/comm (ooo-prefix): Add a test for today's fix.
* NEWS (Bug fixes): Mention it.
2009-03-08 21:34:08 +01:00
Bruno Haible
83244ba312 comm: fix a bug in its new --check-order option
* src/comm.c: Include memcmp2.h.
(check_order): Use memcmp2 instead of memcmp.
* bootstrap.conf (gnulib_modules): Add memcmp2.
2009-03-08 21:34:08 +01:00
Jim Meyering
df2e983677 tests: ls -v: exercise the bug fixed by gnulib's new filevercmp
* tests/misc/ls-misc (version-sort): New test.
(mk_file): New function.
Reported by Josh Triplett in <http://bugs.debian.org/517558>.
Details in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16902
* NEWS (Bug fixes): Mention it.
2009-03-08 21:18:47 +01:00
Jim Meyering
97d21865fb gnulib: sync submodule to latest 2009-03-08 21:16:30 +01:00
Jim Meyering
a4053c5291 pr: fix a bug whereby --indent=N (-o) did not indent header lines
* src/pr.c (print_header): Honor chars_per_margin also for the header.
Inspired by a patch from C de-Avillez.
This change also adjusts two other %*s directives to be %*.*s instead,
(for the padding on either side of "file_text") to correct a bug that
could make pr print one space of padding instead of none.
* NEWS (Bug fixes): Mention it.
* tests/pr/o3Jml24f-lm-lo: Adjust for new expected output.
* tests/pr/o3a3Sl24f-tn: Likewise.
* tests/pr/o3a3Snl24f-tn: Likewise.
* tests/pr/o3a3l24f-tn: Likewise.
* tests/pr/o3b3Sl24f-tn: Likewise.
* tests/pr/o3b3Snl24f-tn: Likewise.
* tests/pr/o3b3l24f-tn: Likewise.
* tests/pr/o3mSl24f-bl-tn: Likewise.
* tests/pr/o3mSnl24fbltn: Likewise.
* tests/pr/o3ml24f-bl-tn: Likewise.
2009-03-07 23:52:08 +01:00
Jim Meyering
85507b24f9 bootstrap: add to XGETTEXT_OPTIONS
* bootstrap.conf (XGETTEXT_OPTIONS): Add c-format --flag options
for verror and verror_at_line; alphabetize.
2009-03-07 18:23:17 +01:00
Jim Meyering
19a0b6be60 maint: use a git submodule for gnulib
* .gitmodules: New file, to track gnulib.
* gnulib: New file, created by running this:
git submodule add git://git.sv.gnu.org/gnulib.git gnulib
2009-03-07 18:20:26 +01:00
Jim Meyering
51b88670cb build: allow ./bootstrap --srcdir=... to work with a git submodule
* bootstrap (git_modules_config): Use GIT_CONFIG, not GIT_CONFIG_LOCAL.
The latter was removed in v1.5.6.1-109-gdc87183.
2009-03-07 18:12:03 +01:00
Jim Meyering
4f526d2d64 build: avoid "multiply defined..." warning from automake
* Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) via +=, not =, to
avoid "multiply defined..." warning from automake.
2009-03-07 13:28:20 +01:00
Jim Meyering
02c3dc9de8 cat: use larger buffer sizes to reduce read/write-syscall overhead
* src/cat.c (max): Remove definition.  Use MAX from system.h instead.
(compute_buffer_size): New function to compute the input and output
buffer sizes, which are now set at 8 times st_blksize with a maximum
of 32KiB. Previously the typical block sizes used were 1KiB for pipes
and 4KiB for files, and now will be 8KiB and 32KiB respectively.
(main): Use it.
This change can double throughput on modern systems.  For timings,
see http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/16040
Suggestion from Tzvi Rotshtein.
2009-03-06 14:41:47 +01:00
Jim Meyering
8b638f994a maint: avoid new unused-macro warnings from gcc
* src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition,
to match commented-out use.
* src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE):
(READ_SIZE): Remove definitions of unused macros.
* src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise.
* src/dd.c (max): Likewise.
* src/expand.c (OUTPUT_BLOCK): Likewise.
* src/csplit.c (ALLOC_SIZE): Likewise.
* src/pr.c (NULLCOL): Likewise.
* src/ptx.c (Sword): Likewise.
* src/unexpand.c (OUTPUT_BLOCK): Likewise.
* src/factor.c (NDEBUG): Likewise.
2009-03-06 11:49:46 +01:00
Jim Meyering
5d71171e01 tests: fix just-introduced typo in rm/ext3-perf
* tests/rm/ext3-perf: Fix typo in commit 2b1e6636be,
2009-02-27 "tests: rm/ext3-perf: relax this test".
2009-03-06 11:48:16 +01:00
Jim Meyering
c763b485f5 maint: remove spurious case-ignoring option from a test
* maint.mk (sc_trailing_blank): Remove useless/harmless ignore_case=1.
2009-03-06 07:18:09 +01:00
Ralf Wildenhues
0d61f144a3 policy: use git to help avoid trailing white space
* HACKING (Avoid trailing white space): Describe how git can help.
2009-03-04 06:19:49 +01:00
Andreas Schwab
826095ffad Update Andreas Schwab's email address
* THANKS: Update Andreas Schwab's email address.
2009-03-03 23:07:16 +00:00
Jim Meyering
cb0d71399c maint: improve release-related process and documentation
* README-release: Fix typo. it's "maintainer-clean".
Refer to HACKING for full list of dependencies.
Use cvs add's -ko option to inhibit $Id$-style keyword expansion.
* maint.mk (web-manual): Factor out definition of $(manual_title).
(vc-dist): Set XZ_OPT=-9ev for the final "make dist".
* cfg.mk (manual_title): Define it here.
Suggestions from Eric Blake.
2009-03-03 08:24:29 +01:00
Jim Meyering
59cec5af12 dist: document our release procedure
* README-release: New file.
2009-03-02 19:53:25 +01:00
Jim Meyering
ce9c2c64de dist: automate the post-release web-manual update process
* maint.mk (web-manual): New rule, from m4's maint.mk.
* bootstrap.conf (gnulib_modules): Add gendocs.
2009-03-02 19:30:13 +01:00
Jim Meyering
2b1e6636be tests: rm/ext3-perf: relax this test
* tests/rm/ext3-perf: If set-up takes too long, use the set-up time
as the removal time limit.  Otherwise, a parallel "make check" would
usually fail when run with RUN_VERY_EXPENSIVE_TESTS=yes.
2009-03-02 09:35:12 +01:00
Jim Meyering
8c4f28b124 tests: don't skip setgid-dir related tests on SELinux-enabled systems
* tests/setgid-check: The change in ls (use ".", not "+") caused
this check always to report the working directory as set-gid.
Now, use stat, not ls.
2009-03-02 09:35:12 +01:00
Jim Meyering
0433f90e3d tests: reflect the s/+/./ SELinux indicator change
* tests/mkdir/perm: Now that this test is no longer always skipped,
make it work independently of ls: use stat, not ls, to get perm string.
* test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string
This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set.
2009-03-02 09:35:12 +01:00
Jim Meyering
1c7d5b5847 tests: when skipping a test, say why on screen, not just in the log
* tests/test-lib.sh: Redirect also to descriptor 9.
Better one-line why-skip diagnostics.
* tests/check.mk (TESTS_ENVIRONMENT): Redirect 9 to stderr.
* tests/misc/pwd-unreadable-parent: Remove redundant "skipping..." diag.
2009-03-02 09:35:12 +01:00
Jim Meyering
6449370e9e maint: enable many gcc warnings
* bootstrap.conf (gnulib_modules): Add manywarnings.
* configure.ac: Use gl_MANYWARN_ALL_GCC, and exclude options
I don't want or that provoke too many warnings.
(WARN_CFLAGS, WERROR_CFLAGS): Define.
(lint, GNULIB_PORTCHECK): Define.
(_FORTIFY_SOURCE): Define to 2.
2009-03-02 09:10:26 +01:00
Jim Meyering
ebfbdf9f0e maint: avoid gcc warning about missing attributes
* src/prog-fprintf.h (prog_fprintf): Declare with printf attribute.
* src/system.h (usage): Declare with the "noreturn" attribute.
2009-03-02 09:10:17 +01:00
Jim Meyering
2d10b7617b maint: avoid warnings about potentially-counterproductive "inline"
* src/dd.c (quit): Remove "inline" attribute.
* src/test.c (advance, unary_advance): Likewise.
2009-03-02 09:10:06 +01:00
Jim Meyering
14cdeddbf3 maint: cp: avoid gcc warning about unused macro definitions
* src/cp.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Remove.
2009-03-02 09:09:43 +01:00
Jim Meyering
2209d10f4c dist: do not emit MD5 or SHA1 checksums into announcement template
* maint.mk (announcement): Use announce-gen's new --no-print-checksums.
2009-03-02 08:59:06 +01:00
Jim Meyering
18332a65af maint: detect unnecessary inclusion of signal.h
* maint.mk (sc_prohibit_signal_without_use): New rule.
2009-02-28 11:06:35 +01:00
Jim Meyering
17b18bfa6c maint: remove an unnecessary inclusion of <signal.h>
* src/operand2sig.c: Don't include <signal.h>.
2009-02-28 11:06:35 +01:00
Pádraig Brady
eb1e30c213 tests: sort: Check skipping blanks in multibyte locales
* tests/misc/sort: On Fedora 8 at least, sort -k1b,1
mishandles blanks in multibyte locales, so add test.
2009-02-28 01:09:18 +00:00
Jim Meyering
d88c9f95e3 * HACKING: avoid trailing white space 2009-02-27 23:05:07 +01:00
Jim Meyering
b50a4ae557 cp: diagnose invalid "cp -rl dir dir" right away, once again
Running "mkdir dir; cp -rl dir dir" would create dir/dir/dir/...
rather than diagnosing the "copy-into-self" failure.

The easy fix would have been to revert this part of the change
[3ece0355 2008-11-09 cp: use far less memory in some cases]
that introduced the bug:

-         remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);
+         if (!x->hard_link)
+           remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev);

However, that would have induced the failure of the new cp/link-heap
test, due to the added memory pressure of recording 10k dev/ino pairs.
And besides, I liked that improvement and wanted to keep it.

Now that it's obvious recording the just-created-directory dev/ino
needn't depend on the setting of hard_link, I realized it is necessary
to record the pair only for the first directory created for each
source command-line argument.

I made that change, then noticed the new test, cp -rl a d d, would pass
when run once, yet output the into-self diagnostic twice.  Also note
the side effect: it creates d/a and d/d.  However, running that same
command a second time, now with the modified directory, would fail.

That turned out to be due to the fact that although the first into-self
failure was detected in copy_dir, that function would continue copying
other entries regardless -- and that would make it fail (eventually)
with the unwanted recursion.

* src/copy.c (copy_internal): This function needed an indicator of
whether, for a give command line argument, it had already created its
first directory.  If so, no more need to record dev/ino pairs.  If this
is the first, then do record its pair.  Hence, the new parameter.
(copy_dir, copy): Update callers.
(copy_dir): Upon any into-self failure, break out of the loop.
* tests/cp/into-self: Test for the above.
Reported by Mikael Magnusson.
2009-02-27 11:44:26 +01:00
Jim Meyering
3a914fa76d tests: stty-row-col would hang when run in the background
* tests/misc/stty-row-col: Don't hang when run in background
at least on Solaris 10 and OpenBSD.
2009-02-26 20:25:42 +01:00
Pádraig Brady
224a69b56b sort: Fix two bugs with determining the end of field
* src/sort.c: When no specific number of chars to skip
is specified for the end field, always skip the whole field.
Also never include leading spaces from next field.
* tests/misc/sort: Add 2 new tests for these cases.
* NEWS: Mention this bug fix.
* THANKS: Add bug reporter.
Reported by Davide Canova.
2009-02-26 14:40:28 +00:00
Eric Blake
9a2a8f0b3e argv-iter: avoid variadic macro
* gl/lib/argv-iter.h (_ATTRIBUTE_NONNULL_): Don't assume C99 variadic
macros are portable yet; needed for at least IRIX/MIPSpro.
* THANKS: Update.
Reported by Stuart Shelton.
2009-02-26 07:00:30 -07:00
Pádraig Brady
3f1579c470 tests: Remove system specific error strings
* tests/dd/skip-seek-past-file: Just check for
the non system specific part of the error strings.
This was causing an erroneous failure on NetBSD 1.6 at least.
2009-02-26 09:50:30 +00:00
Jim Meyering
bba5a47651 tests: using printf with \e for ESC isn't portable
* tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC.
This test failed when using the built-in printf of /bin/sh from
NetBSD 1.6.
2009-02-25 22:43:07 +01:00
Pádraig Brady
ca4e48f822 Ensure comment for translators is included in po file
Issue reported by Göran Uddeborg.

* src/system.h: Move the translator comment adjacent
to the translated string.
* THANKS: Update Göran's email address.
2009-02-24 11:58:01 +00:00
Tobias Stoeckmann
3a8d16800c truncate: fix typo in man page
* man/truncate.x: Fix spelling.
* THANKS: Update.
2009-02-22 10:16:15 -07:00
Andrew Church
de13679b32 doc: describe dd's status=noxref option
* doc/coreutils.texi (dd invocation): Describe status=noxref.
2009-02-22 10:26:22 +01:00
Jim Meyering
f7da3f1c10 tests: reenable temporarily-disabled tests using e.g., trap '' TTOU
Revert "tests: skip newly-modified tests unconditionally..."
This reverts commit 773a88d33f.
* tests/misc/stty: Don't skip.
* tests/misc/stty-invalid: Likewise.
* tests/mv/i-3: Likewise.
2009-02-22 01:42:43 +01:00
James Youngman
9bde4fd426 update James Youngman's email address
* THANKS: Update James Youngman's email address
2009-02-22 01:41:47 +01:00
Jim Meyering
359c48d5c6 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2009-02-21 22:49:24 +01:00
Jim Meyering
74ba433a14 version 7.1
* NEWS: Record release date.
2009-02-21 22:35:33 +01:00
Jim Meyering
c980b0566a * README: Mention that c99-to-c89.diff is no longer maintained. 2009-02-21 21:32:17 +01:00
Jim Meyering
31896c21c6 tests: skip new install-C test if working directory is set-gid
* tests/install/install-C: Use setgid-check.
2009-02-21 19:49:40 +01:00
Jim Meyering
773a88d33f tests: skip newly-modified tests unconditionally, just to be safe
* tests/misc/stty-invalid: Skip.
* tests/misc/stty: Likewise.
* tests/mv/i-3: Likewise.
2009-02-21 16:52:42 +01:00
Jim Meyering
cd78f85b0b tests: don't let SIGTTOU/TTIN hang a backgrounded "make check"
Running "make check &" would hang due to SIGTTOU and SIGTTIN signals.
* tests/misc/stty: Ignore SIGTTOU.
* tests/misc/stty-invalid: Likewise.
* tests/mv/i-3: Ignore SIGTTIN.
2009-02-21 16:52:39 +01:00
Jim Meyering
2061cd8aa6 doc: ls: clarify description of -s
* src/ls.c (usage): Make the description of -s mention "allocated size",
so that it's less likely to be confused with an apparent byte-count.
Suggested by Vito Caputo.
2009-02-20 19:32:02 +01:00
Jim Meyering
0c91ae335d doc: dd: document that the default block size is 512 bytes
* src/dd.c (usage): Document the default block size.
* doc/coreutils.texi (dd invocation): Document that the default
block size (bs, ibs, obs) is 512 bytes.
Reported by Petr Uzel.
2009-02-19 12:45:18 +01:00
Jim Meyering
0e40e9de57 maint: changing NEWS' copyright date must not invalidate checksum
* maint.mk (NEWS_hash): Don't let the Copyright date line contribute
to the checksum.
* cfg.mk (old_NEWS_hash): Update to reflect the new policy.
2009-02-18 16:09:45 +01:00
Jim Meyering
0a3f944791 doc: explain how to recover from changes committed to master
* HACKING: A beginner's commit-to-master is so common,
and causes enough confusion, that we describe how to recover.
2009-02-18 15:40:53 +01:00
Jim Meyering
fa391362e1 maint: add copyright notices
* HACKING: Add copyright notice.
* tests/test-lib.sh: Likewise.
2009-02-18 15:40:44 +01:00
Ondřej Vašík
8c243ff965 cp: -a now preserves SELinux context, with reduced diagnostics
* copy.c (copy_reg): Reduce SELinux context diagnostics for 'cp -a'.
(copy_internal): Likewise
* copy.h (cp_options): Add boolean reduce_diagnostics.
* cp.c (usage): Say that --archive (-a) behaves like -dR --preserve=all.
(cp_option_init): Initialize added reduce_diagnostics.
(main): Add reduce_diagnostics for the -a option, and preserve SELinux
context, if possible.
* mv.c (cp_options_init): Initialize new cp_options booleans.
* install.c (cp_option_init): Likewise.
* NEWS: Mention those behaviour changes.
* doc/coreutils.texi: Document --preserve=context, document that
diagnostics are not shown for failures of non-mandatory attributes
(just SELinux at the moment).
* tests/cp/cp-a-selinux: Check not only failures, but succesful use
of preserving SELinux context in cp.
2009-02-18 15:27:10 +01:00
Eric Blake
86cef85b36 add missing copyright dates
* NEWS: Add 2009 to copyright.
* README: Likewise.
* README-hacking: Likewise.
* TODO: Likewise.
* doc/Makefile.am: Likewise.
* m4/prereq.m4: Likewise.
* src/nl.c: Likewise.
* src/seq.c: Likewise.
* tests/cp/cp-i: Likewise.
* tests/install/install-C: Likewise.
* tests/install/install-C-root: Likewise.
* tests/install/install-C-selinux: Likewise.
* tests/misc/seq: Likewise.
* tests/mv/mv-n: Likewise.
2009-02-18 06:07:30 -07:00
Eric Blake
65ba955988 install: compare files in binary mode
* src/install.c (need_copy): Use O_BINARY when it matters.
2009-02-17 07:58:39 -07:00
Kamil Dudka
dac5f12c6e install: add --compare (-C) option to install file only when necessary
* src/install.c (have_same_content): New function to compare files
content.
(extra_mode): New function checking for non-permission bits in mode.
(need_copy): New function to check if copy is necessary.
(main): Handle new option --compare (-C).
(copy_file): Skip file copying if not necessary.
(usage): Show new option --compare (-C) in --help.
* tests/install/install-C: Basic tests for install --compare (-C).
* tests/install/install-C-root: Tests requiring root privileges.
* tests/install/install-C-selinux: Tests requiring SELinux.
* tests/Makefile.am: Add new tests for install --compare (-C).
* doc/coreutils.texi: Document new install option --compare (-C).
* NEWS: Mention the change.
2009-02-17 14:12:44 +01:00
Ondřej Vašík
26d3d090bd nl: correct long-option name for -v in usage
* nl.c (usage): Use --starting-line-number, not --first-page for -v
2009-02-17 14:10:39 +01:00
Jim Meyering
1eaacac312 doc: id: make --help and .man more descriptive
* src/id.c (usage): Improve description, based on a suggestion
from Brian M. Carlson in http://bugs.debian.org/514675
* man/id.x: Use a better one-liner, based on the one at top of id.c.
2009-02-15 10:17:19 +01:00
Pádraig Brady
5d0b158f4c seq: Fix equal width calculation when '.' added to last number
Issue reported by Samuel Hapák.
<http://lists.gnu.org/archive/html/bug-coreutils/2009-02/msg00139.html>

* src/seq.c: Account for '.' added to "last" number.
* tests/misc/seq: Add corresponding test.
* NEWS: Mention the fix.
2009-02-14 23:47:14 +00:00
Jim Meyering
982504452d du,chgrp,chmod,chown: use FTS_DEFER_STAT
* src/du.c (main): Use FTS_DEFER_STAT, for better locality of inode
reference.  Important when traversing file systems with fake inodes.
* src/chgrp.c (main): Likewise.
* src/chmod.c (main): Likewise.
* src/chown.c (main): Likewise.
The only remaining fts client, chcon, doesn't need this, since it goes
further and uses FTS_NOSTAT, which suppresses all non- directory
stat calls.
2009-02-13 18:41:01 +01:00
Pádraig Brady
48cae1e864 maint: mention how to run a single test in HACKING docs
* HACKING: Give an example of how to run a test in isolation.
* README: Fix/simplify example for running a single test.
* README-hacking: Reference the HACKING file.
2009-02-13 11:13:33 +00:00
Eric Blake
022889a457 ln: add details to --help text
* src/ln.c (usage): Mention more about symlink properties.
* doc/coreutils.texi (ln invocation): Likewise.
* THANKS: Update.
Reported by Vitali Lovich.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-02-11 21:26:51 -07:00
Jim Meyering
adc62b5d9f ls: clean up after wrapped+colored file names with clear-to-EOL
This change addresses a relatively unusual case: ls --color, with
a highlighted name being printed initially in the last row of a
terminal emulator (possibly followed by other lines of output) such
that it is wrapped onto the following line, as the terminal emulator
scrolls the output.  That would cause the entire following line to
be highlighted, even if the name happened to use only one position.
The least-invasive patch would have made colorized output larger for
all uses.  The approach taken below is more invasive, but limits the
increase in overhead to only those lines that are expected to wrap.
* src/ls.c (enum indicator_no): Add C_CLR_TO_EOL.
(indicator_name): Add "cl".
(color_indicator): Add default escape codes for "cl".
(print_long_format): Propagate width to print_name_with_quoting.
(print_name_with_quoting): Print new C_CLR_TO_EOL string if needed.
Return the width of what we're printing.
(print_file_name_and_frills): Propagate width.
(print_type_indicator): Return bool (aka width).
(print_many_per_line): Pass column position to print_* function.
(print_current_files): Likewise.
(print_horizontal): Likewise.
(print_with_commas): Likewise.
* src/dircolors.c (slack_codes): Add "CLRTOEOL".
(ls_codes): Add "cl".
* tests/ls/color-clear-to-eol: New file.  Test for this fix.
* tests/Makefile.am (TESTS): Add ls/color-clear-to-eol.
* THANKS: Update.
Reported by Alexander V. Lukyanov.  See thread for details:
http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824
Thanks to Jan Engelhardt for helping me reproduce the problem.

Demonstrate with this in an 80-column xterm:
  seq 200 # to start in the "bottom" row
  touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo
  env LS_COLORS='*.foo=0;31;42' ls -og --color=always

Before the fix, you'd see something like this:
(where the file name is printed in red on a green background,
and each "=" denotes a space on a green background)
...
  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo===================================================

After the patch, the trailing green spaces are gone:

  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo
2009-02-10 14:47:39 +01:00
Jim Meyering
1f4fcd083d * tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77. 2009-02-10 14:39:10 +01:00
Nix
9c8e4f6918 tests: avoid skipping stty-* tests
* tests/test-lib.sh (require_controlling_input_terminal_):
Check stdout, not stdin.
2009-02-10 14:38:42 +01:00
Jim Meyering
ed85df444a touch: deprecate --file option: equivalent to --reference (-r)
* src/touch.c: Mark long-undocumented --file for removal in 2010.
(main): Warn upon use of --file.
2009-02-09 11:44:40 +01:00
Pádraig Brady
0dc4478f13 tests: fix dd skip=greater_max_file_size test on Solaris 10
* tests/dd/skip-seek-past-file: I had previously commented that
on some systems lseek(> max file size) may succeed, but left
the possibility of failure in that case, so that I could determine
specific systems to put in the comments for both failure modes.
2009-02-06 07:46:08 +01:00
Jim Meyering
8ed84c3438 avoid spurious parentheses/arith-op-related warnings from newer gcc
* src/copy.c (set_owner): Use && rather than &.
* src/stty.c (main): Likewise.
* src/wc.c (wc): Likewise.
2009-02-05 14:53:10 +01:00
Jim Meyering
c55c0e7369 maint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- file
* maint.mk (sc_prohibit_atoi_atof): Require "(" after token.
* .x-sc_prohibit_atoi_atof: Remove names that no longer contain a match.
2009-02-02 09:37:48 +01:00
Jim Meyering
e3e9713fad doc: preserve --help line breaks in 'REPORTING BUGS' man page section
* man/help2man: Insert .br between adjacent lines.
2009-02-02 09:37:48 +01:00
Jim Meyering
6b8578af5e * src/system.h (emit_bug_reporting_address): Remove periods. 2009-02-02 09:37:48 +01:00
Jim Meyering
04d49874a2 update copyright dates from recent changes
* src/dd.c: Add 2009 to list of copyright years.
* tests/dd/seek-skip-past-file: Likewise.
* tests/dd/seek-skip-past-dev: Likewise.
* m4/xattr.m4: Likewise.
* src/copy.h: Likewise.
2009-02-02 09:37:48 +01:00
Jim Meyering
18810ae65f * maint.mk (sc_redundant_const): Use $(_prohibit_regexp). 2009-02-02 09:37:48 +01:00
jidanni@jidanni.org
d3dcb10f90 date doc: warn at -d about LC_TIME
We also warn here about LC_TIME, so the user will know even if he
doesn't look in the @xref{Date input formats}.
2009-02-02 08:40:18 +01:00
jidanni@jidanni.org
52b4d2a51a document sort --ignore-case --unique interaction 2009-02-02 08:38:41 +01:00
Jim Meyering
2b32399fdc maint: detect useless inclusion of c-ctype.h
* maint.mk (sc_prohibit_c_ctype_without_use): New rule.
2009-01-31 09:39:12 +01:00
Jim Meyering
44421c22a3 maint: teach "make syntax-check" to print each check name as it's run
* maint.mk (%.m): New rules to print each syntax-checking rule name,
just before running its commands.
($(syntax-check-rules)): Depend on it.
2009-01-29 13:31:28 +01:00
Jim Meyering
61a42e3743 maint: silence some syntax-check rules
* cfg.mk (sc_strftime_check): Silence the rule.
(sc_tight_scope): Likewise.
* src/Makefile.am (check-AUTHORS): Likewise.
2009-01-29 13:31:15 +01:00
Jim Meyering
60ca9e1599 maint: factor syntax-check rules
* maint.mk (_ignore_case): New macro.
(_prohibit_regexp): Use it.
Factor many existing syntax-check rules to use $(_prohibit_regexp).
2009-01-29 13:30:45 +01:00
Kamil Dudka
0889381cbf cp/mv: add xattr support
This patch was originally written by Andreas Grünbacher, nowadays
available at
http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff

* bootstrap.conf: Add gnulib module verror.
* po/POTFILES.in: Add lib/verror.c.
* m4/xattr.m4: Check for libattr availability, new configure option
--disable-xattr.
* m4/prereq.m4: Require gl_FUNC_XATTR.
* src/Makefile.am: Link cp, mv and ginstall with libattr.
* src/copy.h: Add preserve_xattr and require_preserve_xattr to
cp_options.
* src/copy.c (copy_attr_error): New function to handle errors during
xattr copying.
(copy_attr_quote): New function to quote file name in error messages
printed by libattr.
(copy_attr_free): Empty function requested by libattr to free quoted
string.
(copy_attr_by_fd): New fd-oriented function to copy xattr.
(copy_attr_by_name): New name-oriented function to copy xattr.
(copy_reg, copy_internal): Call copy_extended_attributes function.
* src/cp.c (usage): Mention new --preserve=xattr option.
(decode_preserve_arg): Handle new --preserve=xattr option.
* src/mv.c: Always attempt to preserve xattr.
* src/install.c: Never attempt to preserve xattr.
* tests/misc/xattr: New test for xattr support in cp, mv and install.
* tests/Makefile.am: Add the new test to list.
* doc/coreutils.texi: Mention xattr support, new --preserve=xattr
option.
* NEWS: Mention the change.
2009-01-29 13:26:07 +01:00
Jim Meyering
1bdf77ad52 system.h: add a comment re autoconf's new AC_PACKAGE_URL
* src/system.h (emit_bug_reporting_address): Add a comment
suggesting to use AC_PACKAGE_URL once we require autoconf-2.64.
2009-01-28 18:36:08 +01:00
Pádraig Brady
05a50b7848 tests: Fixup shred-passes test
* tests/misc/shred-passes: Set the $fail variable correctly.
The issue was noticed by Jim Meyering.
2009-01-28 16:43:52 +00:00
Pádraig Brady
2f61473e85 tests: Add a test to verify shred's default operations
* tests/Makefile.am: add new test
* tests/misc/shred-passes: Verify the operations shred
does by default to overwrite and remove a zero length file.
2009-01-28 15:39:18 +00:00
Pádraig Brady
460ebb078e dd: Better handle user specified offsets that are too big
Following are the before and after operations for seekable files,
for the various erroneous offsets handled by this patch:

skip beyond end of file
  before: immediately exit(0);
  after : immediately printf("cannot skip to specified offset"); exit(0);

skip > max file size
  before: read whole file and exit(0);
  after : immediately printf("cannot skip: Invalid argument"); exit(1);
seek > max file size
  before: immediately printf("truncate error: EFBIG"); exit(1);
  after : immediately printf("truncate error: EFBIG"); exit(1);

skip > OFF_T_MAX
  before: read whole device/file and exit(0);
  after : immediately printf("cannot skip:"); exit(1);
seek > OFF_T_MAX
  before: immediately printf("truncate error: offset too large"); exit(1);
  after : immediately printf("truncate error: offset too large"); exit(1);

skip > device size
  before: read whole device and exit(0);
  after : immediately printf("cannot skip: Invalid argument"); exit(1);
seek > device size
  before: read whole device and printf("write error: ENOSPC"); exit(1);
  after : immediately printf("cannot seek: Invalid argument"); exit(1);

* NEWS: Summarize this change in behavior.
* src/dd.c (skip): Add error checking for large seek/skip offsets on
seekable files, rather than deferring to using read() to advance offset.
(dd_copy): Print a warning if skip past EOF, as per FIXME comment.
* test/Makefile.am: Add 2 new tests.
* tests/dd/seek-skip-past-file: Add tests for first 3 cases above.
* tests/dd/seek-skip-past-dev: Add root only test for last case above.
2009-01-28 15:14:57 +00:00
Jim Meyering
0d5508de13 doc: emit better bug-reporting info, to help help2man
* src/system.h (emit_bug_reporting_address): End each "sentence"
with period, mark URLs with <...>.
Based on a suggestion from Eric Blake.
Use fputs on a string without %s, not printf.
2009-01-27 20:20:20 +01:00
Jim Meyering
ddf56e0440 doc: ensure that emit_bug_reporting_address changes propagate to *.1
* man/Makefile.am ($(MAN)): Depend on system.h.
2009-01-27 20:20:07 +01:00
Jim Meyering
2fbee63cc9 doc: restore "REPORTING BUGS" section to generated man pages
* man/help2man ($PAT_BUGS): Update regexp to match the newer
"Report PROG bugs ..." --help output, as well as "Report bugs...".
Reported by Eric Blake.
2009-01-27 19:17:14 +01:00
Jim Meyering
b27275c668 tests: generalize install-transform-check
* maint.mk (install-transform-check): Generalize to work also
in a project that installs manuals in a section other than "1".
2009-01-26 18:54:58 +01:00
Jim Meyering
016f8c9998 build: resolve conflict with new declaration from version-etc.h
* src/system.h (emit_bug_reporting_address): Define away,
now, gnulib's version-etc.h also declares this function.
In this package, we choose to include each program's name in
the diagnostic.  Define away the conflicting declaration.
(emit_bug_reporting_address): Also emit home page and
"General help..." links, like the new function does.
Reported by Bob Proulx.
2009-01-23 18:27:36 +01:00
Pádraig Brady
10f3e12a0d doc: shred: Correct docs on default number of overwrites.
* NEWS: Mention the change to the default number of passes.
* doc/Makefile.am: Update constants.texi with the default
number of passes shred uses, so that the documentation
will automatically reflect any future changes.
* doc/coreutils.texi (shred invocation): Update the description
of the --iterations option to have the correct default number,
while still conveying that there are 25 internal patterns
that may be useful.
2009-01-22 23:42:51 +00:00
Pádraig Brady
83ae1bdd44 shred: change default number of overwrites from 25 to 3
* src/shred.c: The concensus is that a default of 3
passes is appropriate for current drive technologies.
* src/TODO: Reference Paul Eggert's suggestion
of enhancing shred to conform to DoD 5220 rules.
2009-01-22 13:26:04 +00:00
Jim Meyering
2a8f5104cd m4: don't use AC_REQUIRE([AC_C_BIGENDIAN])
* m4/jm-macros.m4: Use AC_REQUIRE([gl_BIGENDIAN]) instead.
This avoids a subtle problem recently documented in autoconf:
http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=34e2c8d5484
2009-01-21 14:48:39 +01:00
Jim Meyering
065f14f471 no longer define *_FILENO constants
* src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
Remove definitions.  Now guaranteed by gnulib.
2009-01-19 21:27:57 +01:00
Jim Meyering
9a45c19667 build: use dist-xz, not dist-lzma, cont'd
* README-hacking: mention XZ utils
* README-prereq: Add a FIXME comment.
2009-01-19 13:47:04 +01:00
Jim Meyering
f6240c49df tests: tail-2/infloop-1 is racy
* tests/tail-2/infloop-1: Add a comment to that effect.
2009-01-19 12:09:12 +01:00
Jim Meyering
b52a88607f build: use dist-xz, not dist-lzma
* configure.ac (AM_INIT_AUTOMAKE): s/dist-lzma/dist-xz/.
Requires recent "xz" from git://ctrl.tukaani.org/lzma-utils.git
2009-01-18 13:20:26 +01:00
Jim Meyering
f15842de47 maint: remove obsolete sc_author_mark_check rule
* maint.mk (sc_author_mark_check): Remove rule.
"and" no longer appears in the definition of AUTHORS.
2009-01-16 23:31:04 +01:00
Jim Meyering
c926d002b5 Merge branch 'master' of git://git.sv.gnu.org/coreutils 2009-01-16 23:30:27 +01:00
Jim Meyering
31b6c0489a maint: enforce existing prohibition: no cvs $keywords$
* maint.mk (sc_prohibit_cvs_keyword): New rule.
2009-01-16 23:28:20 +01:00
Jim Meyering
a488f288a2 echo, printf, test: remove unused #include directives
* src/echo.c: Don't include "long-options.h". No longer used.
* src/printf.c: Likewise.
* src/test.c: Likewise.
2009-01-16 13:37:32 +01:00
Pádraig Brady
a7592cfcb2 pathchk: avoid -Wsign-compare warnings
* src/pathchk.c: Compare pathconf limits to _signed_ MAX constants,
as pathconf returns signed values.
2009-01-16 11:06:09 +00:00
Pádraig Brady
3288ebb0d7 pr: avoid -Wsign-compare warnings
* src/pr.c: Use unsigned variables in unsigned comparisons.
2009-01-16 11:06:09 +00:00
Pádraig Brady
9934f50282 shred: avoid -Wsign-compare warnings
* src/shred.c: Use already assigned signed variable sizeof_r,
rather than the unsigned sizeof(r). Don't use signed integer
overflow check that contemporary compilers may remove anyway.
2009-01-16 11:06:09 +00:00
Pádraig Brady
46d6df933e simplify mgetgroups() and avoid -Wsign-compare warnings
* gl/lib/mgetgroups.c: Avoid -Wsign-compare warning by using unsigned
types for the parameters of the new function realloc_groupbuf().
mgetgroups() was refactored to use this function rather than
explicitly allocating and copying from automatic storage itself.
* src/group-list.c: Use int rather than size_t as variable is
used in signed comparisons.
* src/id.c: ditto.
2009-01-16 11:06:09 +00:00
Eric Blake
7b1967351c test, echo, printf: don't accept option abbreviation
* src/test.c (main): Directly parse accepted options, thus
avoiding abbreviations.
* src/echo.c (main): Likewise.
* src/printf.c (main): Likewise.
2009-01-14 14:32:13 -07:00
Kamil Dudka
d01338eb3d cp/mv: add --no-clobber (-n) option to not overwrite target
* src/cp.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* src/mv.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* doc/coreutils.texi: Document new cp/mv option -n.
* tests/cp/cp-i: Add tests for -f, -i and -n options.
* tests/mv/mv-n: New test for mv -n.
* tests/Makefile.am: Add test mv/mv-n to the list.
* NEWS: Mention the change.
2009-01-14 09:09:22 +01:00
Eric Blake
a99c35b04d option handling: make exceptions more consistent
* doc/coreutils.texi (Common options): Not all utilities reject
option abbreviations.
* src/chroot.c (main): Report correct name on failure.
* src/echo.c (usage): Clarify long option usage.
* src/setuidgid.c (usage): Likewise.
* src/hostid.c (usage): Condense.
2009-01-08 07:57:36 -07:00
Jim Meyering
5e3a5ae519 * bootstrap.conf (avoided_gnulib_modules): Add dummy. 2009-01-07 22:57:19 +01:00
Jim Meyering
1fd718e93c * maint.mk: align some backslashes 2009-01-07 22:54:11 +01:00
Pádraig Brady
972967903d doc: pathchk description enhancements
* doc/coreutils.texi (pathchk invocation): Mention pathchk
checks validity (for current system) as well as portability.
Say messages go to stderr, and reorder description of checks
done for the -p option, to match what's done in code.
* src/pathchk.c (usage): Mention pathchk checks name validity.
Suggested clarifications were from Dan Jacobson.
2009-01-05 00:01:21 +00:00
Pádraig Brady
e0035fa4eb src/.gitignore: Ignore getlimits utility
* src/.gitignore: Ignore getlimits
2009-01-03 15:10:42 +00:00
Pádraig Brady
99be907838 tests: refactor to use the new getlimits utility
* tests/Coreutils.pm: Add function to make limits available
* tests/test-lib.sh: ditto
* tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW
rather than using arbitrary 2^128
* tests/misc/sort: ditto
* tests/misc/uniq: ditto
* tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW
rather than using arbitrary -2^31
* tests/misc/seq-long-double: Check for INTMAX_OFLOW
rather than using arbitrary 2^63
* tests/misc/split-fail: Check --lines --bytes and --line-bytes
options limits on all platforms. Note getlimits obviates the
need to use expr to check if 32 bit integers are supported,
which I think was invalid anyway as expr now supports bignum?
* tests/misc/test: Check for UINTMAX_OFLOW rather than
using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW
rather than using arbitrary -2^64
* tests/misc/timeout-parameters: Check for UINT_OFLOW
rather than using arbitrary 2^32
* tests/misc/truncate-overflow: Don't depend on truncate
to determine if we're on a 32 or 64 bit platform and
instead use the various OFF_T limits
* tests/misc/sort-merge: Check for UINTMAX_OFLOW
rather than using arbitrary 2^64+1
* tests/misc/unexpand: ditto
2009-01-03 15:10:42 +00:00
Michael Meskes
1ead085826 stat: print file-system total inode count (%c) as an unsigned number
* src/stat.c (print_statfs): Print statfs.f_files, the total inode
count of a file system, as an unsigned number.
2009-01-03 09:42:39 +01:00
Jim Meyering
695682d514 tests: factor ls-misc (no semantic change)
* tests/misc/ls-misc: Factor out uses of "\e[0m".
2009-01-01 10:05:24 +01:00
Jim Meyering
442d63051c update copyright year
* doc/coreutils.texi: Likewise.
* tests/sample-test: Likewise.
2009-01-01 02:15:07 +01:00
Jim Meyering
7fc5292a29 improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.

FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2009-01-01 02:15:07 +01:00
Jim Meyering
cf5616a0aa bootstrap: don't use cmp's -s option when reading from a pipe
GNU cmp exits without reading all input when given the -s option,
and that can cause termination of the writing process via SIGPIPE.
Instead, when reading from a pipe, just redirect output to /dev/null
so that all input is read.
2009-01-01 02:15:07 +01:00
Jim Meyering
13601dd3cf maint: factor out common code; prohibit use of HAVE_MBRTOWC
* maint.mk (_prohibit_regexp): New macro.
(sc_avoid_if_before_free, sc_cast_of_argument_to_free):
(sc_cast_of_x_alloc_return_value, sc_cast_of_alloca_return_value):
(sc_space_tab, sc_prohibit_atoi_atof, sc_prohibit_strcmp):
(sc_prohibit_stat_st_blocks, sc_prohibit_S_IS_definition): Use it.
(sc_prohibit_HAVE_MBRTOWC): New rule.
2009-01-01 02:15:07 +01:00
Jim Meyering
1ee192a9ff maint: use more sc_-prefixed names
* maint.mk (sc_po_check): Renamed from po-check.
(sc_author_mark_check): Renamed from author_mark_check.
(sc_copyright_check): Renamed from copyright-check.
(sc_makefile_path_separator_check): Renamed from
makefile_path_separator_check.
(local-checks-available): Remove the old names.
* Makefile.am (EXTRA_DIST): Reflect the renaming: .x-sc_po_check
* .x-po-check: Rename to...
* .x-sc_po_check: ...new file.
2009-01-01 02:15:07 +01:00
Jim Meyering
cbecb8cab8 maint: tighten m4 AC_ quoting check
* maint.mk (sc_m4_quote_check): Renamed from m4-check.
Also search for AC_DEFINE and AC_DEFINE_UNQUOTED.
Also search in configure.ac.
* configure.ac: Quote first argument of AC_DEFINE.
* jm-macros.m4 (coreutils_MACROS): Quote the first argument to AC_DEFINE.
2009-01-01 02:15:07 +01:00
Jim Meyering
fb992bae4c maint: move coreutils-specific syntax check rules into cfg.mk
* maint.mk (sc_dd_max_sym_length, sc_prohibit_jm_in_m4):
(sc_root_tests, sc_always_defined_macros, sc_system_h_headers):
(sc_sun_os_names, sc_tight_scope, sc_no_exec_perl_coreutils):
Move rules into cfg.mk.
(sc_strftime_check): Renamed from strftime-check, and moved, too.
* cfg.mk: Add the above rules.
2009-01-01 02:15:07 +01:00
Jim Meyering
ac9e4915ad portability: accommodate gnulib's getaddrinfo change
* src/Makefile.am (pinky_LDADD, who_LDADD): Append $(GETADDRINFO_LIB)
2009-01-01 02:15:07 +01:00
Jim Meyering
92465d59c6 cleanup/modernize: don't test HAVE_MBRTOWC; now gnulib provides it
* bootstrap.conf (gnulib_modules): Include mbrtowc explicitly.
* src/ls.c (quote_name): Don't test HAVE_MBRTOWC, now that we're
guaranteed to have the function.
* src/wc.c (wc): Likewise.
2009-01-01 02:15:07 +01:00
Eric Blake
921feefb12 doc: mention long option abbreviation
* doc/coreutils.texi (Common options): Give example of
abbreviating options.
* THANKS: Update.
Reported by Adam Jimerson.
2008-12-27 10:32:58 -07:00
Jim Meyering
0c65638b0f maint: ensure dd's computation of O_FULLBLOCK uses all O_ symbol names
* src/dd.c (O_FULLBLOCK): Use a more uniform initializer, that makes
it easier to extract all O_ symbol names.
* maint.mk (syntax-check-rules): Also search for sc_ rules in cfg.mk.
(sc_root_tests): Ensure that this rule sets $diff.
* cfg.mk (sc_dd_O_FLAGS): New rule.
2008-12-26 12:08:51 +01:00
Matt Harden
5c065bb0cb dd: add support for opening files in Concurrent I/O (CIO) mode
* src/dd.c (O_CIO): New flag.
* src/dd.c (O_FULLBLOCK): Add O_CIO to the list of flags that
O_FULLBLOCK should be greater than.
* src/dd.c (flags): Give the name "cio" to the new O_CIO flag, mirroring
the treatment of O_DIRECT.
* src/dd.c (usage): Add a description of the new flag when it is available.
* doc/coreutils.text (dd invocation): Describe the new flag.
* NEWS: Mention the new feature.
2008-12-26 10:57:05 +01:00
Jim Meyering
680afe6751 build: do enable $(WERROR_CFLAGS) for src/ files.
This reverts the more recent commit (of two) entitled "build:
add configure-time --enable-gcc-warnings option; avoid warnings".
Pádraig Brady spotted the contradiction between the log message
and actual change.

This reverts commit 292d68565a.
2008-12-23 17:22:57 +01:00
Pádraig Brady
0fcf730104 doc: stty: Clarification of some input and output settings
* doc/coreutils.texi (stty invocation): Clarify any
ambiguity in regard to the direction of input and output settings.
Add some notes on the case changing settings.
Most of the text was supplied by Dan Jacobson.
2008-12-23 14:26:22 +00:00
Pádraig Brady
f144582e17 timeout: remove problematic casts
* src/timeout.c (apply_time_suffix): Change input parameter from
unsigned int to unsigned long, which is the type of the variable it's
actually manipulating.  This removes the need for the cast which was
giving a warning with the gcc options: -fstrict-aliasing
-Wstrict-aliasing.  Also add a check for overflow possible on 16-bit
platforms, and fix indents.
(main): Remove a redundant cast in the alarm() call.
2008-12-23 10:29:05 +00:00
Jim Meyering
9a913a2461 * .x-sc_require_config_h: Remove obsolete regexps. 2008-12-21 17:50:09 +01:00
Jim Meyering
317d2c6384 maint.mk: enforce the "include <config.h> first" rule
* maint.mk (sc_require_config_h_first): New rule.
* .x-sc_require_config_h_first: New file.
2008-12-21 17:49:58 +01:00
Jim Meyering
292d68565a build: add configure-time --enable-gcc-warnings option; avoid warnings
* bootstrap.conf (gnulib_modules): Add "warnings" module.
* configure.ac: Add --enable-gcc-warnings, derived from code in bison.
* src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS)
* lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS)
Don't use $(WERROR_CFLAGS), yet.
* src/system.h (usage): Declare.
* src/base64.c (usage): Declare to be global, for consistency.
* src/timeout.c (usage): Likewise.
* src/truncate.c (usage): Likewise.
* src/getlimits.c (usage): Likewise.
* src/pinky.c (ttyname): Declare with prototype, rather than an
empty argument list.
* src/who.c (ttyname): Likewise.
* src/su.c (crypt, getusershell, setusershell, endusershell): Likewise.
2008-12-21 17:49:58 +01:00
Jim Meyering
c352bb469d build: turn on $(WERROR_CFLAGS) for src/ 2008-12-21 17:49:58 +01:00
Jim Meyering
22a2a43021 build: add configure-time --enable-gcc-warnings option; avoid warnings
* bootstrap.conf (gnulib_modules): Add "warnings" module.
* configure.ac: Add --enable-gcc-warnings, derived from code in bison.
* src/Makefile.am (AM_CFLAGS): Set to $(WARN_CFLAGS) # $(WERROR_CFLAGS)
* lib/Makefile.am (AM_CFLAGS): Change spelling to $(WARN_CFLAGS)
Don't use $(WERROR_CFLAGS), yet.
* src/system.h (usage): Declare.
* src/base64.c (usage): Declare to be global, for consistency.
* src/timeout.c (usage): Likewise.
* src/truncate.c (usage): Likewise.
* src/getlimits.c (usage): Likewise.
* src/pinky.c (ttyname): Declare with prototype, rather than an
empty argument list.
* src/who.c (ttyname): Likewise.
* src/su.c (crypt, getusershell, setusershell, endusershell): Likewise.
2008-12-21 17:49:58 +01:00
Pádraig Brady
4000c35ae3 doc: Remove curly quotes from shell examples in man pages
Use \(aq rather than a literal ' as groff will convert apostrophe
to a right quote (\u2029) in utf8 locales for example.
Stepan Kasal details the issue and fix here:
http://lists.gnu.org/archive/html/bug-coreutils/2008-12/msg00124.html
2008-12-17 10:47:23 +00:00
Jim Meyering
99eccc3359 ChangeLog-2008: say ChangeLog files are no longer manually maintained
and point to HACKING's policy.  Suggestion from Dan Jacobson.
2008-12-16 08:15:39 +01:00
Jim Meyering
9965d234e5 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.
2008-12-16 08:04:01 +01:00
Jim Meyering
a011b01af1 doc: pr: formatting corrections
* doc/coreutils.texi (pr invocation): Fix some overzealous uses of @var.
Reported by Andreas Schwab.
2008-12-13 18:00:47 +01:00
Ralf Wildenhues
28fbe5a487 more portable bootstrap procedure
* bootstrap (get_version): Fix portability issues in sed script.
(check_versions): For buildreq apps, honor the corresponding
$APP variable like $AMTAR, $AUTOCONF.
(usage): Document this.
(update_po_files): Honor $SHA1SUM.
(main): Honor $AUTOPOINT, $ACLOCAL, $AUTOCONF, $AUTOHEADER,
$AUTOMAKE, $LIBTOOLIZE.
2008-12-13 18:00:44 +01:00
Jim Meyering
9b8023e69c tests: ensure that chmod, chgrp and chown honor --silent
* tests/chmod/silent: New file, to test all three programs.
* tests/Makefile.am (TESTS): Add chmod/silent.
* NEWS (Bug fixes): Mention this.
The bug was introduced in 96a5d2ce6a.
2008-12-03 11:02:57 +01:00
Ondřej Vašík
b8497a3a7a chmod, chown, chgrp: honor --silent (-f) once again
* chmod.c (process_file): Make -f suppress fts-related diagnostics.
* chown-core.c (change_file_owner): Likewise.
Reported via <http://bugzilla.redhat.com/474220>.
2008-12-03 11:02:45 +01:00
Jim Meyering
c2e56e0de7 wc: read and process --files0-from= input a name at a time,
when the file name list is not too large.  Before, wc would always read
the entire file name list into memory and *then* process each file name.
wc does read the list into memory when the list is known not to be too
large; this is done in order to be able to align the output numbers,
as it does with arguments specified on the command-line
* src/wc.c: Include "argv-iter.h".
(main): Rewrite to use argv-iter when the input file name list
is known to be too large.
* NEWS (Bug fixes): Mention it.
2008-12-02 13:12:22 +01:00
Jim Meyering
031e2fb5e9 du: read and process --files0-from= input a name at a time,
rather than by reading the entire input into memory and *then*
processing each file name.
* src/du.c: Include "argv-iter.h", not "readtokens0.h".
(main): Rewrite to use argv-iter.
Call xfts_open on each argument, rather than on the entire
argv list at once.
Call print_size here, not from du_files.
Diagnose read failure.
* NEWS (Bug fixes): Mention it.
* THANKS: update.
Reported by Barry Kelly.  More details in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/15159/
2008-12-02 13:12:13 +01:00
Jim Meyering
e181802521 seq: plug a leak
* src/factor.c (emit_ul_factor): Call mpz_clear.
2008-12-01 22:44:20 +01:00
Jim Meyering
c58b5daa33 avoid warnings about initialization of automatic aggregates
* src/system.h (DZA_CONCAT0, DZA_CONCAT): New macros.
(DECLARE_ZEROED_AGGREGATE): New macro.
* src/ls.c (quote_name): Use it.
* src/pathchk.c (portable_chars_only): Use it.
* src/shred.c (main): Use it.
* src/stty.c (main): Use it.
* src/wc.c (SUPPORT_OLD_MBRTOWC): Use it.
2008-12-01 21:18:52 +01:00
Jim Meyering
80325aca2d * bootstrap.conf (gnulib_modules): Add argv-iter. 2008-12-01 17:41:18 +01:00
Jim Meyering
d3b5555f10 argv-iter: add tests
* gl/modules/argv-iter-tests: New module.
* gl/tests/test-argv-iter.c: New file.
2008-12-01 17:41:08 +01:00
Jim Meyering
ca738e4414 argv-iter: new module
* gl/lib/argv-iter.h: New file.
* gl/lib/argv-iter.c: New file.
* gl/modules/argv-iter: New file.
With a suggestion for improved memory management by Pádraig Brady.
2008-12-01 17:40:59 +01:00
Jim Meyering
21eb87e6ea * src/hostname.c (sethostname) [!HAVE_SETHOSTNAME]: Remove declaration. 2008-12-01 17:40:27 +01:00
Jim Meyering
7ef56a26fd cp, mv: remove 3-year-deprecated+warned-about --reply option
* src/cp.c (reply_args, reply_vals): Remove globals.
[REPLY_OPTION]: Remove enum.
(long_opts) ["reply"]: Remove initializer.
(main): Remove case stmt.
* src/mv.c: Likewise.
Don't include "argmatch.h".  No longer used.
* NEWS (Changes in behavior): Mention this.
* tests/Makefile.am (TESTS): Remove mv/reply-no.
* tests/mv/reply-no: Remove file.
* tests/mv/i-link-no: Update, now that --reply= is gone.
2008-12-01 17:03:37 +01:00
Pádraig Brady
aa2617b908 doc: Make descriptions of ASCII NUL and --zero-terminated option consistent
doc/coretuils.texi: Refactor shuf, sort and uniq --zero-terminated
option to use the same text. Also refer to NUL characters as
@acronym{ASCII} @sc{nul} consistently.
2008-12-01 14:05:56 +00:00
Jim Meyering
016958f2f0 doc: enforce @var{lower} policy
* doc/coreutils.texi: Fix remaining violations.
* doc/Makefile.am (sc-lower-case-var): New rule.
Add some command-suppressing "@" directives so that a successful
"make check" run is less noisy.
2008-12-01 09:25:06 +01:00
Pádraig Brady
1ce9d86c30 doc: Tweak info docs to standarise on lower-case @var{file}
* doc/coreutils.texi: s/@var{FILE}/@var{file}/
2008-12-01 02:29:57 +00:00
Pádraig Brady
00b5a2db33 doc: Improve description of --files0-from option
* doc/coreutils.texi: Describe the most common
usage of --files0-from=- to read names from stdin.
* src/du.c: Likewise.
* src/sort.c: Likewise.
* src/wc.c: Likewise.
2008-12-01 02:09:19 +00:00
Pádraig Brady
e34894bf3f tests: dd/reblock: Reduce chance of timing related failures
* tests/dd/reblock: Change the IPC mechanism to the dd process
under test, from pipes to fifos. Also change the delay
between data writes to 0.2s for both tests.
This should increase the chance that the dd process
will read the data chunks separately.
2008-12-01 01:20:18 +00:00
Jim Meyering
b14e5c40b9 m4: avoid a warning from gcc's -Wstrict-prototypes
* m4/jm-macros.m4 (ARGMATCH_DIE_DECL): Use proper prototype for usage.
2008-11-30 19:15:51 +01:00
Jim Meyering
90f74735aa tests: df: skip total-verify if df fails
* tests/df/total-verify: Skip the test if df fails.
2008-11-30 19:15:51 +01:00
Jim Meyering
d6a62182f0 build: don't reject definition of STREQ
* maint.mk (sc_prohibit_strcmp): Tighten rule: exclude
macro definitions like the one in system.h.
* .x-sc_prohibit_strcmp: Don't exempt src/system.h.
2008-11-30 19:15:51 +01:00
Jim Meyering
847ab6a518 tests: start long-running cp/link-heap earlier
* tests/Makefile.am (TESTS): Move cp/link-heap nearer the start of the
list, so that its termination doesn't delay a parallel "make check".
2008-11-30 19:15:51 +01:00
Jim Meyering
b5b3690d06 tests: avoid failure of cp/link-heap on some systems
* tests/cp/link-heap: Raise virtual memory limit from 10,000
to 14,000, to avoid failure on Debian/unstable (libc6 2.7-16).
2008-11-30 19:15:51 +01:00
Jim Meyering
57e2022b8d remove explicit declaration of putenv, ...
* src/date.c: ... now that gnulib guarantees that it's in <stdlib.h>.
* src/env.c: Likewise.
2008-11-30 19:14:29 +01:00
Jim Meyering
be6b4218e4 tests: dd/reblock: avoid occasional failure
* tests/dd/reblock: Sleep longer to avoid a race condition.
Reported by Bob Proulx.
2008-11-30 19:01:45 +01:00
James Youngman
48a05a9ce9 pwd: add pwd -P, -L to TODO
* TODO: Add to-do entry for -P and -L options of pwd.
2008-11-27 12:22:59 +01:00
Ondřej Vašík
fc3b301d4f doc: fix typo in units factorization, removed TODO items
* doc/coreutils: switch typo (switched gibibytes/gigabytes)
* TODO:          removed missing chcon and runcon documentation from list
2008-11-26 16:18:50 +01:00
Jim Meyering
c7e971bee0 doc: factor out list of suffix-to-number (e.g., KB->1000B) mappings
* coreutils.texi (multiplierSuffixes, multiplierSuffixesNoBlocks):
New macros.
(od invocation, head invocation, tail invocation, split invocation):
(truncate invocation): Use them.
2008-11-26 15:37:47 +01:00
Jim Meyering
b0312caf6f doc: tail: one more s/bytes/n/ change
* doc/coreutils.texi (tail invocation): Make one more
@var{bytes} -> @var{n} change.
2008-11-26 15:36:55 +01:00
Pádraig Brady
1c318d52de doc: tail: fix description of --bytes=N (-c)
* doc/coreutils.texi (tail invocation): Use @var{n} consistently,
not a mix of that and @var{bytes}.  Reported by anonymous
in <http://savannah.gnu.org/bugs/?24934>.
2008-11-26 14:27:09 +00:00
Karl Berry
186b655094 doc: move @shortcontents and @contents from end to start
* doc/coreutils.texi: Move @shortcontents and @contents from the
end to the beginning, just after "@end titlepage".
2008-11-23 12:45:40 +01:00
Jim Meyering
8333cc3c0f doc (stat): clarify: there are two sets of format directives
* doc/coreutils.texi (stat invocation): Clarify description of
--file-system format directives.
2008-11-23 12:36:13 +01:00
Karl Berry
c27c4a0957 doc (stat): correct formatting in coreutils.texi
* doc/coreutils.texi (stat invocation): Move the list of regular,
non-file-system, format directives from the description of --terse,
out of the enclosing table.
2008-11-23 12:36:08 +01:00
Jim Meyering
a5e53ecc2c tests: dd: add a test for the required behavior
* tests/dd/reblock: New file.  Test for the required functionality.
Based on an example and discussion from this thread:
http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html
* tests/Makefile.am (TESTS): Add dd/reblock.
2008-11-22 10:31:08 +01:00
Pádraig Brady
d5ab05998c Revert part of "dd: avoid unnecessary memory copies"
This reverts part of commit fbd87029cf.
Paul Eggert noticed the problem in
http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00153.html
* doc/coreutils.texi (dd invocation): Clarify.
2008-11-22 10:20:31 +01:00
Pádraig Brady
a2be861b04 getlimits: A new utility for use in coreutils' tests
* src/getlimits.c: A utility to print platform dependent
limits in a format suitable for use in shell scripts.
* src/Makefile.am: Add getlimits to list of utilities
to build but not install. Also add it to the list linked
with libiconv
* po/POTFILES.in: Add getlimits to translation list.
2008-11-21 15:46:26 +00:00
Pádraig Brady
fbd87029cf dd: avoid unnecessary memory copies
* src/dd.c (scanargs): When not otherwise required (e.g. for
conversion), use two-buffer mode only when the input and output
buffer sizes differ.  Before, some of the most basic invocations of
dd, e.g., dd < in > out, would unnecessarily use separate buffers
and perform memory copies between them.
2008-11-21 11:50:59 +00:00
Jim Meyering
3ece0355d5 cp: use far less memory in some cases
cp --link was "remembering" many name,dev,inode triples unnecessarily.
cp was doing the same, even without --link, for every directory in the
source hierarchy, while it can do its job with entries merely for the
command-line arguments.  Prompted by a report from Patrick Shoenfeld.
Details <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/15081>.
* src/copy.c (copy_internal): Refrain from remembering
name,dev,inode for most files, when invoked via cp --link.
Record an infloop-avoidance triple for each directory specified
on the command line, not for each directory in the source tree.
Don't record a dir-triple when x->hard_link is set.
* NEWS (Buf fixes): Mention it.
* tests/cp/link-heap: New file.  Test for cp's lowered memory usage.
* tests/Makefile.am (TESTS): Add link-heap.
2008-11-20 10:21:52 +01:00
Jim Meyering
1760ade090 tests: add a test of cp --preserve=links
* tests/cp/link-preserve: Add a case and comments.
2008-11-20 10:21:52 +01:00
Jim Meyering
ed017d44b2 cp: remove unused code
* src/cp-hash.c (remember_created): Remove unused function.
Remove thus-obviated headers: <stdio.h>, "quote.h", "error.h".
* src/cp-hash.h (remember_created): Remove declaration.
2008-11-20 10:21:52 +01:00
Jim Meyering
8b09875b59 doc: HACKING: reference http://www.gnu.org/licenses/why-assign.html
Suggestion from Patrick Schoenfeld.
2008-11-17 11:16:19 +01:00
Jim Meyering
4e38e6a19c tests: remove debug code that would try to write into /t/k-env
* tests/ls/no-cap: Remove debugging "tee".
2008-11-16 10:45:41 +01:00
Jim Meyering
b3e779c090 tests: change misc/printf-surprise so that it doesn't segfault anymore
* tests/misc/printf-surprise: Disable MALLOC_PERTURB_, so that "make
check" no longer provokes a segfault from printf(1).  Before, that
would be detected as a known problem and cause the test to be skipped.
Adjust the test so that a segfault once again results in test failure.
2008-11-16 09:53:48 +01:00
Jim Meyering
17409787bb tests: remove df/total
* tests/df/total: Remove file.
* tests/Makefile.am (TESTS): Remove df/total.
It is subsumed by df/total-verify.
2008-11-12 13:29:38 +01:00
Ondřej Vašík
ac819e1044 * tests/df/total-verify [VERBOSE]: Run df --version, not ls --version. 2008-11-12 13:27:23 +01:00
Jim Meyering
36eb45201f avoid spurious test failure when df always fails
* tests/df/total-verify: Skip upon _df_ failure, not tee failure.
Reported by Ondřej Vašík.  Details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/15028>.
2008-11-12 12:53:54 +01:00
Eric Blake
b43255473f jm-macros.m4: avoid syntax issue with newer autoconf
* jm-macros.m4 (coreutils_MACROS): Make LIB_CAP assignment persistent.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-11-11 10:44:59 -07:00
Jim Meyering
90a83264b9 Update references to GFDL: 1.2 -> 1.3
* doc/coreutils.texi: Likewise.
* doc/perm.texi: Likewise.
* old/fileutils/NEWS: Likewise.
* old/sh-utils/NEWS: Likewise.
* old/textutils/NEWS: Likewise.
2008-11-11 09:51:30 +01:00
Jim Meyering
43448b0493 make --help print "Report PROGRAM translation bugs to <...>."
for all but the C/POSIX locale.
* src/system.h: Include "hard-locale.h".
(emit_bug_reporting_address): Tell where to report translation bugs.

don't include "hard-locale.h", now that system.h does
* src/comm.c: Likewise.
* src/join.c: Likewise.
* src/ls.c: Likewise.
* src/pinky.c: Likewise.
* src/pr.c: Likewise.
* src/sort.c: Likewise.
* src/uniq.c: Likewise.
* src/who.c: Likewise.
2008-11-10 08:19:52 +01:00
Jim Meyering
854284f788 avoid warnings about discarding "qualifiers from pointer target type"
Use the new "bad_cast" function or an actual cast-to-"(char *)"
to avoid warnings.
* src/system.h (bad_cast): Define.
* src/chown.c (main):
* src/chroot.c (main):
* src/date.c (main):
* src/du.c (main):
* src/expand.c (stdin_argv):
* src/ls.c (decode_switches):
* src/md5sum.c (main):
* src/paste.c (main):
* src/pr.c (col_sep_string, column_separator, line_separator, main):
* src/sort.c (main):
* src/split.c (main):
* src/tail.c (main):
* src/unexpand.c (stdin_argv):
* src/yes.c (main):
2008-11-10 08:11:59 +01:00
Jim Meyering
0e2ac2de24 avoid a compiler warning
(strip_program): Declare to be const.
2008-11-10 08:11:59 +01:00
Jim Meyering
03911ef780 use xfreopen in place of unchecked freopen
* bootstrap.conf (modules): Add xfreopen.
* src/cat.c (main): Include "xfreopen.h".  Use xfreopen.
* src/cksum.c (cksum): Likewise.
* src/head.c (head_file, main): Likewise.
* src/md5sum.c (digest_file): Likewise.
* src/od.c (open_next_file): Likewise.
* src/split.c (type_undef): Likewise.
* src/sum.c (bsd_sum_file, sysv_sum_file): Likewise.
* src/tac.c (tac_file, main): Likewise.
* src/tail.c (tail_file, main): Likewise.
* src/tee.c (tee_files): Likewise.
* src/tr.c (main): Likewise.
* src/wc.c (wc_file): Likewise.
* po/POTFILES.in: Add lib/xfreopen.c
2008-11-10 08:11:59 +01:00
Jim Meyering
32d4d0dd5e xfreopen: new module
* gl/lib/xfreopen.c: New file.
* gl/lib/xfreopen.h: New file.
* gl/modules/xfreopen: New file.
2008-11-10 08:11:59 +01:00
Jim Meyering
cfa2120e83 Update URL: s!www.iro.umontreal.ca!translationproject.org/team/...!
* Makefile.am (THANKS-to-translators): Update URL template.
2008-11-09 15:35:51 +01:00
James Youngman
1c5e5d6277 install: indicate clearly it's not for installing packages
* src/install.c (usage): Indicate the program copies files,
as opposed to installing packages.
2008-11-09 13:56:00 +01:00
Jim Meyering
41ec3548b0 emit more precise bug-reporting instructions
Hoping that this will decrease the volume of bug reports
mistakenly directed to the coreutils mailing list.
* src/system.h (emit_bug_reporting_address): Specify the program
name in the "Report bugs to <...>." line in each program's --help
output and man page.  Now, it will say "Report PROGRAM_NAME bugs
to <...>."  Suggestion from Ondřej Vašík.
2008-11-08 19:59:52 +01:00
Jim Meyering
5b27ec57b0 include gnulib's strdup module explicitly
* bootstrap.conf (gnulib_modules): Include strdup explicitly, to
keep the latest version of gnulib-tool from omitting this now-marked-
as-obsolete module.
2008-11-05 19:18:59 +01:00
Kamil Dudka
1e48b1fee5 ls: --color now highlights hard linked files, too
* src/ls.c (print_color_indicator): Colorize hard linked files.
* src/dircolors.c: Add color for hard link.
* src/dircolors.hin: Add color for hard link.
* tests/ls/hardlink: Test for ls - colorize hard linked files.
* tests/Makefile.am (TESTS): Add ls/hardlink.
* NEWS: Mention the change.
2008-10-28 21:08:30 +01:00
Jim Meyering
5dc070cc86 tests: ls/stat-failed: don't discard stderr.
* tests/ls/stat-failed: Let stderr be recorded, to ease debugging.
2008-10-28 09:24:01 +01:00
Jim Meyering
b4ec994b26 tests: seq: check for today's extended long double fix
* tests/misc/seq-long-double: New file.  Test for today's bug fix.
* tests/check.mk (TESTS_ENVIRONMENT): Export CC definition.
* tests/Makefile.am (TESTS): Add misc/seq-long-double.
* NEWS (Bug fixes): Mention it.
2008-10-26 10:45:34 +01:00
Paul Eggert
2bf151cd93 seq: improve quality of format-checking code
* src/seq.c (validate_format): Remove. Migrate its checks into...
(long_double_format): Report an error and exit if an error is found,
instead of returning NULL.  All callers changed.
Use a more-consistent format for diagnostics.
* tests/misc/seq: Adjust to the more-consistent format for diagnostics.
2008-10-26 09:51:33 +01:00
Jim Meyering
153477479a factor: avoid compilation failure without libgmp
* src/factor.c (debug) [!HAVE_GMP]: Define.
Reported by Bob Proulx.
2008-10-25 22:57:42 +02:00
Paul Eggert
fec0e89c20 factor: remove --bignum and --no-bignum options
Here's a patch to remove the --bignum and --no-bignum options from
'factor'.  The case for removing --bignum isn't as strong as that for
'expr', but still, it seems to me that these options are not needed and
complicate the documentation unnecessarily.

* doc/coreutils.texi (factor invocation): Remove --bignum, --no-bignum.
* src/factor.c (algorithm, ALGORITHM_CHOICE, USE_BIGNUM, NO_USE_BIGNUM):
Remove; all uses removed.
(extract_factors_multi): Remove, replacing with....
(print_factors_multi): New function, with signature similar to that
of new signature of print_factors_single.
(print_factors_single): Migrate checking code to caller.
(print_factors): Use GMP if it's available; don't bother asking user.
Improve accuracy of check for "large" numbers.
(long_options, main): Remove support for --bignum.
2008-10-25 21:05:41 +02:00
Jim Meyering
407e8f0fdd tests: df/total: don't fail for an inaccessible mount point
* tests/df/total: Ignore nonzero exit status from df.
2008-10-25 16:30:54 +02:00
Paul Eggert
461231f022 seq: revert Solaris 8 work-around that caused x86 regression
* src/seq.c: Don't include <math.h>, <float.h>.
(abs_rel_diff): Remove.
(print_numbers): Test for equality, not for an epsilonish value.
This reverts 4827dd27b0, aka
v6.10-185-g4827dd2, which broke 'seq' on the x86; for example, it
causes "seq 9223372036854775807 9223372036854775808" to incorrectly
output 3 numbers instead of 2.  It's better to punish obsolescent
hosts that have incorrectly-working floating-point than to punish
correctly-working hosts.
* tests/misc/seq: Use 0.9000000000000, rather than
0.90000000000000000000, to avoid tickling a bug in Solaris 8 strtold,
which converts "0.9" and "0.9000000000000" correctly, but incorrectly
converts "0.90000000000000000000" to a smaller value.
2008-10-25 10:59:07 +02:00
Eric Blake
b705e9a9e7 group-list: avoid compiler warning
* src/group-list.c (print_group_list) [!HAVE_GETGROUPS]: Always
return value.
2008-10-24 11:44:48 -06:00
Jim Meyering
b3677e5e38 ls: use '.' (not +) as SELinux-only alt. access flag in ls -l output
* src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.',
any other nonempty combination of MAC and ACL to '+', and all else
to the usual ' '.  Suggested by Michael Stone.
* tests/misc/selinux: Adapt: expect '.', not '+'.
* doc/coreutils.texi (What information is listed): Document this.
* NEWS (Changes in behavior): Mention it.
2008-10-23 14:18:25 +02:00
Pádraig Brady
cc0f637b6d Remove lzma as a specific build requirement
* bootstrap.conf: lzma was added as a build requirement
in the recently added build tools requirements check.
Remove that as it's quite new and also only required
for the make dist stage.
2008-10-22 22:15:10 +01:00
Paul Eggert
7920f2c14a * src/ls.c (usage): Describe exit statuses more concisely. 2008-10-22 18:40:56 +02:00
Pádraig Brady
99f4994982 Add better checks and docs for build tools
Prompted by a report from Ed Avis:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14710>

* README-hacking: Organise LZMA and Valgrind as
as optional requirements rather than in their own sections.
Mention bootstrap will now check tool versions.
* README-prereq: Make a start on specific instructions
for optaining build tools. Currently we just have notes
for Fedora linux.
* bootstrap.conf: Add the list of tools and versions required.
* bootstrap: Add the logic to check for the required tools,
and list all required tools and versions if any are missing.
2008-10-22 16:31:57 +01:00
Jim Meyering
5afac2aee1 clean up gl/modules/selinux-at
* gl/modules/selinux-at:
Ensure that LIB_SELINUX is cleared, in case it's set in the environment.
m4-quote the first two args to AC_SEARCH_LIBS.
Don't violate autoconf's ac_ namespace: s/ac_save/gl_save/
Drop the useless double quotes around a simple assignment RHS.
2008-10-22 12:44:17 +02:00
Jim Meyering
aa67daf63b move selinux-h module from gl/ to gnulib
* gl/lib/se-context.in.h: Remove file.
* gl/lib/se-selinux.in.h: Likewise.
* gl/m4/selinux-context-h.m4: Likewise.
* gl/m4/selinux-selinux-h.m4: Likewise.
* gl/modules/selinux-h: Likewise.
2008-10-21 18:05:55 +02:00
Jim Meyering
f7a009c17c prepare to move selinux-h module to gnulib
* gl/modules/selinux-h (Makefile.am)
[selinux/selinux.h, selinux/context.h]:
Remove temporary file and target, in case they're read-only.
Use $(MKDIR_P), not mkdir -p.
(License): Relax to LGPLv2+.
Remove vestigial comments.
2008-10-21 15:58:11 +02:00
Jim Meyering
028e12ce3b tests: test today's ls-vs-capability fix
Test for this fix: f3f1ccfd87.
* tests/Makefile.am (TESTS): Add ls/no-cap.
* tests/ls/no-cap: New file.
2008-10-21 13:09:58 +02:00
Kamil Dudka
f3f1ccfd87 ls: make it possible to disable file capabilities checking
* ls.c (print_color_indicator): Do not check for file capability
if that attribute is not being colored.
Since 84f6abfe00, ls --color would check
each file for "capabilities".  In <http://bugzilla.redhat.com/467508>,
James Antill reported that ls --color seemed slower with capabilities
detection.
2008-10-21 11:13:01 +02:00
Jim Meyering
08c38ab7cb reflect gnulib's removal of lstat.h
* src/copy.h: Don't include "lstat.h".
* src/ls.c: Likewise.
* src/remove.c: Likewise.
* src/rm.c: Likewise.
2008-10-21 08:10:29 +02:00
Pádraig Brady
d60e33e241 expr: Fixup authors
* src/expr.c: Standardise the format of AUTHORS to
that used in other utils with multiple authors.
Also add Paul Eggert since he basically rewrote it
with his bignum fixes.
* AUTHORS (expr): Add Paul Eggert.
2008-10-20 15:40:50 +01:00
Jim Meyering
31a884dab7 accommodate gnulib header removals
* src/copy.c: Don't include "euidaccess.h" or "lchmod.h".
* src/cp.c: Don't include "lchmod.h".
* src/ls.c: Don't include "dirfd.h".
* src/mkdir.c: Don't include "lchmod.h".
* src/pwd.c: Don't include "dirfd.h".
* src/remove.c: Don't include "dirfd.h" or "euidaccess.h".
* src/test.c: Don't include "euidaccess.h".
* gl/modules/getloadavg.diff: Adjust diff for changed context.
* src/uptime.c (uptime): Remove declaration.
2008-10-19 14:15:31 +02:00
Jim Meyering
74443830ea * maint.mk (coreutils-path-check): New definition, now run
only if src/true.c exists.  Factored out of...
(my-distcheck):  ...here.
2008-10-18 12:55:04 +02:00
Jim Meyering
2ae61facc7 maint: avoid warning in ls.c
* src/ls.c (has_capability) [!HAVE_CAP]: Add unused attribute.
2008-10-17 08:55:12 +02:00
Jim Meyering
bb7fa1e932 maint: avoid warnings due to attribute warn_unused_result
Now that a (void) cast no longer suffices to ignore warnings from gcc
about uses of functions marked with the warn_unused_result attribute,
we need an alternative.  For the record, here's one of the ignorable
warnings: "copy.c:233: warning: ignoring return value of 'fchown',
declared with attribute warn_unused_result"
* bootstrap.conf (gnulib_modules): Import ignore-value.
* src/copy.c: Include "ignore-value.h".
(set_owner): Use ignore_value in place of "(void)" casts,
to ignore lchown and fchown failures.
* src/cp.c (re_protect): Likewise, to ignore lchown failure.
* src/remove.c (preprocess_dir): Remove unnecessary "(void)" cast.
2008-10-17 07:06:54 +02:00
Jim Meyering
16c8062085 mktemp: diagnose freopen failure
* src/mktemp [--quiet]: Don't ignore freopen failure.
2008-10-16 23:00:22 +02:00
Paul Eggert
17278118ee * src/mktemp.c (main): Add 'const' twice to avoid GCC warning. 2008-10-16 22:27:08 +02:00
Jim Meyering
7f6fb43e7d build: when po-check fails, say why and suggest a fix
* maint.mk (po-check): Before, when this check failed, it just
spat out a diff mentioning two temporary files.  Now, it tells
you what's wrong and suggests a fix with a patch using the name
of the affected file (rather than temporary file names) in the
diff output.
2008-10-16 14:25:53 +02:00
Eric Blake
ddc409b59e csplit: prefer sigaction over signal
* bootstrap.conf (gnulib_modules): Import sigaction.
* src/csplit.c (sigprocmask, siginterrupt) [SA_NOCLDSTOP]: Delete
workarounds.
(interrupt_handler, main): Drop use of signal.  Rely on sigaction
to block fatal signal during cleanup, and to restore it to default
in case of nested signals.
2008-10-16 06:20:50 -06:00
Pádraig Brady
7eb3aab88b tests: add option processing tests for 'expr'
* tests/misc/expr: Add tests for various combinations
of options where the first part of the expression
could be confused with an option.
2008-10-15 16:32:05 +02:00
Paul Eggert
4fb3704c25 expr: remove --bignum and --no-bignum options
* doc/coreutils.texi (expr invocation): Remove the --bignum and
--no-bignum options.  They weren't really needed, and they broke
longstanding (albeit nonportable) scripts.
* src/expr.c: Don't include <assert.h>.  Include "inttostr.h",
"long-options.h", "verify.h".  Check at compile-time that
size_t fits in unsigned long int, as the code assumes this in
several places.
(HAVE_GMP): Define to 0 if not defined, for convenience.
(mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add):
(mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn):
(mpz_fits_ulong_p, mpz_get_ui, mpz_out_str):
Supply substitutes when !HAVE_GMP, which work well enough for
expr's purposes.
(mp_integer): Remove.  All integers are gmp, if gmp is available.
(struct valinfo): Remove 'z' member; no longer needed.  The 'i'
member is always of type mpz_t.
(enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode):
Remove; no longer needed.
(usage): Remove documentation of --bignum and --no-bignum.
(integer_overflow): Abort if error misbehaves, to pacify GCC.
Restore old message on arithmetic overflow, to be conservative.
(die): Omit exit_status parameter; not needed (is always EXPR_FAILURE).
(string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options):
Remove; no longer needed.
(main): Don't use getopt_long; this breaks old nonportable scripts.
(int_value): Arg is unsigned, in case we have strings whose length
exceeds LONG_MAX (!).
(int_value, freev, printv, null, tostring, toarith):
(eval6, eval4, eval3):
Always use mpz_ functions, to simplify the code.
(substr_value): Remove; no longer needed.
(getsize): Simplify the API: one arg rather than 3.  Don't assume
unsigned long int fits in size_t.
(promote, domult, dodivide, doadd): Remove; no longer needed.
* tests/misc/expr: Don't use --bignum to test for bignum support.
Instead, use big numbers to test this.
2008-10-15 16:30:28 +02:00
Jim Meyering
514b7fbc00 expr: don't interpret argv[0] as an operand
* src/expr.c (main): Given a first argument like -22 (negative, with
two or more digits), expr would decrement optind to 0 and then attempt
to evaluate argv[0].
2008-10-15 15:34:58 +02:00
Jim Meyering
555c219d9e doc: cp, mv: remove mention of deprecated --reply= option
* doc/coreutils.texi (cp invocation, mv invocation): Don't mention it.
2008-10-15 15:08:58 +02:00
Jim Meyering
59964c164b doc: adjust spacing in ls --help output, for better man formatting
* src/ls.c (usage): Adjust spacing so the "Exit status:" list
renders well in the help2man-generated man page.
2008-10-13 21:08:07 +02:00
Ondřej Vašík
7377f49ea8 doc: ls: clarify exit status description
* src/ls.c (exit_status): Clarify comments.
(usage): Clarify exit status description in --help output.
* doc/coreutils.texi (ls invocation): Clarify exit status documentation
Reported by Greg Metcalfe in <http://bugzilla.redhat.com/446294>.
2008-10-13 09:01:54 +02:00
Jim Meyering
969841cb77 doc: reorder tsort/ptx nodes so body and menu ordering are consistent
* doc/coreutils.texi (tsort invocation, tsort background): Move these
nodes "down", so that they follow the ptx nodes, thus matching the
alphabetized order in the menu.
(tsort background): Make this a subsection.
Suggested by Karl Berry.
2008-10-12 19:53:20 +02:00
Jim Meyering
c3e1fe230b tests: move check-misc targets from src/Makefile.am to maint.mk
* src/Makefile.am (check): Remove check-misc.
(check-misc): Remove target.
* maint.mk (sc_prohibit_stat_st_blocks): New target.
(sc_prohibit_S_IS_definition): New target.
* Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_stat_st_blocks.
* .x-sc_prohibit_stat_st_blocks: New file.
Andreas Schwab reported that "make check" could fail to detect
violation of the no-S_IS*-definition policy.
2008-10-12 11:21:19 +02:00
Jim Meyering
1833a876ae tests: df: avoid test failure when using mawk
* tests/df/total-awk: Rewrite to use $PERL, not $AWK.
mawk can't even count above 2^31.  Reported by Ed Avis.
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14792/focus=14802
* tests/df/total-verify: Rename from total-awk.
* tests/Makefile.am (TESTS): Reflect renaming.
2008-10-12 11:11:38 +02:00
Jim Meyering
0f5695bd59 bootstrap: merge from gnulib 2008-10-10 09:13:58 +02:00
Ondřej Vašík
42df6d7de2 doc: document runcon and chcon in SELinux context section
* doc/coreutils.texi: Document runcon and chcon.
Add minimal SELinux context section.
2008-10-07 23:43:27 +02:00
Ondřej Vašík
9c0c57a1b4 chcon: remove traces of unimplemented --change (-c) option
This option was never supported in upstream coreutils.
* chcon.c (usage): Remove --change (-c) from help message.
(main): Remove 'c' from getopt string.
Remove related and now-unused enums.
2008-10-06 22:53:04 +02:00
Andreas Dilger
a36f4cb451 stat: add lustre filesystem type
* src/stat.c (human_fstype) [S_MAGIC_LUSTRE]: Add case.
Make "stat -f" recognize the "Lustre" filesystem type.
<http://en.wikipedia.org/wiki/Lustre_(file_system)>
* NEWS: Mention this feature.
2008-10-06 22:35:57 +02:00
Jim Meyering
ed0a1c9f94 remove.c: avoid compile failure on OS/2
* src/remove.c (dirent_inode_sort_may_be_useful): Guard also with
"#if defined __linux__".  Reported by Elbert Pol.
2008-10-06 07:31:50 +02:00
Jim Meyering
f9da2d0e87 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2008-10-05 21:27:05 +02:00
Jim Meyering
42285406aa version 7.0
* NEWS: Record release date.
2008-10-05 20:40:19 +02:00
Jim Meyering
5149348906 * maint.mk (alpha beta major): Add "-a" to git commit ... command. 2008-10-05 20:31:35 +02:00
Jim Meyering
fbc5aa7c47 tests: fix the install/strip-program test
* tests/install/strip-program: Use $PREFERABLY_POSIX_SHELL,
not POSIX_SHELL.  The latter may be empty, and would fail
on OpenBSD 3.9.
* tests/check.mk (TESTS_ENVIRONMENT): Propagate
PREFERABLY_POSIX_SHELL to tests.
2008-10-04 17:12:08 +02:00
Jim Meyering
15f4d612df timeout.c: don't use perror; exit 125 upon failed fork
* src/timeout.c (main): Use "error", not perror.
Elbert Pol noticed a build failure on OS/2.
* src/timeout.c (main): Exit 125 (not errno) upon failed fork.
Make the failed fork diagnostic match the one from install.c.
2008-10-03 18:39:31 +02:00
Kamil Dudka
e505736f82 ls and sort: use filevercmp instead of strverscmp
* src/ls.c (cmp_version): Use filevercmp instead of strverscmp.
* src/sort.c (usage): Remove mna reference to strverscmp(3).
(compare_version): Use filevercmp instead of strverscmp.
* bootstrap.conf: Add filevercmp to list of gnulib modules.
* tests/misc/sort-version: Remove conflicting string and enhance test.
* NEWS: Mention the change.
2008-10-03 11:59:17 +02:00
Jim Meyering
7eb15e1020 tests: skip a root-only test when configured without libcap
* tests/ls/capability: Test for HAVE_CAP definition in config.h.
2008-10-02 15:54:36 +02:00
Eric Blake
ef13885b37 ignore additional built file 2008-10-02 13:18:00 +02:00
Eric Blake
0628b73f35 remove.c: allow compilation on cygwin
* src/remove.c (dirent_inode_sort_may_be_useful)
[!HAVE_STRUCT_DIRENT_D_TYPE]: Elide definition when there is no point
in trying to use it.
2008-10-02 13:17:48 +02:00
Jim Meyering
dafbd407bc bootstrap: merge from gnulib
* bootstrap: add submodule support, git-merge-changelog
2008-10-02 13:16:47 +02:00
Jim Meyering
94c59c97f9 remove.c: combine two helper functions, to avoid sign-extension
* src/remove.c (fs_handles_readdir_ordered_dirents_efficiently):
Remove function, so as not to have to worry about the type of
statfs.f_type and sign extension.
(dirent_inode_sort_may_be_useful): Adjust comment.
Perform the switch directly on the struct.member here, instead.
Andreas Schwab spotted the potential for a sign-extension bug,
that happens not to bite for the S_* f_type values currently used.
2008-10-01 12:27:10 +02:00
Jim Meyering
ab02e256e9 rm: don't preprocess a directory on a file system of type tmpfs or nfs
The preprocessing phase is not necessary on tmpfs, and induces
a 20% performance decrease when removing a 2M-entry directory.
* src/remove.c (fs_handles_readdir_ordered_dirents_efficiently):
(dirent_inode_sort_may_be_useful): New functions from gnulib/fts.c.
They'll probably become a gnulib module -- eventually.
(preprocess_dir): Use dirent_inode_sort_may_be_useful.
2008-10-01 09:00:52 +02:00
Jim Meyering
0eff09dfcf tests: use our new timeout program
* tests/rm/ext3-perf: Also, record set-up duration and FS type.
2008-10-01 08:45:26 +02:00
Ralf Wildenhues
0482f193b5 fix make variable quotation error
* tests/check.mk (TESTS_ENVIRONMENT): Quote shell variable
$tmp__, fix expansion.
2008-09-29 22:49:08 +02:00
Jim Meyering
cfe3602ad6 seq: solve e13188e7ef more cleanly
* src/seq.c (print_numbers): Don't switch c_strtold -> strtold
in order to accommodate the locale-dependent behavior of our internal
asprintf use.  Instead, simply set the locale to C before calling
asprintf, and then set it back afterwards.
2008-09-29 15:28:03 +02:00
Jim Meyering
cee53c1430 build: avoid spurious valgrind warning about uses of touch
* .vg-suppressions (utimensat-NULL): Avoid bogus valgrind warning
that appears on at least Fedora 9.
2008-09-28 23:02:41 +02:00
Jim Meyering
0643c51cab mktemp: plug an inconsequential leak
* src/mktemp.c (main) [lint]: Free template.
2008-09-28 23:02:40 +02:00
Jim Meyering
b616886492 THANKS: add Erik Auerswald 2008-09-28 23:02:15 +02:00
Eric Blake
58aaf71f07 remove.c: avoid compiler warning
* src/remove.c (compare_ino, dirent_count)
[!HAVE_STRUCT_DIRENT_D_TYPE]: Mask declaration when unused.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-09-27 18:14:07 -06:00
Jim Meyering
24412edeaf rm -r: avoid O(n^2) performance for a directory with very many entries
This enhancement works around a problem that is specific to at least
ext3 and ext4 file systems.  With them, it would take hours to remove
a two-million-entry directory.  RAM-backed file systems (tmpfs) are
not affected, since there is no seek penalty.
* remove.c (rm_malloc, rm_free, compare_ino): New functions.
(dirent_count, preprocess_dir): New function.
[struct readdir_data]: New struct.
(remove_cwd_entries): Call preprocess_dir.
* tests/rm/ext3-perf: New file.  Test for the performance fix.
* NEWS: mention the new feature
2008-09-27 00:10:08 +02:00
Jim Meyering
a5111af33e remove.c: don't use xmalloc; don't let obstack call exit on failure
(obstack_chunk_alloc, obstack_chunk_free): Don't define.
(top_dir): Param is no longer "const".
Use malloc, not xmalloc, and call longjmp upon failed malloc.
(obstack_init_minimal): New function.
(ds_init): Don't use xmalloc.  Instead, use caller-supplied buffer.
Use obstack_specify_allocation_with_arg, not obstack_init, so
that we control what happens upon allocation failure.
Arrange for ds_free not to free uninitialized if/when
any obstack_specify_allocation_with_arg allocation fails.
(ds_free): Don't free DS, now that it's no longer malloc'd.
(rm): Allocate DS on the stack.
Arrange to handle ds_init allocation failure.

step1
2008-09-27 00:10:08 +02:00
Jim Meyering
1e3ebd660a * maint.mk (my-distcheck): remove duplicate c99-related test code 2008-09-27 00:10:08 +02:00
Jim Meyering
2f706199d0 maint: allow more C99 constructs; stop maintaining c99-to-c89 patch set
* cfg.mk (local-checks-to-skip): Add patch-check.
With the recent changes to remove.c, I no longer wish
to maintain the c99-to-c89 patch set.
2008-09-27 00:08:39 +02:00
Jim Meyering
e13188e7ef seq -0.1 0.1 2: print final number when locale's decimal point is ","
* src/seq.c (print_numbers): Use strtold, not c_strtold to convert
from just-formatted-using-asprintf string back to double, since
asprintf may have used something other than "." as the decimal point.
Reported by lsof@nodata.co.uk as <http://bugzilla.redhat.com/463556>.
Thanks to Ondřej Vašík for discovering that the bug was locale-related.

    $ LC_ALL=cs_CZ.UTF-8 seq -0.1 0.1 2|grep 2.0
    [Exit 1]
    $ seq -0.1 0.1 2|grep 2.0
    2.0

* tests/check.mk (TESTS_ENVIRONMENT): Add LOCALE_FR_UTF8, for...
* tests/misc/seq [locale-dec-pt]: New test for the above.
* NEWS (bug fix): Mention it.
2008-09-26 23:31:30 +02:00
Jim Meyering
2a4dcb627e maint: relax a check so "make distcheck" succeeds again
* maint.mk (makefile-check): Relax the check, in order to exempt
the necessary use of a sole @...@-delimited Makefile.am variable.
2008-09-26 23:21:25 +02:00
Jim Meyering
13a2025998 maint: avoid using find -name Makefile.am; could get false positives
* maint.mk (makefile-check): Instead, search for the offending
@...@ construct only in version-controlled files.
2008-09-24 16:25:02 +02:00
Benno Schulenberg
9a33347007 pinky: gettextize two missed strings
Additionally differentiate the strings for unknown idle time and
unknown real name so they can be translated differently.
2008-09-24 08:05:07 +02:00
Jim Meyering
e916c8ff05 cp.c: adjust a comment to make it consistent with documentation
'-a' is equivalent to -dpR, so s/-dpPR/-dpR/;  the -P is redundant,
since -d already implies -P, and both --help and "info cp" say -dpR:
Corresponding doc changes: 080ac77850
b7c2db6766.
2008-09-24 07:24:47 +02:00
Ralf Wildenhues
beaee48f26 fix installation with ./ginstall in src
* src/Makefile.am (cu_install_program): New variable, set to
either ./ginstall or @INSTALL_PROGRAM@ (for cross compilation).
(INSTALL_PROGRAM): Override AC_SUBST unconditionally, to avoid
warning, and wrong initialization order.
2008-09-22 22:42:20 +02:00
Benno Schulenberg
2643b4b77d doc: alphabetize 'who's option descriptions
* doc/coreutils.texi (who invocation): Alphabetize.
2008-09-22 10:00:20 +02:00
Benno Schulenberg
8c4a656fad who --help: add a general description 2008-09-19 12:27:37 +02:00
Benno Schulenberg
fec05eb377 uptime --help: put together message parts that belong together 2008-09-19 12:27:37 +02:00
Benno Schulenberg
6d5bf36d5c tr --help: gettextize a single paragraph as a single string
Breaking a paragraph into several strings is awkward for translators.
2008-09-19 12:27:37 +02:00
Benno Schulenberg
be11df4916 tail: gettextize the string, "standard input" 2008-09-19 12:27:37 +02:00
Benno Schulenberg
2f776f3096 tail --help: move the --retry entry into alphabetical order
* src/tail.c (usage): Also simplify --retry description, split a
long string in two, remove a stray period, and add the usual indent.
2008-09-19 12:27:37 +02:00
Benno Schulenberg
13edec7c62 shred --help: lowercase a stray capital 2008-09-19 12:27:37 +02:00
Benno Schulenberg
57622cac71 stty --help: correct the alignment of an entry
* src/stty.c (usage): Also remove a stray period, and ungettextize
a debugging message.
2008-09-19 12:27:37 +02:00
Benno Schulenberg
3b39aa796f sort --help: sort the options better alphabetically
Take the opportunity to split the long message into three parts.
2008-09-19 12:27:37 +02:00
Benno Schulenberg
a7ea04404c rmdir --help: use lower case in option description; adjust indentation 2008-09-19 12:27:37 +02:00
Benno Schulenberg
e34eb51728 remove.c: move comment to right before string, so gettext will pick it up 2008-09-19 12:27:36 +02:00
Benno Schulenberg
771484f47a pr --help: elide arguments after short options that allow a space
* src/pr.c (usage): Also, put the -S option with its description.
2008-09-19 12:27:36 +02:00
Benno Schulenberg
c7c961a3e5 od: ungettextize debugging messages 2008-09-19 12:27:36 +02:00
Benno Schulenberg
4718a2fdf4 nohup, remove, tr: also gettextize the alternative messages 2008-09-19 12:27:36 +02:00
Benno Schulenberg
2298544c64 od --help: avoid concatening two messages without a newline
src/od.c (usage): Better: make them into two separate paragraphs.
2008-09-19 12:27:36 +02:00
Benno Schulenberg
18efee4e2a mkfifo, mknod --help: put -Z option in its alphabetical position
Options are normally sorted by their short form, not their long form.
Also line up their descriptions.
2008-09-19 12:27:36 +02:00
Jim Meyering
f923ceceba doc: coreutils.texi (csplit invocation): Add an example. 2008-09-19 09:27:43 +02:00
Ralf Wildenhues
e10e4b6697 various VPATH-related fixes
* maint.mk (VC_LIST): Prepend '$(srcdir)/'.
(patch-check): Fix to make it work with a VPATH build.
* src/Makefile.am (sc_tight_scope): Likewise.
* man/Makefile.am (.x.1): Do not make outputs unwritable.
2008-09-14 17:42:48 +02:00
Jim Meyering
cddcb5d468 stat: remove obsolete and undocumented option, --filesystem
* src/stat.c: Remove obsolete and undocumented --filesystem.
2008-09-14 09:38:59 +02:00
Jim Meyering
3e8f9c8d35 tests: reenable disabled test, now that automake can handle it
This reverts the change in ae1c205fc4.
2008-09-13 15:08:16 +02:00
Jim Meyering
ae1c205fc4 tests: temporarily disable part of "make distcheck"
* maint.mk (install-transform-check): Temporarily disable.
2008-09-11 22:37:39 +02:00
Jim Meyering
2221ea2c3a tweak wording and check to avoid failure
* doc/coreutils.texi (printf invocation): Tweak wording.
* doc/Makefile.am (check-texinfo): Allow "search path".
2008-09-11 18:14:00 +02:00
Jim Meyering
a06afbeec5 doc: mention which commands may be built-in functions
* doc/coreutils.texi (mayConflictWithShellBuiltIn): New macro.
(mknod invocation, stat invocation, echo invocation)
(printf invocation, test invocation, pwd invocation)
(nice invocation, kill invocation, sleep invocation): Use it.
(printf invocation): Invoke via "env" rather than using a
literal /usr/local/bin/ prefix in examples.
2008-09-10 13:20:27 +02:00
Ralf Wildenhues
d9903062cf simplify installation rules, using new Automake
This relies on development Automake to provide multi-file
installation, and avoids relying on undocumented Automake
interfaces.  It also removes special-casing for `['.
* configure.ac (AM_INIT_AUTOMAKE): Depend on 1.10a.
(CROSS_COMPILING): New Automake conditional.
* src/Makefile.am (install-exec-am, filtered_PROGS)
(d_bindir, cu-install-binPROGRAMS): Remove.
(INSTALL_PROGRAM) [!CROSS_COMPILING]: Set to `./ginstall'.
2008-09-10 13:20:27 +02:00
Ralf Wildenhues
9dcebc51be fix minor shell issues in test suite
* tests/misc/help-version: Fix bad quoting.
* tests/cp/same-file: Fix unportable shell quoting.
* tests/mv/part-symlink: Likewise.
2008-09-10 13:20:27 +02:00
Jim Meyering
1084bf78ea tests: don't use "local" in bourne shell scripts
* tests/test-lib.sh (remove_tmp_, skip_if_mcstransd_is_running_):
Avoid failure on Solaris 11, since their /bin/sh passes the tests
in posix-shell.m4, yet does not support "local" (which is not POSIX).
2008-09-10 13:20:27 +02:00
Jim Meyering
68561594ca tests: use "Exit $fail", not (exit $fail); exit $fail
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63
* tests/**: Convert all uses:

This restrictive change converted the vast majority:

  git grep -l '^(exit \$fail); exit \$fail$' \
    | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/'

And this did the rest, plus a few undesirable ones, so I manually
backed out the changes to ChangeLog-* and build-aux/check.mk:

  git grep -l -E '\(exit [^)]+\); exit ' \
    | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
2008-09-10 13:20:10 +02:00
Jim Meyering
22e5102f19 tests: move input-tty into a test-lib.sh function
* tests/test-lib.sh (require_controlling_input_terminal_): New function, from
* tests/input-tty: ...here.  Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove input-tty.
* tests/mv/i-3: Use the function, not the file.
* tests/misc/stty: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/stty-invalid: Likewise.
2008-09-08 08:20:03 +02:00
Jim Meyering
e4fa3e7808 tests: work around Solaris 11 bug
* tests/misc/printf-surprise: Accept bogus prefix on stderr output.
2008-09-07 20:50:49 +02:00
Jim Meyering
737461d23f tests: don't let rounding-to-1KB blocks provoke a failure
* tests/df/total-awk: Use df's --block-size=512 option.
2008-09-07 20:49:34 +02:00
Jim Meyering
6b22726dd4 tests: don't fail due to built-in sleep from Solaris 11's /bin/sh
* tests/misc/help-version (id_args): Invoke via env to ensure we
run the just-built version of sleep.
2008-09-07 19:16:42 +02:00
Kamil Dudka
54281e9c60 install: new option: --strip-program,
...to specify the program used to strip binaries
* src/install.c (main): Handle new option --strip-program.
(strip): Use strip program from global variable strip_program.
(usage): Mention new option --strip-program in --help.
* tests/tests/strip-program: Test case for new option --strip-program.
* tests/Makefile.am: Add new test case to test set.
* doc/coreutils.texi: Mention new option --strip-program.
* NEWS: Mention the change.
* TODO: Remove completed task.
2008-09-06 13:38:20 +02:00
Kamil Dudka
ea2887bbe4 df: new option: --total to print grand totals
* src/df.c (add_uint_with_neg_flag): New function to add two integral
values with separate negation flag.
(show_dev): New parameter force_fsu to display numbers directly. Collect
summary statistics on each printed device.
(usage): Mention new option --total in --help.
(main): Initialize summary on program start. Handle new option --total.
* tests/df/total: Dummy test case for new --total option.
* tests/df/total-awk: Better test case for new --total option (requires
awk).
* doc/coreutils.texi: Mention new parameter --total.
* NEWS: Mention the change.
* TODO: Removed completed task.
2008-09-03 15:39:28 +02:00
Jim Meyering
ef6a361a07 TODO: add an item for a chmod optimization 2008-09-03 09:11:05 +02:00
Jerry Snitselaar
63a7120c28 env, groups: remove duplicate inclusion of <getopt.h>
* src/env.c: Remove redundant #include.
* src/groups.c: Likewise.
Tiny change.
2008-08-31 15:58:27 +02:00
Jim Meyering
5bf3e7ee96 generate version.c and version.h
* src/Makefile.am (version.c, version.h): New rules.  Generate.
(nodist_libver_a_SOURCES): Define
* .gitignore: Add src/version.c and src/version.h.
(DISTCLEANFILES): Add version.c and version.h.
2008-08-26 18:45:06 +02:00
Jim Meyering
0c1fc1c715 use new global, "Version", rather than macro, VERSION
With this change, a version-string update no longer
forces recompilation of 100+ src/*.o files.
* src/version.c (Version): New global.  New file.
* src/version.h: Declare it.
* src/Makefile.am: Put it in a library that everyone links to.
(noinst_LIBRARIES, libver_a_SOURCES): Define.
(LDADD): Add libver.a.
(sc_tight_scope): Use perl (was sed), and a more relaxed regexp
to build the global-variable-name-recognizing regexp list.
* src/system.h: Include "version.h".
(case_GETOPT_VERSION_CHAR): Use Version rather than VERSION.
* src/basename.c (main): Use Version rather than VERSION.
* src/chroot.c (main): Likewise.
* src/cksum.c (main): Likewise.
* src/dd.c (main): Likewise.
* src/dirname.c (main): Likewise.
* src/echo.c (main): Likewise.
* src/hostid.c (main): Likewise.
* src/hostname.c (main): Likewise.
* src/link.c (main): Likewise.
* src/logname.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/nohup.c (main): Likewise.
* src/printenv.c (main): Likewise.
* src/printf.c (main): Likewise.
* src/pwd.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/sleep.c (main): Likewise.
* src/sync.c (main): Likewise.
* src/test.c (main): Likewise.
* src/timeout.c (main): Likewise.
* src/true.c (main): Likewise.
* src/tsort.c (main): Likewise.
* src/unlink.c (main): Likewise.
* src/uptime.c (main): Likewise.
* src/users.c (main): Likewise.
* src/whoami.c (main): Likewise.
* src/yes.c (main): Likewise.
2008-08-26 18:45:06 +02:00
Jim Meyering
f03a67735a bootstrap: preserve permissions of more copied files
* bootstrap (cp_mark_as_generated): Preserve perms of copied files.
Remove a kludge, now that this is fixed.
2008-08-26 18:43:52 +02:00
Bruno Haible
f325d180cf doc: clarify wc -L documentation
* doc/coreutils.texi (wc invocation): Explain what the -L option
measures.
2008-08-23 15:52:02 +02:00
Eric Blake
bfe4a55520 ls: adjust to gnulib change
* src/ls.c (includes): "strverscmp.h" no longer exists.
2008-08-20 12:43:27 +02:00
Eric Blake
8ea96a5c90 .gitignore: ignore more files
* .gitignore: Ignore directories created by gnulib.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-19 18:38:24 +02:00
Eric Blake
f3574102d3 .gitattributes: generalize
* .gitattributes: Relax the glob pattern, so it matches *.texinfo, too.
Suggest a POSIX BRE, rather than one that uses the GNU extension, \\+.
2008-08-19 08:56:29 +02:00
Eric Blake
edd292f8d4 sort: improve usage wording
* src/sort.c (usage): Mention that -k defaults to end of line if
POS2 omitted.
* THANKS: Update.
Reported by Tim Ryan.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-18 21:52:04 -06:00
Jim Meyering
929479026b adjust 2008-08-15 10:18:51 +02:00
Bruce Korb
4c9fae4e97 sort: new option, --sort=version, for version number ordering
* src/sort.c [struct keyfield] (version): New member.
(usage): Describe --version-sort.
(sort_options): Add 'V'.
(long_options): Add "version-sort".
(CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros.
(check_args, sort_args, sort_types): Use these new macros in declarations.
(ARGMATCH_VERIFY): Remove use.  No longer needed.
(compare_version): New function.
(key_compare): Add a case.
(check_ordering_compatibility): Handle new type.
(main): Likewise.  Reformat two expressions for readability.
* tests/misc/sort-version: new test file
* tests/Makefile.am: add it to the list
* doc/coreutils.texi (sort invocation): Document it.
* NEWS: Mention the new feature.
2008-08-15 09:52:06 +02:00
Jim Meyering
a01c4720d6 set envvars via "env" to avoid spurious set -x output from bad shells
* tests/dd/misc: Set LC_ALL=C via env.
* tests/cp/thru-dangling: Set POSIXLY_CORRECT via env.
This is necessary at least on AIX 5.3.
Reported by Jeph Cowan and Ralf Wildenhues.  Details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257
2008-08-14 23:08:03 +02:00
Jim Meyering
081ebb2822 "expr --bignum 1" now fails when expr is built without libgmp
* src/expr.c (main): When --bignum is requested, yet expr was built
without libgmp, exit nonzero (3) in addition to giving a diagnostic.
2008-08-14 14:37:49 +02:00
Jim Meyering
22999697b8 mktemp, sort, tac: don't use undefined after mkstemp failure
When mkstemp fails, the template buffer may have undefined
contents, so we must not print it.
* src/sort.c (create_temp_file): Use temp_dir, not "file"
when diagnosing failed mkstemp, because "file" may be undefined.
* tests/misc/sort-merge: Adjust for new expected output.
Jeph Cowan and Ralf Wildenhues reported the test failure:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14235/focus=14257
* src/tac.c (copy_to_temp): Don't use template buffer after
failed mkstemp call, since its contents may be undefined.
* tests/misc/tac (pipe-bad-tmpdir): New test for the above.
* src/mktemp.c (main): Save a copy of the template string,
solely for use in case mkstemp fails.
* tests/misc/mktemp (pipe-bad-tmpdir): New test for the above.
2008-08-14 14:37:37 +02:00
Benno Schulenberg
7e0019b168 kill: micro grammar nit in description of SIGNAL 2008-08-12 20:41:25 +02:00
Benno Schulenberg
64c25ed741 groups: let synopsis show that the command allows multiple usernames
Also make the docstring say so.
2008-08-12 20:41:25 +02:00
Benno Schulenberg
d9c0881137 id: remove superfluous condition test; it is caught at -Z above 2008-08-12 20:41:25 +02:00
Benno Schulenberg
4290abda87 id: gettextize a few missed tiny strings 2008-08-12 20:41:25 +02:00
Benno Schulenberg
5a74a2d566 fmt: remove the 'no file' sentence; the standard phrase is given below
Replace the sentence with a more useful explanation of -DIGITS.
2008-08-12 20:38:37 +02:00
Benno Schulenberg
7ee3d2430a echo: correct description of \c
* src/echo.c (usage): Correct description of \c.
* coreutils.texi (echo invocation): Likewise.
* src/echo.c: Remove --help-duplicating comment.
2008-08-11 10:09:56 +02:00
Benno Schulenberg
f0f6e14610 doc: the quote operator for expr is '+', not 'quote' 2008-08-11 09:47:01 +02:00
Benno Schulenberg
e4fd2bf4e6 factor: remove duplicate docstring; use the more detailed one 2008-08-11 09:47:01 +02:00
Benno Schulenberg
18e2a330b9 echo: gettextize the alternative option description too 2008-08-11 09:47:01 +02:00
Benno Schulenberg
4ebf956b4e dd: clarify meaning of multiplication factors; put xM in order 2008-08-11 09:47:01 +02:00
Benno Schulenberg
0392142b87 doc: remove stray word from date's field width description 2008-08-11 09:47:01 +02:00
Benno Schulenberg
127c689f64 date: remove confusing and unneeded sentence from --help
It makes it unclear what 'sequences' refers to,
and the -u option already says enough.
2008-08-11 09:47:01 +02:00
Benno Schulenberg
baad54258d printenv: say what it does when variables are specified 2008-08-11 09:47:01 +02:00
Benno Schulenberg
d3ad58376d doc: put the exitstatus paragraph in a better place
* doc/coreutils.texi (tsort invocation): move two lines
2008-08-11 09:47:01 +02:00
Benno Schulenberg
a1cb30c1fb cp: move a newline to make second message identical to others 2008-08-11 09:47:00 +02:00
Benno Schulenberg
d7e2f425e7 who: Gettextize two forgotten strings 2008-08-11 09:47:00 +02:00
Jim Meyering
4b5e044be3 sort: remove unnecessary declaration of strtod
* src/sort.c (STDC_HEADERS): Remove declaration of strtod.
2008-08-10 16:49:59 +02:00
Jim Meyering
43f66923cc sort: avoid erroneous cast
* src/sort.c (OPEN_MAX): Define if not already defined.
(MAX_NMERGE): Remove definition.
(specify_nmerge): Don't cast MAX_NMERGE (of type size_t) to unsigned int.
Instead, use OPEN_MAX as the fall-back value.
2008-08-10 16:49:40 +02:00
Jim Meyering
cd1f4bc1ec sort: don't print uninitialized in diagnostic
* src/sort.c (specify_nmerge): Do use uinttostr value.
Provoke with e.g., sort -m --batch-size=18446744073709551617
Omit quotes around known-numeric value in diagnostic.
* tests/misc/sort-merge [nmerge-big]: Tighten ERR_SUBST regexp
to require a numeric value in that diagnostic, so this particular
failure cannot reappear.
2008-08-10 16:48:55 +02:00
Jim Meyering
b673a5b8ac * .gitattributes: Better diff output for texinfo sources. 2008-08-09 16:56:01 +02:00
Jim Meyering
2a2d3f237b dd.c: reduce duplication in new O_FULLBLOCK-defining code
* src/dd.c (MULTIPLE_BITS_SET): New macro, extracted from...
(multiple_bits_set): ...this function.
Use a single-line, and far simpler expression (no need to list all
O_* symbols again) to validate the derived O_FULLBLOCK value.
2008-08-09 16:56:01 +02:00
Jim Meyering
0d279d2378 * coreutils.texi (factor invocation, expr invocation): Adjust wording. 2008-08-09 16:56:01 +02:00
Jim Meyering
c339cff4a6 expr: avoid compiler warnings
* src/expr.c (die): New "noreturn" function to wrap one-arg use of
error
(string_too_long): Use die rather than error.
(toint): Remove definition of now-unused function.
(eval6): Remove a little duplication.
Use die rather than error.
(dodivide): Remove declaration of now-unused variable.
2008-08-09 16:56:01 +02:00
Jim Meyering
ae5ae5e117 * tests/misc/expr: Add tests of the new GMP-based code. 2008-08-09 16:55:45 +02:00
James Youngman
f65cafd67b expr: support arbitrary-precision arithmetic
* src/Makefile.am (expr_LDADD): Link expr against GNU MP.
* doc/coreutils.texi (expr invocation): Describe --bignum,
--no-bignum.   Explain the new arbitrary-precision functionality.
* NEWS: Indicate that arbitrary-precision arithmetic is now
supported in expr.
* src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP
number.
(usage): Document the new options --bignum and --no-bignum which
force and prohibit the use of arbitrary-precision arithmetic,
respectively.
(long_options): data structure for getopt_long, which we need to
use to parse the options mentioned above.
(main): parse these options with getopt_long instead of
parse_long_options.
(valinfo): Downgrade the numeric member of the union from
intmax_t to signed long, since MP lacks functions for promoting an
intmax_t to an arbitrary-precision quantity.
(enum arithmetic_mode): Represents the current choice between
--bignum, --no-bignum and the default (automatically switch from
one to the other if needed).
(integer_overflow): issue a more explicit error message indicating
that MP is not available.
(string_too_long): new function, emits a fatal error message for
the case where an argument to the 'index' expression is too long
for a string offset to be represented.
(int_value): With --bignum, create the value as mp_integer rather
than plain integer.
(substr_value): factored out of eval6; implements "substr".
(freev): also destroy mp_integer values.  Check that no mp_integer
values exist if --no-bignum was specified.
(printv, null, tostring): support mp_integer.
(toint): new funtion for converting from string or mp_integer to
integer.
(getsize): extracts a size_t value from a VALUE object; used to
implement substr.
(promote): promotes a value from integer to mp_integer.
(domult, dodivide): functions for multiplication and division,
factored out of eval4.
(doadd): addition/subraction function, factpred out of eval3.
(eval3): support mp_integer types; call doadd.
(eval4): support mp_integer types; call domult, dodivide.
(eval6): support mp_integer offsets and lengths for "substr" and
"index".
* TODO: Mention that expr supports arbitrary-precision arithmetic,
and suggest that this might also be a good idea for seq.
* AUTHORS (expr): Add James Youngman.
2008-08-06 08:47:55 +02:00
James Youngman
d9207b48a3 doc: mv,cp: undocument the --reply option
* doc/coreutils.texi (mv invocation): Remove documentation for mv --reply.
(cp invocation): Likewise.
* NEWS: mention this.
2008-08-06 08:36:46 +02:00
James Youngman
d7f79cf6cb document the supported baud rates beyond 38400
* doc/coreutils.texi (Special):  Document the supported baud rates
beyond 38400.
2008-08-06 08:34:50 +02:00
John David Anglin
8c3835bf93 ls: ignore spurious getfilecon failure due to lack of SELinux support
* src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value
of EOPNOTSUPP just like ENOTSUP.  See <http://bugs.debian.org/488549>.
2008-08-05 12:27:18 +02:00
James Youngman
273c10fc2c Document uptime.
* doc/coreutils.texi (uptime invocation): document uptime.
* TODO: uptime is documented now.
* src/uptime.c (print_uptime): Use fprintftime to print the time, rather
than printf. This should make the situation better for translations.
2008-08-05 12:21:30 +02:00
Benno Schulenberg
f4bffea5e9 doc: correct and normalize --help output of several tools
* src/chroot.c (usage): Add "[ARG]" to synopsis.
* src/cut.c (usage): Remove an inconsistent period in an option
description.
* src/du.c (usage): Remove superfluous argument after short option -X.
Also remove inconsistent uppercase and final period.
Use a single indent level for prettiness.
* src/shred.c (usage): Normalize the synopsis.
* src/stty.c (usage): Options -F and --file are alternatives, cannot
both be used.
* src/sum.c (usage): -r does not overrule -s; the last one counts.
* src/uptime.c (usage): Remove inconsistent space from the synopsis.
* src/users.c: Likewise.
2008-08-04 11:10:14 +02:00
Jim Meyering
6b9f1bdd66 false: mark "false" description for translation
* src/true.c (usage): Mark both strings with N_, so that
the one for "false" is also extracted for translation.
For consistency, mark both, although only the latter one needed it.
Inspired by a patch from Benno Schulenberg.
2008-08-04 10:28:16 +02:00
James Youngman
ffc630e598 factor: credit Torbjörn Granlund
* src/factor.c: Credit Torbjörn Granlund as the author of the
arbitrary-precision factorization code.
2008-08-04 09:11:19 +02:00
Jim Meyering
c4c3dbc024 doc: make it clear we're talking about the Linux kernel
* doc/coreutils.texi (mv invocation): tweak wording
2008-08-03 08:53:52 +02:00
Ralf Wildenhues
110df929fc tests: fix build-aux/check.mk for non-GNU make
* build-aux/check.mk ($(TEST_LOGS)) [!GNU_MAKE]: Check for
a $(TESTS) test in the build dir, before one in srcdir.  For details,
see <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14198>.
2008-08-02 13:57:17 +02:00
Ralf Wildenhues
e3b5543ea8 * bootstrap: Fix unportable expr usage. 2008-08-02 10:49:35 +02:00
Kamil Dudka
84f6abfe00 ls: --color now highlights files with capabilities, too
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>.
(has_capability): New function for capability detection.
(print_color_indicator): Colorize file with capability.
* m4/jm-macro.m4: New configure option: --disable-libcap.
Check for libcap usability.
* src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP).
* src/dircolors.c: Update color lists.
* src/dircolors.hin: Mention new CAPABILITY color attribute.
* tests/ls/capability: Test for ls - colorize file with capability.
* tests/Makefile.am (root_tests): Add ls/capability.
* NEWS: Mention the change.
2008-08-01 22:13:25 +02:00
James Youngman
00c6aacf31 factor arbitrarily large numbers
* m4/gmp.m4: New file; adds cu_GMP, which detects GNU MP.
* configure.ac: Use cu_GMP.
* src/Makefile.am: Link factor against libgmp if available.
* src/factor.c: Use GNU MP if it is available.
(emit_factor, emit_ul_factor, factor_using_division,
factor_using_pollard_rho, extract_factors_multi,
sort_and_print_factors, free_factors): new functions
for the arbitrary-precision implementation, taken from an example
in GNU MP.
(factor_wheel): Renamed; was called factor.
(print_factors_single): Renamed; was called print_factors.
(print_factors): New function, chooses between the single- and
arbitrary-precision algorithms according to availability of GNU MP
and the length of the number to be factored.
(usage, main): New options --bignum and --no-bignum.
* coreutils.texi (factor invocation): Document new command-line
options for the MP implementation and update the performance
numbers to take into account the asymptotically faster algorithm.
* TODO: Remove item about factoring large primes (it's done).
* m4/gmp.m4: Add support for --without-gmp.
* NEWS: Mention the new feature.
2008-08-01 11:15:05 +02:00
Kamil Dudka
8d974b00fb ls -U1 now uses constant memory
When printing one name per line and not sorting, ls now uses
constant memory per directory, no matter how many files are in
the directory.
* ls.c (print_dir): Print each file name immediately, when possible.
* NEWS: Mention the improvement.
2008-08-01 08:36:38 +02:00
Jim Meyering
b44f5f74aa * timeout.c: Fix grammar in a comment. Normalize comment syntax. 2008-07-30 15:42:52 +02:00
Jim Meyering
662ce25d83 bootstrap: work also when there are no .po files in po/
* bootstrap (update_po_files): Complete the change that I began
in 7ba2dd8082.
2008-07-28 20:36:52 +02:00
Jim Meyering
0d75784da0 * NEWS: Move shuf --zero-terminated item into bug-fixes section. 2008-07-27 22:21:14 +02:00
Mikael Magnusson
cbdcc9fb4e shuf: correctly document --head-count
* src/shuf.c (usage): Correct --help output.
* doc/coreutils.texi: Correct option listing.
* NEWS: Mention correction.
2008-07-27 22:18:06 +02:00
Jim Meyering
bee58d8a04 shuf: honor --zero-terminated option even with --input-range=LO-HI
* src/shuf.c (write_permuted_output): Add EOLBYTE parameter and use
it rather than hard-coding "\n".
(main): Adjust sole caller.
* tests/misc/shuf: Add a test to exercise this bug fix.
* NEWS: Mention it.
2008-07-27 15:25:27 +02:00
Jim Meyering
e535754fdb dd: minor fullblock changes
* src/dd.c (O_FULLBLOCK): Define using an enum, not #define.
Derive the value, rather than hard-coding to one that might conflict.
(usage): Mention iflag=fullblock in --help output.
(scanargs): Reset the O_FULLBLOCK bit, so that we don't try to set
an undefined attribute via fcntl (fd, F_SETFL, ...
* tests/dd/misc: Signal framework_failure when necessary.
Use "compare actual expected", so any diffs look "right".
* NEWS (dd): Alphabetize and reword.
* coreutils.texi (dd invocation): Adjust wording.
2008-07-23 15:55:45 +02:00
Kamil Dudka
f674a10f7e dd: new option: iflag=fullblock to accumulate full input blocks
* src/dd.c (iread_fullblock): New function for reading full blocks.
(scanargs): Check for new parameter iflag=fullblock.
(skip): Use iread_fnc pointer instead of iread function.
(dd_copy): Use iread_fnc pointer instead of iread function.
* tests/dd/misc: Add test for dd - read full blocks.
* doc/coretuils.texi: Mention new parameter iflag=fullblock.
* NEWS: Mentioned the change.
2008-07-23 15:55:45 +02:00
Jim Meyering
4fff95cfe1 dd: adjust --help output so help2man formats the man page properly
* src/dd.c (usage): Use two spaces (not one) to separate
"directory" from its description, so help2man formats
the derived man page properly.
2008-07-23 15:50:40 +02:00
Reuben Thomas
77d97a1be4 doc: add example .bashrc code for a ~/.dircolors file
* coreutils.texi: Add tip for .bashrc use from Jim Meyering.
2008-07-23 09:11:53 +02:00
Jim Meyering
f82c5ba71e tests: do not run chmod on a prefix of space-embedded tmpdir
* TESTS/test-lib.sh (remove_tmp_): New function.
(trap 0): Use it instead of open-coded (and misquoted) version.
2008-07-22 13:15:02 +02:00
Jim Meyering
9bb0d5766e tests: ensure "make check" w/tainted build dir no longer impacts $HOME
* maint.mk (taint-distcheck): New rule.
(maintainer-distcheck): Make it.
2008-07-22 13:15:02 +02:00
Ralf Wildenhues
1ee81530c0 tests: again, do not change the mode of all directories below $HOME
* tests/CuTmpdir.pm (chmod_tree): Do not run chmod on undefined
argument, can happen when the build path contains spaces.
2008-07-22 13:15:02 +02:00
Jim Meyering
ecb0ea20ca * THANKS: Update, now that I have a name for jemm4jemm. 2008-07-19 15:42:49 +02:00
Andreas Schwab
9a221e27f5 mknod: correct misplaced -Z description in --help output
* src/mknod.c (usage): Put it after the "Mandatory arguments..." line.
2008-07-18 17:51:58 +02:00
Jim Meyering
4e6af68846 dircolors.hin: add Ogg/Theora-related extensions
* dircolors.hin: Add extensions from
http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
Suggestion from jemm4jemm@yahoo.com.
2008-07-16 15:29:11 +02:00
Jim Meyering
186b45aaed * HACKING: describe how to find a misplaced change-set 2008-07-16 15:29:04 +02:00
Jim Meyering
773be9eca8 fix two bugs in ptx
* src/ptx.c (fix_output_parameters): Don't let before_max_width
go negative -- that would cause an infloop in define_all_fields.
(main): Don't clobber name[0] with lists of two or more input files.
* tests/misc/ptx: New file.  Test for the above.
* tests/Makefile.am (TESTS): Add misc/ptx.
2008-07-15 08:30:38 +02:00
Pádraig Brady
8461d49df0 tests: expand: test for lines starting with both spaces and tabs
The expand released in current distributions (Fedora Core 4 - Fedora 9
at least), doesn't expand --initial tabs if spaces are present.

tests/misc/expand: Add test to verify --initial works correctly
with lines starting with both spaces and tabs.
2008-07-11 14:03:23 +02:00
Jim Meyering
b1a1fcbf57 make check: accommodate stricter POSIX-conforming shells
Without this, test-related variable settings were not exported to
the shell_or_perl_ function when using dash or Solaris 11's /bin/sh.
* tests/check.mk (TESTS_ENVIRONMENT): Use an explicit "export",
so as not to rely on non-POSIX behavior of some /bin/sh (e.g.,
bash-based ones).
2008-07-10 08:41:28 +02:00
Jim Meyering
0fb0a03c5c * bootstrap: Remove $bt and $bt2 also when not using gettext. 2008-07-06 23:15:23 +02:00
Jim Meyering
63467fa187 who -r: don't print "last=" when the corresponding byte is unprintable
* src/who.c (print_runlevel): Print last=%c only when the "preceding
run-level" byte is printable.  Reported by Gian Piero De Lolliis in
<http://bugzilla.redhat.com/453249>.
2008-07-04 16:34:39 +02:00
Ondřej Vašík
5483165b12 doc: describe who's -p, -r, and -t options
* doc/coreutils.texi (who invocation):
2008-07-04 16:03:50 +02:00
Jim Meyering
9a4e22d036 install with just-built ./ginstall only when not cross-compiling
* src/Makefile.am (install-exec-am): ...otherwise, use the default
value, $(INSTALL_PROGRAM).  Reported by Brian Silverman.
2008-07-04 09:46:31 +02:00
Jim Meyering
bba4d3e054 * README-hacking: Update the section on LZMA. 2008-07-04 09:46:31 +02:00
Pádraig Brady
760bc6f7e7 truncate: ignore whitespace in --size parameters
Without this, `truncate -s '> -1' F` would truncate F to length 0,
and `truncate -s " +1" F` would truncate F to 1 byte.  Now, each
elicits a diagnostic.
* src/truncate.c: Skip leading white space in the --size option
argument and any white space after one of the relative modifiers,
so that the presence of a +/- modifier can be detected reliably.
* tests/misc/truncate-parameters: Add tests for the above.
2008-06-30 10:23:17 +02:00
Jim Meyering
9396eb9037 doc: add "..." to Usage, to indicate there may be multiple OPTIONs
* src/base64.c (usage): Likewise.
* src/cat.c (usage): Likewise.
* src/md5sum.c (usage): Likewise.
* src/mkdir.c (usage): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/split.c (usage): Likewise.
* src/stat.c (usage): Likewise.
Heiko Marr reported the problem with mkdir.
2008-06-28 10:03:27 +02:00
Jim Meyering
8da8dfc470 mkfifo: correct misplaced -Z description in --help output
* src/mkfifo.c (usage): Put it *after* the "Mandatory arguments..." line.
2008-06-28 09:48:11 +02:00
Jim Meyering
1d9b3de948 uniq: remove redundant test
* src/uniq.c (find_field): Remove redundant test in outer loop-
termination expression. Also, add a "const" attribute.
2008-06-28 00:12:40 +02:00
Pádraig Brady
f38003890b timeout: fix invalid argument tests
* tests/misc/timeout-parameters: Remove test for invalid
signal number (we don't know what signal numbers are
invalid on all systems). Also tweak the other invalid
signal check so that the rest of the arguments are correct.
2008-06-27 17:46:52 +02:00
Jim Meyering
5b610a06b2 avoid a -Wsign-compare warning
* src/tee.c (tee_files): Swap fwrite's size/n_elem args and
compare the return value against "1".
2008-06-27 16:34:00 +02:00
Jim Meyering
5cc42f7de6 base64: don't rely on feof returning 0/1
* src/base64.c (do_decode): feof is specified to return nonzero,
not 0/1, so use "k < 1 + !!feof(in)" as the loop termination test.
2008-06-27 16:26:05 +02:00
Pádraig Brady
0a98d79bd2 truncate: silence -Wsign-compare warnings
* src/truncate.c: Cast signed to unsigned to
confirm intent which will silence -Wsign-compare warnings
2008-06-27 16:02:54 +02:00
Jim Meyering
a676856285 factor out time_t-to-string conversion idiom
* src/system.h: Include "inttostr.h".
(timetostr): New function, factored out of...
* src/date.c (show_date): Use timetostr.
* src/du.c (show_date): Likewise.
* src/ls.c (print_long_format): Likewise.
* src/pinky.c (time_string): Likewise.
* src/stat.c (human_time): Likewise.
* src/*.c: Don't include inttostr.h, since system.h does.
* src/c99-to-c89.diff: Adjust offsets.
2008-06-27 10:54:23 +02:00
Pádraig Brady
e2dbcee444 truncate: Fix integer portability issues
* src/truncate.c: Explicitly convert from off_t to intmax_t
when printing numbers as they may be different types.
Also don't mix size_t and off_t types in operations as
the latter will be promoted to unsigned when these types
are the same size.
2008-06-27 08:11:21 +02:00
Jim Meyering
8ce745dc61 tests: adjust c99-to-c89 patch as well as the code to generate it
* maint.mk (patch-check) [REGEN_PATCH]: Trim some trailing blanks.
* src/c99-to-c89.diff: Adjust shred.c offsets.
2008-06-26 23:31:05 +02:00
Jim Meyering
1fcd8cf8b4 tests: fix make distcheck failure due to TODO change
* maint.mk (po-check): Limit check for e.g., _(...)-marked
messages to files matching *.? and *.??, thus excluding TODO
and *.diff.
2008-06-26 22:45:57 +02:00
Jim Meyering
595fc63c42 * TODO: Add item: remove uses of imaxtostr. 2008-06-26 21:16:17 +02:00
Peter O'Gorman
58b2e1204a tests: accommodate difference in an AIX 5.3 diagnostic
* tests/mkdir/selinux: Handle different strerror (ENOTSUP) spelling.
2008-06-26 21:08:22 +02:00
Jim Meyering
27311c9e85 shred: also ignore EISDIR upon failed fsync/fdatasync on HP-UX
* src/shred.c (ignorable_sync_errno): New function.
(dosync): Use it.
Based on a patch from Peter O'Gorman.
2008-06-26 21:08:22 +02:00
Jim Meyering
556fbb5721 * HACKING: use shorter "-1" (over HEAD~1) with git format-patch 2008-06-26 21:08:22 +02:00
Jim Meyering
b1a1c9ee06 bootstrap.conf: don't list "open" specifically
It is no longer necessary to list it specifically,
now that several gnulib modules depend on the "open" module.
This reverts commit 3ea1fe588e.
2008-06-26 08:01:26 +02:00
Jim Meyering
3d309aa725 truncate: handle the case in which off_t != intmax_t
* src/truncate.c (parse_len): Use a temporary of type intmax_t,
rather than off_t; detect out of range [OFF_T_MIN..OFF_T_MAX].
(main) [IF_LINT]: Initialize, to avoid an unwarranted
"may be used uninitialized" warning.
Reported by Michael Geng.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2008-06-26 07:48:25 +02:00
Jim Meyering
4f4700cca8 basename: List David MacKenzie as the author.
* src/basename.c (AUTHORS): List David as the author.
* AUTHORS: Update here, too.
2008-06-23 14:54:33 +02:00
Ondřej Vašík
2e6fa14d16 echo: use AUTHORS from bash's built-in echo
* AUTHORS,src/echo.c: Use bash builtin echo authors instead of FIXME unknown
2008-06-23 14:46:05 +02:00
Jim Meyering
3ea1fe588e use gnulib's "open" module
* bootstrap.conf (gnulib_modules): Add open.
This is required at least for Solaris 9 and HP-UX 11, to
avoid a truncate test failure.  For details, see this thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13755
2008-06-22 18:57:39 +02:00
Jim Meyering
574f761403 stat: warn that the --context (-Z) option (a no-op) is obsolete
* src/stat.c (main): It will be removed in a couple years.
* NEWS (Change in behavior): Mention this.
2008-06-22 12:27:49 +02:00
Jim Meyering
c1aabf84e6 make "make syntax-check" quieter
* maint.mk (po-check, makefile-check, sc_proper_name_utf8_requires_ICONV):
Add "@" prefix.
2008-06-20 11:30:34 +02:00
Bo Borgerson
02bfd65480 sort: Fix bug where --batch-size option shrank SORT_SIZE.
* src/sort.c (specify_nmerge, main): Only adjust SORT_SIZE if it's already set.
* tests/misc/sort-merge: Test bug fix.
2008-06-20 08:47:28 +02:00
Jim Meyering
2c88abe2a2 tests: avoid test failure when root's primary group-ID is not 0
* tests/cp/preserve-gid: Expect a cp-without-`-p'-created file to
have a group ID of $(id -g).  Reported by Jarod Wilson.  Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837
2008-06-19 09:20:31 +02:00
Jim Meyering
7d10e30088 tests: avoid root-only test failure when run in a chroot
* tests/misc/runcon-no-reorder: Accept the diagnostic that is
produced when running in a chroot without /selinux/context.
Reported by Jarod Wilson.  Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837
2008-06-19 09:20:31 +02:00
Jim Meyering
61f94d4dbc * tests/check.mk: Fix a typo in a comment. 2008-06-18 10:01:54 +02:00
Jim Meyering
a087f17a44 doc: fix a syntax error
* coreutils.texi (du invocation): Add missing comma.
2008-06-17 23:34:47 +02:00
Bo Borgerson
20905b0cdc sort: accept new option --batch-size=NMERGE
* src/sort.c: (static unsigned int nmerge) Replace constant NMERGE.
(specify_nmerge) Validate and apply new option.
(mergefps) Replace some arrays with pointers to xnmalloc'd storage.
* tests/misc/sort-merge: Test new option.
* doc/coreutils.texi: Describe new option.
* NEWS: Advertise new option.
2008-06-17 22:36:51 +02:00
Bo Borgerson
322c6f2e5c sort: add new option --files0-from=F
* src/sort.c: Support new option.
* tests/misc/sort-files0-from: Test new option.
* tests/misc/Makefile.am: Indicate new test.
* docs/coreutils.texi: Explain new option.
* NEWS: Advertise new option.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-06-17 08:50:41 +02:00
Bo Borgerson
3435bb7f40 HACKING: Add section for tips on reducing translator workload.
* HACKING (Be nice to translators): New section.
Add Jim's suggestion to avoid changing translatable strings if possible.
2008-06-17 08:29:23 +02:00
Jim Meyering
96ae7199c4 * THANKS: Add name and email for Carl Roth. 2008-06-17 08:18:49 +02:00
Eric Blake
a7a328af0f ls, od: avoid redundant const
* src/ls.c (long_time_format, sort_functions): Avoid redundant const.
* src/od.c (charname): Likewise.
* maint.mk (sc_redundant_const): Add rule to detect this.
2008-06-17 08:17:14 +02:00
Bo Borgerson
94cecb5cf6 join: improve memory management
* src/join.c (struct seq): Use a (struct line **) for `lines' rather than
one long (struct line *).  This allows individual lines to be swapped out
if necessary.
(reset_line): Get a line ready for new input.
(init_linep): Create a new line and assign it to the the pointer passed in.
(spareline[2]): Hold a spare line for each input file.
(free_spareline): Clean up.
(get_line): Take a (struct line **) instead of a (struct line *).  If the
line to be overwritten is the previous line for the current file then swap
it out for the spare.
(join): Accomodate new structure of SEQs and new parameters to get_line;
Don't free stale lines until the end -- they're re-usable now.
(dup_line): Remove function.
* NEWS: Mention the performance improvement.
2008-06-17 00:52:30 +02:00
Ralf Wildenhues
58db1bb942 * doc/coreutils.texi (join invocation): Drop leading blanks. 2008-06-16 19:58:53 +02:00
Jim Meyering
45e67188d6 remove redundant const directives
In 1463824d8e, I added some
missing "const" directives, as well as some new, redundant ones.
This removes the redundant ones.  Pointed out by Eric Blake.
* base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c:
* cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c:
* env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c:
* install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c:
* mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c:
* paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c:
* rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c:
* stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c:
* touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c:
* wc.c, who.c: Remove redundant const directives.
* maint.mk (sc_const_long_option): Don't require redundant "const".
2008-06-16 16:40:59 +02:00
Jim Meyering
3de1559830 chcon: correct --verbose output to include newlines
* src/chcon.c (process_file): Append "\n" to --verbose diagnostic.
* tests/misc/chcon: Add a test for the above.
* NEWS: mention the bug fix
Reported by Carl D. Roth in http://bugzilla.redhat.com/451478.
2008-06-16 13:42:01 +02:00
Jim Meyering
956abf969c address root cause of compilation failures:
The affected code wasn't even being compiled on my system,
because HAVE_NL_LANGINFO was not defined.  On other systems, where
vasnprintf.m4 determines it needs %A or %a replacement support, it
_would_ check for nl_langinfo, and expose the compilation failure.
* m4/jm-macros.m4: Check for nl_langinfo, required by sort.c.
2008-06-15 18:57:13 +02:00
Jim Meyering
b1db942595 fix the compilation failure for real
* src/sort.c (monthtab): Neither "const" may be added.
2008-06-15 18:52:27 +02:00
Jim Meyering
2cbbbf6319 fix a const-related compilation failure in sort.c
* src/sort.c (monthtab): Remove overzealous "const".
Table entries are modified in an #if HAVE_NL_LANGINFO block.
Introduced by 1463824d8e.
2008-06-15 16:28:48 +02:00
Jim Meyering
837bb31803 update HACKING guidelines
* HACKING: Don't suggest --signoff; it's redundant.
(log requirements): Specify preferred forms.
Mention preference for "<" over ">".
Mention the "const placement" preference.
2008-06-15 16:01:29 +02:00
Jim Meyering
44530f2ddd run gnulib-tests in parallel
* tests/Makefile.am: Define AUTOMAKE_OPTIONS, so check.mk can append.
* tests/check.mk: Define SUFFIXES, so check.mk can append.
* build-aux/check.mk (SUFFIXES): Append, so as not to evoke
automake warning the prior definition in gnulib-tests/gnulib.mk.
(AUTOMAKE_OPTIONS): Likewise.
* gnulib-tests/Makefile.am (TEST_LOGS): Define.
Include build-aux/check.mk
2008-06-14 22:35:02 +02:00
Jim Meyering
9823682c2f * maint.mk (sc_proper_name_utf8_requires_ICONV) Fix typo in diagnostic. 2008-06-14 22:26:29 +02:00
Jim Meyering
1463824d8e add "const" attribute, where possible
* maint.mk (sc_const_long_option): New rule.  Enforce global change.
* src/base64.c (long_options): Use "const" where possible.
* src/cat.c (main): Likewise.
* src/chcon.c (long_options): Likewise.
* src/chgrp.c (long_options): Likewise.
* src/chmod.c (long_options): Likewise.
* src/chown.c (long_options): Likewise.
* src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise.
* src/cp.c (long_opts): Likewise.
* src/csplit.c (longopts): Likewise.
* src/cut.c (longopts): Likewise.
* src/date.c (long_options): Likewise.
* src/dd.c (conversions, flags, statuses): Likewise.
* src/df.c (long_options): Likewise.
* src/dircolors.c (long_options): Likewise.
* src/du.c (long_options): Likewise.
* src/env.c (longopts): Likewise.
* src/expand.c (longopts): Likewise.
* src/fmt.c (long_options): Likewise.
* src/fold.c (longopts): Likewise.
* src/groups.c (longopts): Likewise.
* src/head.c (long_options): Likewise.
* src/id.c (longopts): Likewise.
* src/install.c (long_options): Likewise.
* src/join.c (longopts): Likewise.
* src/kill.c (long_options): Likewise.
* src/ln.c (long_options): Likewise.
* src/ls.c (long_time_format, long_options, sort_functions): Likewise.
* src/md5sum.c (long_options): Likewise.
* src/mkdir.c (longopts): Likewise.
* src/mkfifo.c (longopts): Likewise.
* src/mknod.c (longopts): Likewise.
* src/mktemp.c (longopts): Likewise.
* src/mv.c (long_options): Likewise.
* src/nice.c (longopts): Likewise.
* src/nl.c (longopts): Likewise.
* src/od.c (charname, long_options): Likewise.
* src/paste.c (longopts): Likewise.
* src/pathchk.c (longopts): Likewise.
* src/pinky.c (longopts): Likewise.
* src/pr.c (long_options): Likewise.
* src/ptx.c (long_options): Likewise.
* src/readlink.c (longopts): Likewise.
* src/rm.c (long_opts): Likewise.
* src/rmdir.c (longopts): Likewise.
* src/runcon.c (long_options): Likewise.
* src/seq.c (long_options): Likewise.
* src/shred.c (long_opts): Likewise.
* src/shuf.c (long_opts): Likewise.
* src/sort.c (monthtab, long_options): Likewise.
* src/split.c (longopts): Likewise.
* src/stat.c (long_options): Likewise.
* src/stty.c (mode_info, control_info, longopts, set_mode) Likewise.
(set_control_char, speeds): Likewise.
* src/su.c (longopts): Likewise.
* src/sum.c (longopts): Likewise.
* src/tac.c (longopts): Likewise.
* src/tail.c (long_options): Likewise.
* src/tee.c (long_options): Likewise.
* src/timeout.c (long_options): Likewise.
* src/touch.c (longopts): Likewise.
* src/tr.c (long_options): Likewise.
* src/truncate.c (longopts): Likewise.
* src/tty.c (longopts): Likewise.
* src/uname.c (uname_long_options, arch_long_options): Likewise.
* src/unexpand.c (longopts): Likewise.
* src/uniq.c (longopts): Likewise.
* src/wc.c (longopts): Likewise.
* src/who.c (longopts): Likewise.
2008-06-14 22:24:28 +02:00
Jim Meyering
d42994df5d revert previous change, "don't use "const" with scalar types"
* src/truncate.c: There is nothing wrong with that construct.
This reverts commit d7d80c5b7b.
2008-06-14 11:04:41 +02:00
Jim Meyering
d7d80c5b7b don't use "const" with scalar types
* src/truncate.c: Several vendor compilers reject that.
See http://article.gmane.org/gmane.comp.lib.gnulib.bugs/13876
2008-06-14 09:47:44 +02:00
Eric Blake
20c0b8701f od: improve handling of padding
* src/od.c (decode_one_format): Alter the format, again.
(FMT_BYTES_ALLOCATED): Reduce size by adjusting to new format.
(MAX_INTEGRAL_TYPE_SIZE): Move earlier in the file.
(charname): Turn it into a 2D array, since there's no need for
pointers now.
(PRINT_TYPE, print_named_ascii, print_ascii): Add a width
parameter.
(write_block): Account for width parameter.
Using ideas from Paul Eggert.
2008-06-13 23:07:58 +02:00
Eric Blake
46a811b9e7 od: align multiple -t specs
* src/od.c (struct tspec): Add pad_width field, and adjust
print_function prototype.
(decode_one_format): Rewrite all fmt_string values to account for
pad width.
(FMT_BYTES_ALLOCATED): Adjust to new format style.
(main): Compute pad width per spec.
(write_block): Account for pad width.
(dump): Don't print padding-only fields.
(PRINT_TYPE, print_named_ascii, print_ascii): All print functions
adjusted to use variable pad width.
* tests/Makefile.am (TESTS): Add test.
* tests/misc/od-multiple-t: New file.
* THANKS: Update.
* NEWS: Mention the improvement.
Reported by Gary Johnson.
2008-06-13 23:06:03 +02:00
Eric Blake
bbbc35c9ed od: use gnulib printf replacement as necessary
* src/od.c (includes): Add xprintf.h.
(PRINT_TYPE): New macro, using xprintf instead of printf.
(print_s_char, print_char, print_s_short, print_short, print_int)
(print_long, print_long_long, print_float, print_double)
(print_long_double): Factor into PRINT_TYPE macro.
(print_named_ascii, print_ascii): Use xprintf.
* NEWS: Mention this as a bug fix.
2008-06-13 23:00:04 +02:00
Eric Blake
c49b2e32bb od: simplify long double support
* m4/jm-macros.m4 (gl_CHECK_ALL_TYPES): Remove obsolete check for
AC_C_LONG_DOUBLE.
* src/od.c (LONG_DOUBLE): Delete.
(width_bytes, MAX_FP_TYPE_SIZE, decode_one_format, main): Just use
'long double' directly.
(print_long_double): No longer protect by HAVE_LONG_DOUBLE.
2008-06-13 22:46:50 +02:00
Eric Blake
b83c498809 doc: od defaults to -toS, not -td2
* src/od.c (usage): Correct description of default.
2008-06-13 22:46:50 +02:00
Jim Meyering
6c79825ce9 skip (don't fail) root-only tests for common set-up failures
Address 2 of 4 failures reported by Jarod Wilson in
http://bugzilla.redhat.com/442352.  More details here:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803
* tests/cp/cp-a-selinux: Skip the test if "mkfs -t ext2" fails.
* tests/rm/fail-2eperm: Skip the test if "rm" is not accessible.
2008-06-13 22:45:50 +02:00
Jim Meyering
3808eccbbf tweak to conform with syntax policy
Use "<" or "<=" rather than ">" or ">=".
Use "Type const *", rather than "const Type *".
2008-06-12 21:38:17 +02:00
Bo Borgerson
81d0c8f367 comm: accept new option: --output-delimiter=STR
* src/comm.c (delimiter): New global.
(writeline): Use delimiter string instead of single TAB character.
(main): Initialize delimiter.
* tests/misc/comm: Add tests for comm output delimiter specification.
* doc/coreutils.texi: Document new option.
* NEWS: Advertise new option.
* TODO: Remove associated item.
2008-06-12 21:03:05 +02:00
Bo Borgerson
98a96822d9 comm: ensure that input files are sorted
* NEWS: List new behavior.
* doc/coreutils.texi (checkOrderOption) New macro for
describing `--check-order' and `--nocheck-order', used in
both join and comm.
* src/comm.c (main): Initialize new options.
(usage): Describe new options.
(compare_files): Keep an extra pair of buffers for the previous
line from each file to check the internal order.
(check_order): If an order-check is required, compare and handle
the result appropriately.
(copylinebuffer): Copy a linebuffer; used for copy before read.
* tests/misc/Makefile.am: List new test.
* tests/misc/comm: Tests for the comm program, including the
new order-checking functionality and attendant command-line options.
2008-06-12 19:38:43 +02:00
Jim Meyering
5f47278372 fix another unportable use of 'tr'
* configure.ac [EXTRA_PROGRAMS]: Add omitted space in tr's STRING2.
Spotted by Denis Excoffier, upon Solaris 8 build failure.
2008-06-11 14:18:36 +02:00
Jim Meyering
47ed009e57 tests: skip a chown test on FreeBSD 6.x
* tests/chown/separator: Skip this test if is likely to fail
due to the combination of a bogus group name and a broken
getgrnam function.
2008-06-11 11:52:03 +02:00
Jim Meyering
394f88c4aa tests: remove duplicate mention of misc/selinux
* tests/Makefile.am (TESTS): Remove misc/selinux, since it's
already listed in $(root_tests).
2008-06-11 11:02:32 +02:00
Bruno Haible
8253a9aeb4 fix build failure on AIX 4
* configure.ac: Fix unportable invocation of 'tr', introduced on
2008-04-22.  Affects tr from at least AIX 4.3.2.
2008-06-11 08:09:46 +02:00
Pádraig Brady
a16bee4f07 remove test for specific diagnostic when truncating missing directory
Solaris 10 returns ENOTDIR when truncating a nonexistent directory,
whereas Linux returns EISDIR (because it has a trailing /).
* tests/misc/truncate-fail-diag: Remove the test for the specific error.
2008-06-10 08:32:52 +02:00
Pádraig Brady
e63c9825da timeout: use system-independent exit values
Change exit values from ETIMEDOUT and ECANCELED,
the values of which are system dependent, to
124 and 125 respectively.
* src/timeout.c (EXIT_TIMEDOUT, EXIT_CANCELED): Define.
(usage, main): Adjust.
* coreutils.texi (timeout invocation): Update.
* tests/misc/timeout: Adjust.
2008-06-10 08:27:52 +02:00
Jim Meyering
263bb1be67 enforce the proper_name_utf8-requires-ICONV link rule
* maint.mk (sc_proper_name_utf8_requires_ICONV): New rule.
* src/Makefile.am (timeout_LDADD, truncate_LDADD): Add $(LIBICONV).
2008-06-09 10:54:57 +02:00
Bruno Haible
23c2a0cbac * NEWS (Improvements): Mention improved (via gnulib) ACL support. 2008-06-09 09:11:04 +02:00
Jim Meyering
252d6d01c9 maint.mk: my-distcheck runs $(MAKE) syntax-check once again
* maint.mk (my-distcheck): Run $(MAKE) syntax-check once again.
Run "$(MAKE) check" _after_ the less expensive syntax-check.
2008-06-08 12:33:28 +02:00
Bo Borgerson
6eec737ade standardize some error messages
* maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase):
(sc_error_message_period): Add automatic checks for non-standard error
messages.
* .x-sc_error_message_uppercase: explicit exclusion for this check
* src/cp.c: Standardize some error messages.
* src/date.c: Likewise.
* src/dircolors.c: Likewise.
* src/du.c: Likewise.
* src/expr.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/od.c: Likewise.
* src/pr.c: Likewise.
* src/split.c: Likewise.
* src/truncate.c: Likewise.
* src/wc.c: Likewise.
* tests/du/files0-from: Expect new error message.
* tests/misc/join: Likewise.
* tests/misc/split-a: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* lib/xmemxfrm.c: Likewise.
2008-06-08 12:11:47 +02:00
Jim Meyering
68158e6b10 syntax-check: detect anachronistic Perl-based tests
* maint.mk (sc_no_exec_perl_coreutils): Rename and rewrite.
2008-06-08 10:30:50 +02:00
Pádraig Brady
75e0047c4b Add new program: truncate
* AUTHORS: Register as the author
* NEWS: Mention this change
* README: Add truncate command to list
* src/truncate.c: New command
* src/Makefile.am: Add truncate command to list to build
* src/.gitignore: Add truncate binary to list to ignore
* doc/coreutils.texi (truncate invocation): Add truncate info
* man/Makefile.am: Add truncate man page to list to build
* man/truncate.x: Add truncate man page template
* po/POTFILES.in: Add truncate to list to translate
* tests/Makefile.am: Add truncate tests
* tests/misc/help-version: Add support for new truncate command
* tests/misc/truncate-dangling-symlink: check dangling link ok
* tests/misc/truncate-dir-fail: ensure dirs fail
* tests/misc/truncate-fail-diag: validate messages for missing paths
* tests/misc/truncate-fifo: ensure fifos ignored
* tests/misc/truncate-no-create-missing: ensure -c option honoured
* tests/misc/truncate-overflow: check signed integer overflows
* tests/misc/truncate-owned-by-other: root permissions check
* tests/misc/truncate-parameters: check invalid parameter combinations
* tests/misc/truncate-relative: check invalid relative sizes
2008-06-06 14:16:45 +02:00
Eric Blake
74c0bfbc4c improve 'date +%C' documentation
* src/date.c (usage): Use 20, not 21, for current century.
* THANKS: Update.
Reported by Dameon G. Rogers, fix suggested by Philip Rowlands.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-06-06 08:22:02 +02:00
Jim Meyering
80213bc66d nice.c: avoid a cast
* src/nice.c (main): Use argv[0], rather than
"program_name with a cast".  Suggestion from Eric Blake.
2008-06-03 13:58:07 +02:00
Jim Meyering
4b92612944 adjust c99-to-c89 patch as well as the code to generate it
* maint.mk (patch-check) [REGEN_PATCH]: Eliminate date-related
differences in generated diffs.
* src/c99-to-c89.diff: Adjust offsets.
2008-06-03 10:33:17 +02:00
Jim Meyering
896b672499 use gnulib's progname module
* bootstrap.conf (gnulib_modules): Add progname.
* src/*.c (program_name): Remove declaration.
* (main): Call set_program_name rather than setting program_name.
* src/nice.c (main): Cast program_name to "(char *)".
* src/prog-fprintf.c: Include "system.h"
* src/system.h: Include "progname.h".
* maint.mk (sc_program_name): Adjust rule.
Suggestion from Eric Blake.
2008-06-03 09:15:00 +02:00
Jim Meyering
1b0b6c8d08 remove duplicate definition of matchpathcon_init_prefix
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Remove definition.
It is already defined there.  Reported by Eric Blake.
2008-06-03 07:44:09 +02:00
Jim Meyering
cc4bdb92f9 fix cpp indentation policy violations
* src/copy.c (mkfifo): Indent nested "# define".
* src/timeout.c (ECANCELED): Likewise.
2008-06-02 21:47:19 +02:00
Jim Meyering
0647f3eb5a accommodate older SELinux which lacks matchpathcon_init_prefix
* m4/jm-macros.m4: Check for matchpathcon_init_prefix.
* src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX]
(matchpathcon_init_prefix): Define away.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
Reported by Ilya N. Golubev in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13686>.
2008-06-02 21:34:40 +02:00
Jim Meyering
77b1bfc85c each file with a "main" must also declare program_name
* maint.mk (sc_program_name): New rule.
* .x-sc_program_name: New file.
* Makefile.am (EXTRA_DIST): Add .x-sc_program_name.
2008-06-02 18:50:00 +02:00
Jim Meyering
434258ca73 declare program_name consistently
* src/base64.c: Likewise.
* src/basename.c: Likewise.
* src/cat.c: Likewise.
* src/chcon.c: Likewise.
* src/chgrp.c: Likewise.
* src/chmod.c: Likewise.
* src/chown.c: Likewise.
* src/chroot.c: Likewise.
* src/cksum.c: Likewise.
* src/comm.c: Likewise.
* src/cp.c: Likewise.
* src/csplit.c: Likewise.
* src/cut.c: Likewise.
* src/date.c: Likewise.
* src/dd.c: Likewise.
* src/df.c: Likewise.
* src/dircolors.c: Likewise.
* src/dirname.c: Likewise.
* src/du.c: Likewise.
* src/echo.c: Likewise.
* src/env.c: Likewise.
* src/expand.c: Likewise.
* src/expr.c: Likewise.
* src/factor.c: Likewise.
* src/fmt.c: Likewise.
* src/fold.c: Likewise.
* src/groups.c: Likewise.
* src/head.c: Likewise.
* src/hostid.c: Likewise.
* src/hostname.c: Likewise.
* src/id.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/kill.c: Likewise.
* src/link.c: Likewise.
* src/ln.c: Likewise.
* src/logname.c: Likewise.
* src/ls.c: Likewise.
* src/md5sum.c: Likewise.
* src/mkdir.c: Likewise.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.
* src/mktemp.c: Likewise.
* src/mv.c: Likewise.
* src/nice.c: Likewise.
* src/nl.c: Likewise.
* src/nohup.c: Likewise.
* src/od.c: Likewise.
* src/paste.c: Likewise.
* src/pathchk.c: Likewise.
* src/pinky.c: Likewise.
* src/pr.c: Likewise.
* src/printenv.c: Likewise.
* src/printf.c: Likewise.
* src/ptx.c: Likewise.
* src/pwd.c: Likewise.
* src/readlink.c: Likewise.
* src/rm.c: Likewise.
* src/rmdir.c: Likewise.
* src/runcon.c: Likewise.
* src/seq.c: Likewise.
* src/setuidgid.c: Likewise.
* src/shuf.c: Likewise.
* src/sleep.c: Likewise.
* src/sort.c: Likewise.
* src/split.c: Likewise.
* src/stat.c: Likewise.
* src/stty.c: Likewise.
* src/su.c: Likewise.
* src/sum.c: Likewise.
* src/sync.c: Likewise.
* src/tac.c: Likewise.
* src/tail.c: Likewise.
* src/tee.c: Likewise.
* src/test.c: Likewise.
* src/timeout.c: Likewise.
* src/touch.c: Likewise.
* src/tr.c: Likewise.
* src/true.c: Likewise.
* src/tsort.c: Likewise.
* src/tty.c: Likewise.
* src/uname.c: Likewise.
* src/unexpand.c: Likewise.
* src/uniq.c: Likewise.
* src/unlink.c: Likewise.
* src/uptime.c: Likewise.
* src/users.c: Likewise.
* src/wc.c: Likewise.
* src/who.c: Likewise.
* src/whoami.c: Likewise.
* src/yes.c: Likewise.
2008-06-02 17:47:32 +02:00
Eric Blake
eebe731014 export program_name, required by gnulib
* src/timeout.c (program_name): Export.
2008-06-02 16:04:50 +02:00
Jim Meyering
91c1384602 revert inadvertent change in last patch
* configure.ac (AM_INIT_AUTOMAKE): Restore accidentally-modified
options.  Spotted by Eric Blake.
2008-06-02 15:07:37 +02:00
Pádraig Brady
265c4b83a8 new program: timeout
* AUTHORS: Register as the author.
* NEWS: Mention this change.
* README: Add timeout command to list.
* src/timeout.c: New file.
* src/kill.c (operand2sig): Move function to its own file,
now that timeout.c will also use it.
* src/operand2sig.c (operand2sig): New file, extracted from kill.c.
* src/operand2sig.h (operand2sig): Declare.
* src/Makefile.am (EXTRA_PROGRAMS): Add timeout.
* src/.gitignore: Add timeout binary to list to ignore.
* doc/coreutils.texi (timeout invocation): Add timeout info.
(Signal specifications): New section, also referenced by kill.
* man/Makefile.am (timeout.1): Add dependency.
* man/timeout.x: New file.
* po/POTFILES.in: Add timeout.c and operand2sig.c to list to translate.
* tests/Makefile.am (TESTS): Add the two new tests.
* tests/misc/help-version: Add support for new timeout command.
* tests/misc/invalid-opt: Add support for new timeout command.
* tests/misc/timeout: New file: check basic timeout operation.
* tests/misc/timeout-parameters: New file: check invalid parameter
combinations.
2008-06-02 14:40:26 +02:00
Jim Meyering
4a510cd399 spell author names consistently
* src/comm.c (AUTHORS): Use RMS' middle initial.
* src/ls.c (AUTHORS): Likewise.
* src/rm.c (AUTHORS): Likewise.
* src/uniq.c (AUTHORS): Likewise.
* src/cut.c (AUTHORS): Use David M. Ihnat's middle initial.
* AUTHORS: Update to match.
Reported by Michael Piefel.
2008-06-02 14:12:59 +02:00
Simon Josefsson
ecb67c8389 doc: adjust base64 documentation
* coreutils.texi (base64 invocation): Use RFC 4648 as the specification.
Move the URL down a bit in the text.
2008-06-01 18:02:32 +02:00
Erik Auerswald
86535835fe md5sum: new option, --quiet, to suppress OK messages
sha1sum, sha224sum, sha384sum, and sha512sum accept it, too.
* src/md5sum.c: add option --quiet to suppress OK messages
* doc/coreutils.texi: document option --quiet
* tests/misc/md5sum: add test for option --quiet
* NEWS: mention new option --quiet for md5sum+sha*sum in "New
  features" section
2008-06-01 16:55:11 +02:00
Jim Meyering
01e6181965 add rules to commit three post-release changes automatically
* maint.mk (noteworthy): Define.
(emit-commit-log): Define.
(alpha beta major): Also update NEWS and cfg.mk automatically,
and commit all three changes at once.
2008-06-01 14:48:07 +02:00
Jim Meyering
8a4192d3c0 update old_NEWS_hash
* cfg.mk (old_NEWS_hash): Update by running "make update-NEWS-hash".
Reported by Erik Auerswald.
2008-06-01 14:44:50 +02:00
Simon Josefsson
423f28be77 src/base64.c: Improve comments. 2008-06-01 13:25:57 +02:00
Jim Meyering
dd3612a12b * NEWS: add header line for next release 2008-06-01 11:00:51 +02:00
Jim Meyering
3cafcf8584 adjust format of .prev-version commit message
* maint.mk (alpha beta major): Start with "*", omit version number.
2008-06-01 10:39:13 +02:00
Jim Meyering
4db4c2aa6d * .prev-version: Record previous version. 2008-06-01 10:11:01 +02:00
Jim Meyering
d81d2e0ba6 Version 6.12.
* NEWS: Record release date.
2008-05-31 23:20:56 +02:00
Jim Meyering
eba365275b install: reenable matchpathcon-related code
The underlying performance problem is being dealt with in Automake
by limiting the number of install invocations, and in SELinux with
incremental changes as well as a potential new implementation.
* src/Makefile.am (ginstall_CPPFLAGS) [ENABLE_MATCHPATHCON]: Define.
* src/install.c [ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]:
Rename to ENABLE_MATCHPATHCON.
* NEWS: mention this change
2008-05-31 22:42:20 +02:00
Jim Meyering
eb4b2d462e configure.ac: remove explicit use of AB_INIT
* configure.ac: Don't invoke AB_INIT directly, now that it's
done automatically via gl_INIT.
2008-05-30 14:14:43 +02:00
Jim Meyering
72df741618 tests: ignore known failure on all Darwin 8.x / Mac OS X v10.4.x
* tests/chgrp/basic: Update comment and host_triplet version test.
2008-05-30 10:45:45 +02:00
Jim Meyering
fc6827e2bb tests: avoid failure with older version of Perl's File::Temp
* tests/CuTmpdir.pm (import): Use &File::Temp::cleanup only
if it is defined.  Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13652
2008-05-30 09:45:53 +02:00
Jim Meyering
6c9b505329 NEWS: mention that cp -p copies permissions more portably
Based on wording suggested by Bruno Haible.
2008-05-30 09:08:51 +02:00
Jim Meyering
9f678af5f3 improve description of du's--separate-dirs option
* coreutils.texi (du invocation): Prompted by Volker Badziong's
report in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13646
2008-05-29 21:32:40 +02:00
Jim Meyering
8581bcc9e3 du.c: tiny cleanup (no semantic change)
* src/du.c (process_file): Use "file", rather than
equivalent "ent->fts_path".
2008-05-29 18:01:05 +02:00
Jim Meyering
00a3098235 in 280+ tests/* files, use $srcdir, not $top_srcdir/tests 2008-05-27 13:48:32 +02:00
Jim Meyering
c6c9e8730e prefer abs_srcdir over abs_top_srcdir, ...
so that e.g., tests/* may refer to absolute names without
hard-coding the name of the containing directory (tests/, here).
* tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir.
* tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr.
* tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests.
* tests/cp/cp-parents: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/mv/acl: Likewise.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/into-self-2: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/mv/to-symlink: Likewise.
* tests/rm/one-file-system: Likewise.
* tests/sample-test: Likewise.
2008-05-27 13:30:44 +02:00
Jim Meyering
8976a2b27e tests: generalize my-distcheck
* maint.mk (my-distcheck): Accommodate missing gnulib-tests.
2008-05-27 12:29:57 +02:00
Jim Meyering
87386cc8a9 reflect renaming of acl.c in gnulib
* POTFILES.in: s/acl.c/set-mode-acl.c/
2008-05-26 19:42:24 +02:00
Jim Meyering
545a116748 test installation results more thoroughly
* maint.mk (my-distcheck): Ensure that properly-named binaries
are installed.  Also check all man pages, except [.1.
Move configure-time --prefix= to install-time prefix=.
(my-instcheck, install-transform-check): Define.
2008-05-26 14:34:17 +02:00
Jim Meyering
9d59509937 install many binaries at once, when possible
* src/Makefile.am (install-exec-am): Override the standard
automake-generated target, so we can decide whether to use
the usual install-one-by-one rule, or whether we can use
the new install-many-at-once rule:
(cu-install-binPROGRAMS): New rule.
2008-05-26 12:10:21 +02:00
Jim Meyering
26552f2756 * src/runcon.c: Add copyright comment. 2008-05-26 08:40:33 +02:00
Jim Meyering
86837548f1 adjust AUTHORS and check-AUTHORS rule to accommodate
* AUTHORS: Add coding: utf-8 comment at end.
Spell François' and Torbjörn's names properly.
* src/Makefile.am: Parse AUTHORS file more carefully.
Use perl to join now-split lines.
Use en_US.UTF-8 to generate --version output.
2008-05-26 08:40:33 +02:00
Jim Meyering
199d850038 * src/c99-to-c89.diff: Adjust offsets. 2008-05-26 08:40:33 +02:00
Jim Meyering
581b2e3cee adjust copyright dates 2008-05-26 08:40:33 +02:00
Jim Meyering
d8382a4d26 convert the rest to use proper_name -- manually
* src/base64.c (AUTHORS): Rename from AUTHOR, for consistency.
2008-05-26 08:40:33 +02:00
Jim Meyering
74a106985a convert 3-author programs to use proper_name
g grep -E -l 'define AUTHORS "[^,]+", "[^,]+", "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+"), ("[^,]+"), ("[^,]+")$/$1 \\\n  proper_name ($2), \\\n  proper_name ($3), \\\n  proper_name ($4)/'
2008-05-26 08:40:33 +02:00
Jim Meyering
be2abe31fd convert 2-author programs to use proper_name
g grep -E -l 'define AUTHORS "[^,]+", "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+"), ("[^,]+")$/$1 \\\n  proper_name ($2), \\\n  proper_name ($3)/'
2008-05-26 08:40:33 +02:00
Jim Meyering
b69b4cca95 convert single-author programs to use proper_name
g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \
  's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/'
2008-05-26 08:40:32 +02:00
Jim Meyering
7855cbfcac use gnulib's proper_name_utf8 function, but *not* proper_name
* bootstrap.conf (gnulib_modules): Add propername.
(XGETTEXT_OPTIONS): Add options to tell xgettext about the functions.
* src/cat.c, src/cp.c, src/df.c, src/du.c, src/split.c:
Mark Torbjörn Granlund's name.
* src/ptx.c: Mark François Pinard's name.
Use "TRANSLATORS:" comment marker, rather than "Note to translators:".
* src/system.h: Include propername.h.
(proper_name): Define away.
* src/Makefile.am (cat_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
Initialize, so we can...
(cat_LDADD, cp_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
...Use "+=" to append $(LIBICONV) for each program that uses
proper_name_utf8.
2008-05-26 08:37:08 +02:00
Jim Meyering
29290d0485 * POTFILES.in: Add lib/copy-acl.c.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-05-24 09:29:33 +02:00
Jim Meyering
3ceabe1bfc install: avoid a leak in currently-ifdef'd-out code
* src/install.c (setdefaultfilecon)
[ENABLE_WHEN_MATCHPATHCON_IS_MORE_EFFICIENT]:
Call matchpathcon_init_prefix only once.
Suggestion from Stephen Smalley.  Reported by Ben Webb in
<http://bugzilla.redhat.com/447410>.
2008-05-20 21:35:40 +02:00
Jim Meyering
5e6a1837ea use gnulib's base64 module, now that it's sync'd to match this one
* gl/lib/base64.c: Remove file.
* gl/lib/base64.h: Remove file.
2008-05-19 19:50:34 +02:00
Pádraig Brady
76367f06b3 doc: clarify field delimiter description in uniq --help output
* src/uniq.c: Clarify in help output that field delimiters are
blanks and not the larger set of whitespace characters.
2008-05-19 13:47:14 +02:00
Jim Meyering
c4a9551eee tests: skip when a debian libc6-2.7-11 bug makes printf segfault
* tests/misc/printf-surprise: Detect case of a low-memory-provoked
segfault and skip the test (this is actually a bug in snprintf).
For details, see http://bugs.debian.org/481543
2008-05-17 08:29:00 +02:00
Jim Meyering
9300779cc8 tests: sync and update wc and du --files0-from tests
* tests/du/files0-from: Sync from tests/misc/wc-files0-from.
(minus-in-minus): New test.
Adjust for new diagnostics.
* tests/misc/wc-files0-from: Adjust for new diagnostics.
2008-05-17 08:29:00 +02:00
Jim Meyering
878e51ebfa du, wc: merge improved --files0-from=F-related diagnostics
du gave a better diagnostic for one unusual case,
and wc gave a better diagnostic for a different one.
Now each diagnoses both unusual cases.
* src/du.c (main): Disallow '-' as file name when reading from stdin.
* src/wc.c (main): Give a better diagnostic for a zero-length file name.
2008-05-17 08:28:59 +02:00
Jim Meyering
51243cdaca test invalid-option handling in all programs
* tests/Makefile.am (TESTS): Add misc/invalid-opt.
* tests/misc/invalid-opt: New file.
2008-05-17 08:28:59 +02:00
Jim Meyering
1081bbc74e tests: remove ugly /bin/sh wrapper around each perl-based test script
* tests/check.mk (TESTS_ENVIRONMENT): Save and restore TMPDIR around
envvar-check, so that the few scripts that require $TMPDIR don't fail.
This is also good to let a user's default TMPDIR setting be used e.g.,
in the search for an 'other-partition'.
FIXME: this is pretty ugly.  maybe undo it and find a better way.
(TESTS_ENVIRONMENT): Invoke perl scripts with $(PERL), and use -T
if the script requires that.  Otherwise, use $(SHELL).

* tests/misc/md5sum-newline: Create a file whose name contains
a newline in Perl (resort to using "system", since open refuses).

Fix old brokenness exposed by this change:
* tests/du/files0-from: Correct test not to rely on stdin
being attached to a non-tty.
* tests/misc/sort (3g, 3h, 3i): Likewise: add explicit empty input file.
Avoid warnings about using qw()-around-commas.

* tests/rm/fail-eperm: Now that this test is run from a temporary
subdirectory, adjust the full name of the "rm" program we're going
to run.

Change #!/bin/sh to #!/usr/bin/perl, and factor out the few lines
of boilerplate code to invoke perl.  Do not "require 5.00x";
a configure-time Perl test handles that
* tests/dd/skip-seek:
* tests/misc/base64:
* tests/misc/basename:
* tests/misc/cut:
* tests/misc/date:
* tests/misc/dircolors:
* tests/misc/dirname:
* tests/misc/expand:
* tests/misc/expr:
* tests/misc/factor:
* tests/misc/fmt:
* tests/misc/fold:
* tests/misc/head:
* tests/misc/head-elide-tail:
* tests/misc/join:
* tests/misc/ls-misc:
* tests/misc/md5sum:
* tests/misc/md5sum-newline:
* tests/misc/mktemp:
* tests/misc/od:
* tests/misc/paste:
* tests/misc/pr:
* tests/misc/printf-cov:
* tests/misc/seq:
* tests/misc/sha1sum:
* tests/misc/sha1sum-vec:
* tests/misc/sha224sum:
* tests/misc/sha256sum:
* tests/misc/sha384sum:
* tests/misc/sha512sum:
* tests/misc/sort-merge:
* tests/misc/stat-printf:
* tests/misc/sum:
* tests/misc/tac:
* tests/misc/tail:
* tests/misc/test:
* tests/misc/test-diag:
* tests/misc/tr:
* tests/misc/tsort:
* tests/misc/tty-eof:
* tests/misc/unexpand:
* tests/misc/uniq:
* tests/misc/wc:
* tests/misc/wc-files0-from:
* tests/misc/xstrtol:
* tests/mv/i-1:
* tests/pr/pr-tests:
* tests/rm/empty-name:
* tests/rm/fail-eperm:
* tests/rm/unreadable:
2008-05-17 08:27:58 +02:00
Jim Meyering
ea54b6f47c tests: allow to run Perl tests more cleanly
Before this change, perl tests were run via a #!/bin/sh script
in which perl was invoked via $(PERL) ... -- - <<\EOF.
That made some stty tests fail due to the way stdin was usurped.
* build-aux/check.mk (am__check_pre): Don't append $(SHELL) to this
nominally automake-internal variable.
* tests/check.mk (TESTS_ENVIRONMENT): Instead, define a shell function
here, and append it to the more user-visible $(TESTS_ENVIRONMENT).
2008-05-16 10:10:34 +02:00
Jim Meyering
4a4fe636dc tests: env-related clean up
* tests/Coreutils.pm: tiny clean-up: s/env/env --/
* tests/misc/help-version: Use "env" rather than an absolute file
name prefix.
* tests/misc/printf-surprise: Likewise.
2008-05-16 10:10:34 +02:00
Jim Meyering
c6a3937288 tests: improve coverage of printf.c
* tests/misc/printf-cov: New file.
* tests/Makefile.am (TESTS): Add misc/printf-cov.
* tests/misc/help-version: Use env rather than abs file name prefix.
2008-05-16 10:10:34 +02:00
Jim Meyering
0bf3eb3682 make HACKING slightly more generic
* HACKING: remove some uses of "coreutils"
Point to git's own SubmittingPatches URL.
2008-05-16 10:08:56 +02:00
Bruno Haible
513a235858 doc: some Unicode characters cannot be specified via \u or \U
* doc/coreutils.texi (printf invocation): Clarify invalid ranges for
Unicode character escape syntax.
2008-05-15 09:33:33 +02:00
Jim Meyering
433881d802 move sha256 and sha512 modules to gnulib
* bootstrap.conf (gnulib_modules) [sha256, sha512]: Add "crypto/"
prefix to module name, now that they come from gnulib.
* gl/lib/sha256.c: Remove file.
* gl/lib/sha256.h: Likewise.
* gl/lib/sha512.c: Likewise.
* gl/lib/sha512.h: Likewise.
* gl/lib/u64.h: Likewise.
* gl/m4/sha256.m4: Likewise.
* gl/m4/sha512.m4: Likewise.
* gl/modules/sha256: Likewise.
* gl/modules/sha512: Likewise.
2008-05-11 09:00:59 +02:00
Jim Meyering
295d47736a now that the last of the mk-script-using tests is gone...
* tests/Makefile.am (EXTRA_DIST): Remove Makefile.am.in and mk-script.
Move/adjust SUBDIRS-related comments.
* tests/Makefile.am.in: Remove file, no longer used.
* tests/mk-script: Likewise.
* bootstrap: Remove coreutils-specific SUBDIRS-related code.
2008-05-10 13:35:30 +02:00
Jim Meyering
346dd8b5bf tests: remove directory, tests/join/
* configure.ac (AC_CONFIG_FILES): Remove tests/join/Makefile.
* tests/misc/join: New file, with tests from...
* tests/join/Test.pm: ...here.  Remove file.
* tests/Makefile.am (SUBDIRS): Remove definition.
2008-05-10 13:35:30 +02:00
Jim Meyering
65d65fe094 * tests/misc/tac: Also perform stdin and piped tests. 2008-05-10 13:35:29 +02:00
Jim Meyering
a59258fbc7 tests: convert pr tests
* configure.ac (AC_CONFIG_FILES): Remove tests/pr/Makefile.
* tests/Makefile.am (SUBDIRS): Remove pr.
* tests/pr/pr-tests: New file, with tests from...
* tests/pr/Test.pm: ...here.  Remove file.
* tests/Makefile.am (EXTRA_DIST): Add $(pr_data).
(pr_data): List all of the pr's test-related data files.
2008-05-10 13:35:29 +02:00
Jim Meyering
b347377bd3 tests: remove directory, tests/tail/
* configure.ac (AC_CONFIG_FILES): Remove tests/tail/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tail.
* tests/misc/tail: New file, with tests from...
* tests/tail/Test.pm: ...here.  Remove file.
2008-05-10 10:11:45 +02:00
Bernhard Marx
0fe9fc4558 doc: improve description of "niceness" values
* doc/coreutils.texi (nice invocation):
2008-05-09 08:50:46 +02:00
Jim Meyering
15b0d75930 tests: remove directory, tests/sort/
* configure.ac (AC_CONFIG_FILES): Remove tests/sort/Makefile.
* tests/Makefile.am (SUBDIRS): Remove sort.
* tests/misc/sort: New file, with tests from...
* tests/sort/Test.pm: ...here.  Remove file.
2008-05-09 08:11:12 +02:00
Bruno Haible
f0ad302ca9 Speed up "wc -m" and "wc -w" in multibyte case.
* src/wc.c: Include mbchar.h.
(wc): New variable in_shift. Use it to avoid calling mbrtowc for most
ASCII characters.  Reported via Jan Engelhardt in
http://bugzilla.novell.com/381873 with discussion here
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13520
2008-05-08 23:21:04 +02:00
Jim Meyering
28c9d4ecff tests: remove directory, tests/tac/
* configure.ac (AC_CONFIG_FILES): Remove tests/tac/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tac.
* tests/misc/tac: Many new tests, from...
* tests/tac/Test.pm: ...here.  Remove file.
2008-05-08 10:33:15 +02:00
Jim Meyering
ce7b12ef1b tests: remove directory, tests/test/
* configure.ac (AC_CONFIG_FILES): Remove tests/test/Makefile.
* tests/Makefile.am (SUBDIRS): Remove test.
* tests/misc/test: Many new tests, from...
* tests/test/Test.pm: ...here.  Remove file.
2008-05-08 09:12:53 +02:00
Jim Meyering
7fcb73cec0 tests: Coreutils.pm: support running a program that is a shell built-in
* tests/Coreutils.pm (run_tests): Add support for running a
program like 'test', that is a shell built-in.
2008-05-08 09:12:43 +02:00
Jim Meyering
6a9c6804dd * TODO: Bo Borgerson is rewriting support for cp --recursive 2008-05-06 14:29:57 +02:00
Jim Meyering
7c9c6c7875 tests: remove directory, tests/tr/
* configure.ac (AC_CONFIG_FILES): Remove tests/tr/Makefile.
* tests/Makefile.am (SUBDIRS): Remove tr.
* tests/misc/tr: Many new tests, from...
* tests/tr/Test.pm: ...here.  Remove file.
* tests/tr/failures: Remove file.
* tests/tr/TODO: Remove file.
2008-05-06 11:00:29 +02:00
Jim Meyering
d3dc29c0be tests: skip another test if mcstransd is running
* tests/test-lib.sh (skip_if_mcstransd_is_running_): New function,
extracted from...
* tests/misc/chcon: ...here.  Use function, not open-coded test.
* tests/misc/selinux: Use the function here, too.
Require root, not non-root.
* tests/Makefile.am (root_tests): Add misc/selinux.
2008-05-06 08:21:30 +02:00
Jim Meyering
6ec3a4f033 tests: translate uniq-z-test-adding code to new framework
* tests/misc/uniq (add-z-variants): New function.
Use it.
2008-05-06 08:21:30 +02:00
Jim Meyering
7cc3733f29 tests: remove directory, tests/uniq/
* configure.ac (AC_CONFIG_FILES): Remove tests/uniq/Makefile.
* tests/Makefile.am (SUBDIRS): Remove uniq.
* tests/misc/uniq: Many new tests, from...
* tests/uniq/Test.pm: ...here.  Remove file.
2008-05-06 08:21:30 +02:00
Jim Meyering
e98006dde0 tests: remove directory, tests/cut/
* configure.ac (AC_CONFIG_FILES): Remove tests/cut/Makefile.
* tests/Makefile.am (SUBDIRS): Remove cut.
* tests/misc/cut: Many new tests, from...
* tests/cut/Test.pm: ...here.  Remove file.
2008-05-06 08:21:30 +02:00
Jim Meyering
bc2b9e04e9 tests: remove directory, tests/head/
* configure.ac (AC_CONFIG_FILES): Remove tests/head/Makefile.
* tests/Makefile.am (SUBDIRS): Remove head.
* tests/misc/head: New file, derived from ...
* tests/head/Test.pm: ...this.  Remove file.
* tests/head/in: Remove file.
* tests/head/in-1024: Remove file.
* tests/Coreutils.pm (triple_test): New function.
2008-05-06 08:21:30 +02:00
Jim Meyering
5ad6145142 tests: Coreutils.pm improvements
* tests/Coreutils.pm: Allow test names longer than 12.
Print a useful diagnostic for bogus spec entry.

Handle the combination of IN_PIPE and ENV properly.
* tests/Coreutils.pm (run_tests): Put ENV right before command,
not before the "cat INPUT_FILE |" prefix.
2008-05-06 08:21:30 +02:00
Jim Meyering
2656da4705 tests: move "sparse-file" into test-lib.sh
* tests/sparse-file: Remove file  Move contents into ...
* tests/test-lib.sh (require_sparse_support_): ...here.  New function.
* tests/cp/sparse: Use the function, not the file.
* tests/du/8gb: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove sparse-file.
2008-05-06 08:21:30 +02:00
Jim Meyering
3269104d17 tests: move "group-names" into test-lib.sh
* tests/group-names: Remove file  Move contents into ...
* tests/test-lib.sh (require_membership_in_two_groups_): ...here.  New function.
* tests/chgrp/basic: Use the function, not the file.
* tests/chgrp/default-no-deref: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chgrp/no-x: Likewise.
* tests/chgrp/posix-H: Likewise.
* tests/chgrp/recurse: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove group-names.
2008-05-06 08:21:30 +02:00
Jim Meyering
f15e62d12e tests: use printf+sed rather than yes+head+tr
* tests/misc/fmt-long-line: Minor clean-up.
Using "yes" like that has caused trouble in the past.
2008-05-06 08:21:30 +02:00
Jim Meyering
32b84c9c90 tests: save and restore TERM around use of TESTS_ENVIRONMENT,
now that TESTS_ENVIRONMENT unsets it.
* check.mk (am__check_pre): Save $TERM.
(am__check_post): Restore saved value of TERM and export.
2008-05-06 08:21:30 +02:00
Jim Meyering
1f3e964802 tests: hoist the sourcing of "lang-default"
* tests/check.mk (TESTS_ENVIRONMENT): Source lang-default here, ...
... rather than in each of 100+ test scripts.
* tests/chgrp/basic:
* tests/chgrp/no-x:
* tests/chmod/c-option:
* tests/chmod/no-x:
* tests/chmod/setgid:
* tests/chmod/thru-dangling:
* tests/chmod/umask-x:
* tests/chmod/usage:
* tests/chown/basic:
* tests/chown/deref:
* tests/chown/preserve-root:
* tests/cp/abuse:
* tests/cp/acl:
* tests/cp/backup-is-src:
* tests/cp/cp-a-selinux:
* tests/cp/cp-i:
* tests/cp/cp-mv-backup:
* tests/cp/deref-slink:
* tests/cp/fail-perm:
* tests/cp/into-self:
* tests/cp/link-preserve:
* tests/cp/preserve-gid:
* tests/cp/same-file:
* tests/cp/slink-2-slink:
* tests/cp/special-f:
* tests/cp/symlink-slash:
* tests/cp/thru-dangling:
* tests/du/basic:
* tests/du/hard-link:
* tests/du/inacc-dest:
* tests/du/long-sloop:
* tests/du/no-x:
* tests/install/basic-1:
* tests/ln/hard-backup:
* tests/ln/sf-1:
* tests/ls/file-type:
* tests/ls/infloop:
* tests/ls/nameless-uid:
* tests/ls/rt-1:
* tests/ls/stat-failed:
* tests/ls/symlink-slash:
* tests/ls/x-option:
* tests/misc/chcon:
* tests/misc/chcon-fail:
* tests/misc/csplit:
* tests/misc/df-P:
* tests/misc/groups-dash:
* tests/misc/groups-version:
* tests/misc/nohup:
* tests/misc/printf-surprise:
* tests/misc/runcon-no-reorder:
* tests/misc/selinux:
* tests/misc/split-a:
* tests/misc/split-fail:
* tests/misc/tac-continue:
* tests/misc/wc-files0:
* tests/mkdir/p-v:
* tests/mkdir/selinux:
* tests/mv/acl:
* tests/mv/backup-dir:
* tests/mv/backup-is-src:
* tests/mv/childproof:
* tests/mv/diag:
* tests/mv/dir2dir:
* tests/mv/dup-source:
* tests/mv/force:
* tests/mv/hard-link-1:
* tests/mv/hard-verbose:
* tests/mv/i-2:
* tests/mv/i-3:
* tests/mv/i-4:
* tests/mv/i-5:
* tests/mv/i-link-no:
* tests/mv/into-self:
* tests/mv/into-self-2:
* tests/mv/into-self-3:
* tests/mv/mv-special-1:
* tests/mv/part-fail:
* tests/mv/part-symlink:
* tests/mv/partition-perm:
* tests/mv/perm-1:
* tests/mv/reply-no:
* tests/mv/sticky-to-xpart:
* tests/mv/update:
* tests/rm/cycle:
* tests/rm/dir-no-w:
* tests/rm/dir-nonrecur:
* tests/rm/fail-2eperm:
* tests/rm/fail-eacces:
* tests/rm/inaccessible:
* tests/rm/interactive-always:
* tests/rm/interactive-once:
* tests/rm/isatty:
* tests/rm/one-file-system:
* tests/rm/r-1:
* tests/rm/r-2:
* tests/rm/rm1:
* tests/rm/rm2:
* tests/rm/rm3:
* tests/rm/rm4:
* tests/rm/rm5:
* tests/rm/unread2:
* tests/rm/v-slash:
* tests/touch/fail-diag:
* tests/touch/not-owner:
2008-05-06 08:21:29 +02:00
Jim Meyering
62ebe4dabd tests: hoist envvar-check so it is run for every test
I.e., also for Perl-based tests; not just the ones using test-lib.sh.
* tests/check.mk (TESTS_ENVIRONMENT): Source envvar-check here, ...
* tests/test-lib.sh: ...not here.
2008-05-06 08:21:29 +02:00
Jim Meyering
cca51697aa fix typo in comments: s/ouput/output/
adjust spelling in that same comment: s/localisation/localization/
2008-05-06 08:21:29 +02:00
Jim Meyering
22adc16d9c * tests/touch/Makefile.am: Remove now-unused file. 2008-05-06 08:21:29 +02:00
Jim Meyering
f375a52f51 tests: test split more thoroughly
* tests/misc/split-a: Clean up.  Catch more failures.
2008-05-06 08:21:28 +02:00
Jim Meyering
eb62800728 * tests/misc/wc: Remove an unused variable. 2008-05-06 08:21:28 +02:00
Jim Meyering
f02102211e tests: detect and check more uses of strcmp
* maint.mk (sc_prohibit_strcmp): Relax regexp to recognize other
formatting styles.
2008-05-06 08:21:28 +02:00
Jim Meyering
209850fd7e avoid problems with sign-extended "char" operand to is* functions
* src/cut.c (set_fields): Apply to_uchar to isblank operands.
* src/uniq.c (find_field): Likewise.
* src/seq.c (scan_arg): Likewise, for isspace.
* tests/misc/uniq: New file.  Test for the above, but only
when isspace(0240).
* tests/Makefile.am (TESTS): Add misc/uniq.
* configure.ac: Use gt_LOCALE_FR.
* tests/check.mk (TESTS_ENVIRONMENT): Propagate LOCALE_FR to scripts.
* NEWS: Mention the bug fixes.

Before this patch, on FreeBSD 6:

  $ printf 'x y z\nx \xa0 y z\n' > in
  $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' .
  x.y.z
  x. .y.z

With the patch:

  $ LC_ALL=fr_FR.UTF-8 uniq -f2 in|tr ' ' .
  x.y.z

This also affected many other locales:
for i in $(locale -a); do test $(LC_ALL=$i ./uniq -f1 in|wc -l)
  = $(LC_ALL=$i uniq -f1 in|wc -l) || echo $i ; done
...
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.UTF-8
en_IE.UTF-8
en_NZ.ISO8859-1
en_NZ.ISO8859-15
en_NZ.UTF-8
en_US.ISO8859-1
en_US.ISO8859-15
en_US.UTF-8
...
2008-05-06 08:21:28 +02:00
Bo Borgerson
4d3bf408b9 base64: remove some unused/redundant getopt code
* src/base64.c (struct option long_option): Remove redundant help/version
option items.
(main): Remove unused 'q' from short options.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-05-06 08:19:28 +02:00
Jim Meyering
2224ef83fe help2man: fix perl 5.10 problem properly
* man/help2man: Do pull LC_ALL via "use POSIX".
Instead, limit the importing of gettext-related symbols
to just those two we'll use: gettext and textdomain.
2008-05-06 00:35:28 +02:00
Jim Meyering
0b66c5776e help2man: avoid failure with Debian unstable's Perl 5.10.0
Avoid failure that produced this diagnostic:
Constant subroutine main::LC_ALL redefined at /.../Exporter.pm
* man/help2man: Don't include LC_ALL in the "use POSIX" list,
since Locale::gettext->import will get it.
2008-05-05 23:46:30 +02:00
Bo Borgerson
c64411a38a base64 module: adjust API so it's compatible with gnulib's
* gl/lib/base64.c (base64_decode_ctx): If no context structure was passed in,
treat newlines as garbage (this is the historical behavior).  Formerly
base64_decode.
(base64_decode_alloc_ctx): Formerly base64_decode_alloc.
* gl/lib/base64.h (base64_decode): Macro for four-argument calls.
(base64_decode_alloc): Likewise.
* src/base64.c (do_decode): Call base64_decode_ctx instead of base64_decode.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-05-05 17:57:41 +02:00
Jim Meyering
fcd450ecb9 * tests/misc/tac: Set execute bit. 2008-05-05 13:53:36 +02:00
Jim Meyering
d701f6abb7 tac: avoid segfault for e.g., "echo > x; tac -r x x"
* src/tac.c (tac_seekable): Move local "regs" declaration out
to file scope, so its values aren't clobbered between calls.
Discovered by Cristian Cadar, Daniel Dunbar and Dawson Engler,
reported in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13501
* NEWS: Mention the bug fix.
* tests/Makefile.am (TESTS): Add misc/tac.
* tests/misc/tac: New file.  Test for the above.
2008-05-05 13:15:32 +02:00
Jim Meyering
a892af0d48 tests: avoid a "make check-root" failure when mcstransd is running
* tests/misc/chcon: Skip this test if mcstransd seems to be running.
2008-04-30 23:29:22 +02:00
Jim Meyering
e3171c43eb tests: avoid spurious "make check-root" failure
* README (Running tests as root): Also set PATH in suggested "sudo"
command.  This avoids failure of at least tests/cp/cp-a-selinux
when the default PATH does not contain /sbin.
* tests/cp/cp-a-selinux: Don't redirect stderr to /dev/null.
"mkfs" was failing due to /sbin not being in PATH.
2008-04-30 23:29:10 +02:00
Bo Borgerson
bbc49eb536 Add Daniel Dunbar's lcov instructions to HACKING
* HACKING: New section `Finding things to do', points to TODO file and
gives instructions on generating an html coverage report as provided by
Daniel Dunbar.
* TODO: Add item for improving test coverage.  Point back to HACKING.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-04-30 16:09:33 +02:00
Jim Meyering
bbc0cb0f37 chcon, runcon: make --help print the bug-reporting address
* src/chcon.c (usage): Use emit_bug_reporting_address.
* src/runcon.c (usage): Likewise.
* tests/misc/help-version: Don't exempt chcon and runcon.
* NEWS: Mention this.
2008-04-29 14:55:38 +02:00
Jim Meyering
28f1b61e59 tests: don't hard-code coreutils list of tests/ SUBDIRS in bootstrap
* bootstrap: Extract the list from tests/Makefile.am, and die
when it is empty -- it will be, eventually.
2008-04-28 22:59:24 +02:00
Bo Borgerson
29a2fb3856 tests: remove references to tests/wc from bootstrap
* bootstrap: Don't try to initialize anything in tests/wc.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-04-28 22:47:09 +02:00
Jim Meyering
ed30cd94e3 tests: slightly relax sc_cast_of_argument_to_free syntax check
* maint.mk (sc_cast_of_argument_to_free): Relax regexp slightly.
(sc_no_have_config_h): Add a comment.
2008-04-28 22:44:56 +02:00
Bo Borgerson
eef629eea1 tests: don't chmod after a failed chdir in cleanup
* tests/CuTmpdir.pm (chmod_tree): Don't chmod if chdir failed.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-04-28 19:29:15 +02:00
Bo Borgerson
2f55920ffc Only cleanup test dirs from the process that created them.
* tests/CuTmpdir.pm (import): Use closure around current PID to avoid cleanup races.

Signed-off-by: Bo Borgerson <gigabo@gmail.com>
2008-04-28 17:28:58 +02:00
Jim Meyering
d6ec836387 move wc tests from own subdir into a single script
* configure.ac (AC_CONFIG_FILES): Remove wc/Makefile from the list.
* tests/Makefile.am (SUBDIRS): Remove wc from the list.
(TESTS): Add misc/wc.
* tests/misc/wc: New file, derived from tests/wc/Tests.pm.
* tests/wc/Test.pm: Remove file.
2008-04-27 21:31:33 +02:00
Jim Meyering
5a3b0c4805 tests: remove temporary log file upon catchable signal
* check.mk (am__check_pre): Add signal handler to remove $@-t.
2008-04-27 21:31:33 +02:00
Jim Meyering
972e2737ab tests: don't source envvar-check manually, test-lib.sh does it
* tests/cp/abuse: Remove ". $top_srcdir/tests/envvar-check".
* tests/cp/parent-perm: Likewise.
* tests/cp/special-f: Likewise.
* tests/ls/proc-selinux-segfault: Likewise.
* tests/misc/help-version: Likewise.
* tests/mkdir/selinux: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/touch/now-owned-by-other: Likewise.
* tests/sample-test: Remove commented out suggestion.
2008-04-27 21:31:33 +02:00
Jim Meyering
816e56a3de tests: ensure at least one failure when $built_programs is empty
Before, this test and others would pass with empty $built_programs.
* tests/misc/help-version: Fail if built_programs is empty.
2008-04-27 21:31:33 +02:00
Jim Meyering
bbafdc3c8f tests: improve perl-based tempdir handling
Before, upon interrupt, directories would be left behind.
* tests/CuTmpdir.pm: Remove temporary directory on interrupt.
2008-04-27 21:31:32 +02:00
Jim Meyering
dfdb532fd3 tests: reorder some tests in the long list
* tests/Makefile.am (TESTS): Move some tests that use sleep
"up" in the list so that they don't delay even a little the
completion of "make check".  Also run a chmod test early.
2008-04-27 21:31:32 +02:00
Jim Meyering
53d8a2c412 tests: put root-only (usually skipped) tests at the end
* tests/Makefile.am (TESTS): Don't list root-only tests explicitly.
Instead, just use $(root_tests).
* tests/check.mk (vc_exe_in_TESTS): Now that root_tests are separate,
parse out the union of $(TESTS) and $(root_tests).
2008-04-27 21:31:32 +02:00
Jim Meyering
427f179542 tests: move another file (expensive) into test-lib.sh
* tests/expensive: Remove file.  Move contents into ...
* tests/test-lib.sh (expensive_): ...here.  New function.
* tests/du/fd-leak: Update caller to use the new function.
* tests/mv/leak-fd: Likewise.
* tests/rm/hash: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove its name.
2008-04-27 21:31:32 +02:00
Jim Meyering
8dc387dba5 tests: cp/perm (usually not run) was failing on systems with SELinux
* tests/cp/perm: Use stat to get the permission string, not ls.
This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set
in the environment.  It would fail on SELinux-enable systems
because ls-generated permission strings would not match, e.g.,
"test _-rw-r--r--+ = _-rw-r--r--" would fail.
2008-04-27 21:31:32 +02:00
Jim Meyering
cca6a8d7e5 tweak HACKING advice 2008-04-27 21:31:08 +02:00
Jim Meyering
6bbbd65d89 tests: do define built_programs
* tests/check.mk (built_programs): Define here, where it's used.
This definition was in now-removed tests/misc/Makefile.am.
2008-04-24 12:31:13 +02:00
Jim Meyering
d30ac3d321 tests: update commented-out examples in sample-test, too
* tests/sample-test: Use $top_srcdir/tests/SCRIPT_NAME, not
$top_srcdir/../SCRIPT_NAME here, too.
2008-04-23 21:33:24 +02:00
Ondřej Vašík
37370a584c tests: don't fail in a non-English locale
* tests/chmod/thru-dangling: Source lang-default.
* tests/cp/thru-dangling: Likewise.
* tests/misc/printf-surprise: Likewise.
2008-04-23 20:17:55 +02:00
Jim Meyering
8657cf19e2 tests: remove now-unused Makefile.am
* tests/misc/Makefile.am: Remove file.
2008-04-23 17:51:44 +02:00
Ondřej Vašík
1a5b6e3a50 id: do not print SELinux context when invoked with a USERNAME argument
* NEWS: Mention new behaviour.
* src/id.c (main): Do not print SELinux context when user is specified.
* tests/Makefile.am: Add the new test.
* tests/misc/id-context: New file.  Test for the fix.
Problem reported by Ronny Buchmann in http://bugzilla.redhat.com/443485.
2008-04-23 17:51:44 +02:00
Jim Meyering
0a4a938b6b id: do print the AFS-specific nameless group ID (called a PAG)
In 6.11, we mistakenly suppressed the printing of certain group IDs,
thinking they were useless AFS-specific artifacts.
This change reverts that, so now they are printed once again.
http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13345
This also reverts the bug-fix that applied solely to the new code
used to avoid printing those IDs

Revert "id bug fix: don't point to potentially clobbered static storage"
This reverts commit f7d1c59c22.
Revert "Work around AFS bug: id and groups would print invalid group number."
This reverts commit b7a836c0a3.
Revert "* src/c99-to-c89.diff: Accommodate a C99-ism in id.c."
This reverts commit d44893c5db.
2008-04-23 15:29:11 +02:00
Jim Meyering
d9c1b8fd30 build: move a project-specific definition to cfg.mk
* cfg.mk (old_NEWS_hash): Define here, ...
* maint.mk: ... not here.
(update-NEWS-hash): Update comment.
Suggestion from Eric Blake.
2008-04-22 21:28:33 +02:00
Jim Meyering
0bc8813b1e Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4)
* configure.ac: Filter out carriage returns in more places.
Reported by Elbert Pol, details here:
http://thread.gmane.org/gmane.org.fsf.announce/867/focus=13332
2008-04-22 10:52:37 +02:00
Jim Meyering
68466d44b1 guard against inserting a NEWS entry into a block for a prior release
Without a guard like this, it is far too easy to apply a patch
prepared against a preceding release, and not notice that a NEWS
entry is inserted into the wrong block.
* maint.mk (sc_immutable_NEWS): New rule.
(update-NEWS-hash): New rule to update the hard-coded hash.
2008-04-22 10:45:21 +02:00
Jim Meyering
79a98d9bc1 tests: ensure that all exec-$PERL lines are the same
* maint.mk (sc_perl_coreutils_test): New rule.
2008-04-22 09:33:25 +02:00
Jim Meyering
a6894d063c tests: skip (don't fail) rm/one-file-system when mount --bind fails
* tests/rm/one-file-system: Reported by Allen Hewes.
2008-04-21 14:48:19 +02:00
Jim Meyering
90bc2fe272 tests: convert umask-check to a function
* tests/test-lib.sh (working_umask_or_skip_): New function, from...
* tests/umask-check: ...here.  Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove umask-check.
* tests/mkdir/perm: Use the function rather than sourcing the file.
* tests/cp/cp-parents: Likewise.
* tests/cp/parent-perm: Likewise.
Bruno Haible reported that parent-perm was failing to run umask-check.
2008-04-21 00:02:00 +02:00
Jim Meyering
c51900a6bd tests: adjust perl -I to use $top_srcdir/tests, not $srcdir/.. 2008-04-21 00:02:00 +02:00
Jim Meyering
b214b51ca0 tests: clean up root tests; adapt to new layout
* tests/Makefile.am (root_tests): New list.
(check-root): Add 'SUBDIRS='.
(root-hint): Point to README.
* Makefile.am (check-root): Add 'SUBDIRS=' here, too.
* maint.mk (sc_root_tests): Adapt rule to new syntax used
in tests/Makefile.am.
2008-04-21 00:02:00 +02:00
Jim Meyering
512e111a92 Revamp test-related Makefiles.
One side-effect of this change is that "make check" now works even if
you put "." early in your shell's search PATH (don't do that!).

Remove all test-related Makefile.am files, except those generated
by mk-script.  Instead, tests/Makefile.am now lists not only the
tests directly under tests/, but also those in tests/*/ that are
not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc.

A lot of these changes are like this:

-. $srcdir/../lang-default
+. $top_srcdir/tests/lang-default

-. $srcdir/../test-lib.sh
+. $top_srcdir/tests/test-lib.sh

* configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles.
* tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements.
* tests/rwx-to-mode: Remove file.  Rewritten as...
* tests/test-lib.sh (rwx_to_mode_): ...this new function.
* tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode.
(SUBDIRS): Remove each dir with a removed Makefile.am.
(EXTRA_DIST): Add $(TESTS).
(TESTS): Add over 300 entries.
2008-04-21 00:01:51 +02:00
Jim Meyering
d25bf9dceb * tests/misc/Makefile.am (built_programs): Remove. Unused. 2008-04-20 23:19:07 +02:00
Jim Meyering
fdb7e5b44c Use "env" to invoke potential built-ins.
* tests/misc/pwd-unreadable-parent: Invoke pwd via "env -- pwd",
rather than via an absolute name.
* tests/touch/not-owner: Likewise for test.
* tests/chmod/setgid: Likewise.
2008-04-20 23:18:48 +02:00
Jim Meyering
b29e812e82 * .prev-version: Record previous version: 6.11. 2008-04-19 23:29:02 +02:00
Jim Meyering
e347e9d722 Version 6.11.
* NEWS: Record release date.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-04-19 23:26:54 +02:00
Jim Meyering
87de29e6f0 * maint.mk (writable-files): Fix syntax error. 2008-04-19 16:47:26 +02:00
Jim Meyering
dc4a8e6280 * doc/.gitignore: Add texinfo-related outputs. 2008-04-19 15:23:40 +02:00
Sven Joachim
b021f59dfa * THANKS: Update my address, correct encoding for a name. 2008-04-19 13:46:52 +02:00
Jim Meyering
6856089f7b pr -e, with a mix of backspaces and TABs, could corrupt the heap
* tests/pr/Test.pm: New tests for the above.
* src/pr.c (char_to_clump): Ensure that "input_position" never
goes below 0.
Also, elide any backspace encountered when input_position is 0,
to be compatible at least with /bin/pr from Solaris 10.
This bug is present in the original version:
b25038ce9a
* NEWS [Bug fixes]: Mention this.
Report and diagnosis by Cristian Cadar, Daniel Dunbar and Dawson Engler
in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13272
2008-04-19 13:34:38 +02:00
Mike Frysinger
7e1075dd74 * src/dircolors.hin: Add .flv. Move .svgz to "image formats". 2008-04-19 08:52:08 +02:00
Jim Meyering
a85752ff4b md5sum -c: ignore a line with a NUL byte among checksum hex digits
* src/md5sum.c (hex_digits): Require that all "digest_hex_bytes"
be hexadecimal digits, not just those before the first NUL byte.
This bug dates back to the original version:
3763a4f24e
* tests/misc/md5sum (nul-in-cksum): Test for the above.
* NEWS [Bug fixes]: Mention this.
Prompted by a report from Flóki Pálsson in
http://bugzilla.redhat.com/439531
2008-04-19 00:24:55 +02:00
Matthew Woehlke
0d03baa068 tests: accommodate built-in mknod more cleanly still
* tests/mkdir/selinux: Use "env" rather than "nice".
2008-04-16 19:16:13 +02:00
Jim Meyering
57ae7da075 tests: accommodate built-in mknod more cleanly
* tests/mkdir/selinux: Undo most of previous change,
bc22dbbf84, and instead
invoke the command via "nice".  Using "exec" should be
enough, but isn't with OpenBSD's PD KSH v5.2.14 99/07/13.2.
Eric Blake suggested using nice.
2008-04-16 15:28:33 +02:00
Jim Meyering
9bb5e5e9af mknod --help: note that this command may be a shell built-in
* src/mknod.c (usage): Print USAGE_BUILTIN_WARNING.
Suggestion from Eric Blake.
2008-04-16 14:21:40 +02:00
Jim Meyering
d9cdf8ce28 avoid "may be used uninitialized" warning from newer gcc
* src/md5sum.c (digest_check) [lint]: Initialize local, "filename".
2008-04-16 11:20:28 +02:00
Jim Meyering
5d8b8d8b74 tests: add a comment explaining the potential failure 2008-04-16 11:17:37 +02:00
Jim Meyering
bc22dbbf84 tests: avoid mkdir/selinux failure when mknod is a shell built-in
* tests/mkdir/selinux: Skip the mknod test if it's a built-in.
2008-04-16 10:29:10 +02:00
Jim Meyering
7cb24684cc md5sum, sha1sum, etc: handle invalid input (i.e., don't segfault)
* src/md5sum.c (bsd_split_3): Return right away if s_len == 0.
* tests/misc/md5sum (bsd-segv): New test for the above.
* tests/misc/sha1sum (bsd-segv): Likewise.
* NEWS: Mention the bug fix.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
2008-04-15 08:46:48 +02:00
Jim Meyering
739cf4e832 tests: don't fail on systems without a "stat" syscall
* tests/test-lib.sh (require_strace_): Add a syscall parameter.
* tests/ls/stat-free-symlinks: Update caller.
* tests/mv/atomic: Likewise.
* tests/mv/atomic2: Likewise.
Reported by Mike Frysinger in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13222
2008-04-14 23:33:43 +02:00
Jim Meyering
08f2a71ee3 tests: accommodate a different errno string on Irix 6.5
* tests/mkdir/selinux: Also handle "Not supported".
Reported by Peter Fales.
2008-04-14 22:17:23 +02:00
Jim Meyering
4827dd27b0 seq: work around floating point inaccuracies on more systems
* src/seq.c: Include <math.h> for fabs.
Include <float.h> for DBL_EPSILON.
(abs_rel_diff): New function.
(print_numbers): Use abs_rel_diff rather than a strict equality test.
Without this change, Solaris 8 and Irix 6.2 would fail the float-6
test.  Reported by Peter Fales in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13183
* src/c99-to-c89.diff: Adjust seq.c offsets.
2008-04-14 11:29:20 +02:00
Jim Meyering
f91dec277a doc: fix typo
* coreutils.texi (sort invocation): s/Whitespace/White space/
2008-04-14 09:02:20 +02:00
Jim Meyering
512c906ca6 tests: Accommodate a different errno value on OSF/1 4.0F.
* tests/mkdir/selinux: Also handle "Function not implemented".
2008-04-12 13:14:29 +02:00
Jim Meyering
2ef40e9654 Avoid link failure when using mkstemp replacement.
* src/Makefile.am (tac_LDADD): Add $(LIB_CLOCK_GETTIME).
This is necessary at least on a DEC Alpha OSF/1 4.0F.
2008-04-12 12:43:24 +02:00
Jim Meyering
051c345f17 tests: always enable VERBOSE output, now that test framework works better
* cfg.mk: Set VERBOSE=yes.
* tests/check.mk: Likewise.
2008-04-12 09:52:42 +02:00
Jim Meyering
a899840bcc doc: avoid "make pdf" failure (due to texi2dvi bug?)
* doc/coreutils.texi (filesZeroFromOption):
Comment out @cindex-in-@macro use.
2008-04-11 12:11:06 +02:00
Jim Meyering
40c2d565ba doc: use a valid texinfo macro name
* doc/coreutils.texi (filesZeroFromOption): s/0/Zero/
2008-04-11 12:08:41 +02:00
Jim Meyering
eab0cebc76 tests: accommodate a different errno value on HPUX-10.20
* tests/mkdir/selinux: Also handle "Unknown system error".
Reported by Peter Fales.
2008-04-08 08:01:00 +02:00
Jim Meyering
8b3ec19019 doc: factor out --files0-from duplication
* coreutils.texi (wc invocation) [files0fromOption]: New macro.  Use it.
(du invocation): Use it here, too.
2008-04-06 22:10:18 +02:00
Jim Meyering
383b1e3b5c * src/c99-to-c89.diff: Adjust remove.c diffs. 2008-04-06 19:02:02 +02:00
Jim Meyering
9982e26c12 remove.c: accommodate systems with negative errno values
This is required at least on Haiku and BeOS.
* src/remove.c (write_protected_non_symlink): Return 1 for a write-
protected non-symlink, 0 if we determine it's not, and -1 upon
error (setting errno accordingly only in this final case).
(prompt): Deal with the changed semantics of the above function.
Based on this patch from Axel Dörfler:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071
2008-04-06 09:26:32 +02:00
Jim Meyering
2741677b28 Accommodate building on OS/2 (www.ecomstation.com Ecs v2 rc4)
* configure.in: Also filter out carriage returns from the value
of $no_install_progs_default.  Reported by Elbert Pol.
2008-04-05 12:13:57 +02:00
Jim Meyering
c1b6f9458a "touch E; mkfifo F; cp -fR F E" no longer fails due to existing E
* src/copy.c (copy_internal): Revert change of 2005-03-01,
4303f04545
Prompted by Michael Stone, who pointed me to an old bug report from
Ian Jackson: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/7504
* tests/cp/special-f: New file.  Test for the above.
* tests/cp/Makefile.am (TESTS): Add special-f.
* NEWS: mention this bug fix.
2008-04-02 18:23:04 +02:00
Jim Meyering
f3653f0d20 copy.c: remove an in-function #ifdef
* src/copy.c (rpl_mkfifo) [! HAVE_MKFIFO]: New function.
(mkfifo) [! HAVE_MKFIFO]: Define to rpl_mkfifo.
(copy_internal): Remove #ifdef.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-04-02 18:22:59 +02:00
Jim Meyering
184a0298f3 HACKING: rename README-contribution-guidelines
README-contribution-guidelines: Rename to ..
HACKING: ...this.
2008-04-02 09:08:08 +02:00
Jim Meyering
1fb8739c0b bootstrap: remove dangling *.[ch] symlinks from lib
* bootstrap [dangling symlink removal]: Match *.[ch] files, too.
Suggestion from Eric Blake.
2008-04-01 21:18:56 +02:00
Jim Meyering
a1a0b32bd7 bootstrap: make find's -depth option be the first.
* bootstrap [dangling symlink removal]: Move find's -depth
option to precede all others, to avoid a warning.
2008-04-01 17:12:12 +02:00
Jim Meyering
9b16f4cc8c * bootstrap: Remove dangling symlinks from lib (aka $source_base), too. 2008-04-01 17:05:31 +02:00
Jim Meyering
6e177448b9 Avoid root-only SELinux-related test failures w/o mcstransd.
When mcstransd is not running (i.e., after service mcstrans stop),
"make check" as root would provoke two test failures.
* tests/cp/cp-a-selinux: Use the context, root:object_r:tmp_t:s0,
that works both with and without mcstransd.
Thanks to Eric Paris for the tip and to Ondřej Vašík for alerting
me to the problem.
Reported by Robert Scheck in <http://bugzilla.redhat.com/436717>.
2008-04-01 16:34:08 +02:00
Jim Meyering
504fa74e24 root tests: Set NON_ROOT_USERNAME if not set already.
* tests/test-lib.sh (require_root_): This avoids failure of a
couple of root-only tests that require a value for that envvar.
2008-04-01 16:13:02 +02:00
Jim Meyering
157ff3506e texinfo formatting tweaks
* coreutils.texi: Avoid some overfull hbox warnings.
(Treating / specially): Use @file{/} rather than a bare /.
2008-04-01 12:06:10 +02:00
Jim Meyering
5916dec460 printf doc: xref print(3) and libc's "Output Conversion Syntax" node
* coreutils.texi (printf invocation): Add xref.
Use "The GNU C Library Reference Manual" as the name of the 'libc'
document consistently.
* man/printf.x: Add See also: printf(3).
Suggested by A. Costa in http://bugs.debian.org/465522
2008-04-01 12:06:05 +02:00
Jim Meyering
94251ff084 Emit "#line 1" right after the two 'read-only/GENERATED' lines.
* bootstrap (cp_mark_as_generated): This preserves line numbering
e.g., in assertions, which is important when correlating between
coreutils test failures and the original files in gnulib/tests.
Suggested by Eric Blake.
2008-03-31 22:42:35 +02:00
Jim Meyering
1a0104fc63 * README-contribution-guidelines: Mention how to amend a commit.
Suggestion from Pádraig Brady.
2008-03-31 17:28:23 +02:00
Jim Meyering
ed9120545f Begin documenting contribution guidelines.
* README-contribution-guidelines: New file.  For now, not distributed.
2008-03-31 17:14:30 +02:00
Jim Meyering
f433c3835f "rm -r DIR" would mistakenly prompt about very long names
* src/remove.c (write_protected_non_symlink): Return 0(-1) when
euidaccess_stat pronounces a writable(not-writable) file, not -1(0).
* tests/rm/deep-2: New file.  Test for the above-fixed bug.
* tests/rm/Makefile.am (TESTS): Add deep-2.
Discovered while reviewing this change:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13071
2008-03-31 13:46:34 +02:00
Jim Meyering
0d34887fe9 * NEWS: Note the dd bug fix. The bug was introduced over 8 years ago:
9fca49f67c
2008-03-31 09:11:15 +02:00
Paul Eggert
e373bb1933 dd bug fix: accept e.g., if=/dev/stdin and of=/dev/stdout
* lib/fd-reopen.c: Work even if FILE is "/dev/stdin".
Problem reported by Geoffrey Lee in <http://bugs.debian.org/290727>.
* tests/dd/misc: Check for this bug.
2008-03-31 08:37:58 +02:00
Jim Meyering
72e962c97e avoid failure of new test on kernel without SELinux support
* tests/mkdir/selinux: Also accept ENOENT.
Reported by Sven Joachim.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-29 22:43:46 +01:00
Jim Meyering
0ec483f365 tests: accept ENOTSUP message as well as the EINVAL one
This test would fail on most non-Linux systems because the original
expected an "Invalid argument" diagnostic, yet they all produced
"Operation not supported".
* tests/mkdir/selinux: Accept both strings.  Factor out duplication.
2008-03-29 10:00:44 +01:00
Jim Meyering
76576ba2f5 Work around a recent glibc/getopt.c diagnostic change.
* tests/misc/factor: Map new "-- '1'" to expected "-- 1".

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-29 00:11:52 +01:00
Jim Meyering
eb8fa94f2c mknod, mkfifo: don't segfault when diagnosing invalid SELinux context
Identical to the bug fixed by 72d052896a.
* src/mkfifo.c (main): Use "scontext", not NULL optarg in diagnostic.
* src/mknod.c (main): Likewise.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
* tests/mkdir/selinux: Test for the above fixes.
* NEWS: Mention the fixes.
2008-03-28 23:03:27 +01:00
Jim Meyering
cdb16829a6 Fix typo in old NEWS and ChangeLog: s/commmand/command/.
* ChangeLog-2007: Likewise.
* NEWS: Likewise.
Prompted by http://bugzilla.redhat.com/439410
2008-03-28 20:20:49 +01:00
Pádraig Brady
dc16dc835c tests: Factor out code that's going to be reused.
* tests/test-lib.sh (mkfifo_or_skip_): New function, factored out of...
* tests/touch/fifo: ...here.
2008-03-28 14:33:27 +01:00
Jim Meyering
17720c10cd Require that "(exit $fail); exit $fail" be last line of each test.
* maint.mk (sc_require_test_exit_idiom): New rule to enforce policy.
* tests/cp/acl: Adhere to the new policy.
* tests/cp/preserve-gid: Likewise.
* tests/dd/misc:
* tests/install/create-leading:
* tests/ln/sf-1:
* tests/ls/symlink-slash:
* tests/misc/help-version:
* tests/misc/ls-time:
* tests/misc/nice:
* tests/misc/shred-remove:
* tests/misc/stty:
* tests/misc/stty-row-col:
* tests/mkdir/p-1:
* tests/mkdir/p-2:
* tests/mkdir/p-3:
* tests/mkdir/p-v:
* tests/mkdir/special-1:
* tests/mkdir/writable-under-readonly:
* tests/mv/acl:
* tests/mv/backup-is-src:
* tests/mv/diag:
* tests/mv/dir-file:
* tests/mv/force:
* tests/mv/hard-link-1:
* tests/mv/i-2:
* tests/mv/i-4:
* tests/mv/into-self:
* tests/mv/into-self-2:
* tests/mv/into-self-3:
* tests/mv/partition-perm:
* tests/mv/to-symlink:
* tests/rmdir/ignore:
* tests/tail-2/assert:
* tests/tail-2/assert-2:
* tests/touch/dangling-symlink:
* tests/touch/dir-1:
* tests/touch/empty-file:
* tests/touch/fifo:
* tests/touch/no-rights: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-28 14:21:28 +01:00
Jim Meyering
818dbee8dc Perform explicit exit-nonzero if the embedded Perl script fails.
* tests/misc/pwd-long: Add canonical '(exit $fail); exit $fail'.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-28 14:21:27 +01:00
Jim Meyering
b58a8b4ef5 paste -d\\: avoid heap overrun for backslash at end of delim list
* src/paste.c: Include "quotearg.h".
(collapse_escapes): Handle backslash-escaped backslash explicitly.
Handle unescaped backslash at end of string by returning nonzero,
rather than by overrunning memory.
(main): Diagnose an invalid delimiter list -- carefully.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
* tests/misc/paste-no-nl (delim-bs): Add a test to demonstrate the
heap-smashing capability.
(delim-bs2): Prior to coreutils-5.1.2, this bug was a little harder
to demonstrate: it would corrupt a first-argument containing e.g., \b
* NEWS: Mention the bug fix.
* tests/misc/Makefile.am (TESTS): Reflect renaming.
* tests/misc/paste: Rename from paste-no-nl.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-27 13:32:38 +01:00
Jim Meyering
6743f81136 * src/join.c (keycmp): Document new parameters. 2008-03-26 01:17:15 +01:00
Jim Meyering
0e5381fe93 Test for mkdir bug fix.
* tests/mkdir/selinux: New file: test for today's fix.
* tests/mkdir/Makefile.am (TESTS): Add selinux.
2008-03-26 01:11:16 +01:00
Daniel Dunbar
72d052896a mkdir -Z x d: don't segfault when diagnosing invalid context "x" (tiny change)
* src/mkdir.c (main): Use "scontext", not NULL optarg in diagnostic.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
* NEWS: Mention the bug fix.
2008-03-26 00:57:29 +01:00
Peter Fales
f7d1c59c22 id bug fix: don't point to potentially clobbered static storage
On at least Mac OS, when calling getpwuid twice with the same UID,
the static storage containing results from the first call is
invalidated by the second call.
* src/id.c (main): Point to a copy of the user name string.
2008-03-25 22:47:15 +01:00
Eric Blake
5f2ea441ac Use new gnulib gnumakefile module.
* bootstrap.conf (gnulib_modules): Pull in new module.
* GNUmakefile: Remove from version control.
* .gitignore: Update.
* configure.ac (AC_CONFIG_LINKS): Delete; rely on gnulib to do
this now.
* Makefile.am (EXTRA_DIST, distclean-local): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-25 21:56:39 +01:00
Jim Meyering
da9f5e7fdf join bug fix: adapt keycmp to work with new order-checking feature
* src/join.c (keycmp): Add two join-field parameters.
(check_order, join): Update callers.
Reported by Dmitry V. Levin in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12731/focus=13017
* tests/join/Test.pm (chkodr-7): New test for this fix.
2008-03-25 19:10:10 +01:00
Jim Meyering
157a274da5 join.c: syntax/style tweaks
* src/join.c (check_order): Rename from checkorder.
Move definition to precede first use and remove prototype.
Use EXIT_FAILURE, rather than "1".
(key_cmp): Move definition to precede first use.
2008-03-23 11:18:38 +01:00
Jim Meyering
1a7f64b157 portability: work around a "busybox sed" limitation
* configure.ac: While every other sed tested supports usage like
'/\(re\)/{s//\1/;...<NEWLINE>}', and POSIX appears to requires this,
busybox's sed does not support it.  So duplicate the regexp:
'/\(re\)/{s/\(re\)/\1/;...<NEWLINE>}'.  Reported by Vincent Lefevre:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>.
2008-03-22 19:13:34 +01:00
Jim Meyering
c3869f6564 * src/c99-to-c89.diff: Adjust seq.c offsets. 2008-03-21 21:01:10 +01:00
Jim Meyering
a0851554bd ptx: avoid heap overrun for backslash at end of optarg string
* src/ptx.c (copy_unescaped_string): Ignore a lone backslash
at end of string.  Reported by Cristian Cadar, Daniel Dunbar
and Dawson Engler.  Details here:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13005>.
* tests/misc/Makefile.am (TESTS): Add ptx-overrun.
* tests/misc/ptx-overrun: New file.  Test for the above fix.
* NEWS: Mention the fix.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-21 20:58:15 +01:00
Jim Meyering
4f812540a2 ptx.c readability
* src/ptx.c (copy_unescaped_string): Add braces around 80+-line
single-stmt while-loop body.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-21 20:58:15 +01:00
Jim Meyering
6e5bbc267a Write NEWS and update c99-to-c89 patch for today's rm improvement.
* NEWS: call this a "portability improvement" ;-)
* src/c99-to-c89.diff: Adjust remove.c offsets.
2008-03-21 16:01:29 +01:00
Ingo Weinhold
e73dfc3899 remove.c: Accommodate systems with negative errno values.
* src/remove.c (cache_fstatat): Store errno value directly in
the st_ino field, rather than trying to shoehorn it into st_size.
This is required at least on BeOS and Haiku.
2008-03-21 16:01:29 +01:00
Jim Meyering
18ce670a33 * src/seq.c (long_double_format): Add a comment. 2008-03-21 15:59:41 +01:00
Jim Meyering
04f1470c51 * GNUmakefile: Update from gnulib. 2008-03-21 00:33:26 +01:00
Jim Meyering
677610ec7c Remove today's automake kludge, altogether. Fix properly.
* man/Makefile.am: Use dist_man1_MANS instead of dist_man_MANS.
Suggestion from Ralf Wildenhues.
2008-03-20 19:04:50 +01:00
Jim Meyering
ba4b9d9d6e Add a check to detect this problem, in case it reappears.
* maint.mk (my-distcheck): Run "make install", and then ensure
that ls.1 is installed.
2008-03-20 18:43:03 +01:00
Jim Meyering
4682f132f2 Kludge to make automake generate install-man rules
* man/Makefile.am (dist_man_MANS): Add a literal, rm.1.
Without this, "make install" would not install man pages.
However, with this kludge, the rm.1 man page is installed
even when you configure with --enable-no-install-program=rm.
2008-03-20 18:01:35 +01:00
Jim Meyering
8058da0065 Revert recent man/Makefile.am change.
Revert 4b544e447e.
* man/Makefile.am: That change was only a band-aid.  It solved
the stated problem, but not a deeper one: that "make install"
would no longer man pages.  Reported by Dmitry V. Levin.
The latter problem arose in
167b8025ac with the removal of
the sole literal from the definition of dist_man_MANS.  When
automake perceives dist_man_MANS as empty, it no longer emits
the install-man* rules.
2008-03-20 17:59:44 +01:00
Eric Blake
2c7bed000e Sync GNUmakefile with gnulib.
* GNUmakefile (Makefile.cfg): Rename...
(cfg.mk): ...to this, and make optional.
(GNUmakefile.cfg): Delete, redundant with cfg.mk.
(Makefile.maint): Rename...
(maint.mk): ...to this.
(all) [!_have-Makefile]: Rename...
(abort-due-to-no-makefile): ...to this, and invoke via
.DEFAULT_GOAL to pick up all targets.
* Makefile.cfg: Rename...
* cfg.mk: ...to this.
* Makefile.maint: Rename...
* maint.mk ...to this.
(ME): Reflect rename.
(makefile-check, m4-check, author_mark_check, msg): Use $(ME)
rather than hard-coded name.
* Makefile.am (EXTRA_DIST): Distribute renamed files.
* .x-sc_file_system: Remove Makefile.maint along with others. No longer needed.
* .x-sc_obsolete_symbols: Likewise.
* .x-sc_prohibit_atoi_atof: Reflect renaming and remove no-longer-VC'd names.
* TODO: Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-20 14:52:55 +01:00
Bob Proulx
9e2ed5521d make check: Remove /tmp/ls-creating debug code.
* tests/misc/ls-misc: Remove debug code creating /tmp/ls.
2008-03-19 23:52:16 +01:00
Jim Meyering
22e66dfc12 bootstrap: restore kludge removed on 2008-03-12: it's still necessary.
* bootstrap: Make the gnulib-tests/test-*.sh scripts executable.
This restores code removed by dec8bb25bb.
Reported by Bob Proulx.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-19 23:50:19 +01:00
Jim Meyering
092239c608 Check for -- and remove -- some unnecessarily included header files.
* Makefile.maint: Add checks for a handful of additional header files.
* src/mktemp.c: Don't include "long-options.h".  Not used.
* src/pr.c: Don't include "inttostr.h".  Not used.
* src/printenv.c: Don't include "error.h".  Not used.
* src/test.c: Don't include "error.h".  Not used.
* src/touch.c: Don't include "safe-read.h".  Not used.
2008-03-19 16:48:32 +01:00
Jim Meyering
116f832b45 Remove more vestiges of CVS.
* Makefile.maint (VC_LIST): Rename from CVS_LIST.
(VC_LIST_EXCEPT): Rename from CVS_LIST_EXCEPT.
2008-03-19 14:34:11 +01:00
Jim Meyering
63feb84a2d mv: never unlink a destination file before calling rename
While cp --preserve=links must unlink certain destination files,
mv must never do that.
* src/copy.c (copy_internal): Pull the '! x->move_mode' test "up",
so it affects the entire condition, and not just DEREF_NEVER mode.
Reported by James Ralston in <http://bugzilla.redhat.com/438076>.
* tests/mv/atomic2: New file.  Test for the above fix.
* tests/mv/Makefile.am (TESTS): Add atomic2.
* NEWS: Mention the bug-fix.
[Bug introduced in 367719ba5f]
2008-03-19 13:38:27 +01:00
Jim Meyering
4b544e447e "make" would not always update man/*.1 files (but "make dist" would)
* man/Makefile.am (BUILT_SOURCES): Define, so that "make" always
updates man/*.1 files.  Reported by Bob Proulx.
2008-03-19 08:46:41 +01:00
Jim Meyering
2708cd9ca0 syntax-check: Make the space-before-open-paren optional.
* Makefile.maint (sc_prohibit_assert_without_use): Match also
when there is no space before the opening parenthesis.
(sc_prohibit_getopt_without_use): Likewise.
(sc_prohibit_quotearg_without_use): Likewise.
(sc_prohibit_quote_without_use): Likewise.
2008-03-18 23:51:58 +01:00
Jim Meyering
7feeb7cf23 * Makefile.maint (sc_no_have_config_h): Use a more precise regexp. 2008-03-18 23:44:53 +01:00
Jim Meyering
8378eca4d4 * Makefile.maint (CVS): Remove now-unused definition. 2008-03-18 23:40:41 +01:00
Jim Meyering
e3b22389a8 Factor out duplication in sc_prohibit_*_without_use rules.
* Makefile.maint (_header_without_use): New "command",
factored out of four sc_prohibit_HEADER_without_use rules.
(sc_prohibit_assert_without_use): Rewrite using $(_header_without_use).
(sc_prohibit_getopt_without_use): Likewise.
(sc_prohibit_quotearg_without_use): Likewise.
(sc_prohibit_quote_without_use): Likewise.
2008-03-18 21:32:03 +01:00
Dmitry V. Levin
29ff7a3943 Correct typo in "make syntax-check" diagnostic.
* Makefile.maint (sc_prohibit_getopt_without_use): s/assert.h/getopt.h/
2008-03-18 20:33:36 +01:00
Jim Meyering
0ecdb0a52a Prohibit inclusion of getopt.h without use.
* Makefile.maint (sc_prohibit_getopt_without_use): New rule.
2008-03-16 19:04:29 +01:00
Jim Meyering
12ff1eb9b9 Include <getopt.h> only if used.
* src/group-list.c: Don't include <getopt.h>.
* src/printf.c: Likewise.
2008-03-16 19:04:29 +01:00
J. Scott Edwards
c960211fe7 sha512_process_bytes: fix a bug in processing a buffer where length&64 != 0
* gl/lib/sha512.c (sha512_process_bytes): s/63/127/.
2008-03-16 19:04:24 +01:00
Jim Meyering
a5d8b18bea Generalize GNUmakefile, ...
...so that it can be used unmodified by autoconf.
* GNUmakefile: Include optional file, GNUmakefile.cfg.
Autoconf will use this to override _autoreconf and to export PATH.
(_autoreconf): Define.
(_dummy): cd to $(srcdir) before removing autom4te.cache.
2008-03-12 13:52:51 +01:00
Jim Meyering
dec8bb25bb * bootstrap: Sync from gnulib and remove part of a local kludge. 2008-03-12 11:47:53 +01:00
Ondřej Vašík
9c393fa194 install, rmdir: write --verbose output to stdout, not to stderr.
* src/install.c (announce_mkdir): Write verbose output to stdout,
not to stderr.
* src/mkdir.c (announce mkdir): Use prog_fprintf for verbose output.
* src/prog-fprintf.c (prog_fprintf): New function and file.
* src/prog-fprintf.h: New file.
* src/rmdir.c (main): Write verbose output to stdout, not to stderr.
Quote directory name in a diagnostic.
* src/rmdir.c (remove_parents): Write verbose output to stdout,
not to stderr.
* doc/coreutils.texi: Mention that shred verbose output is to stderr.
* NEWS: Mention the changes.

Signed-off-by: Ondřej Vašík <ovasik@redhat.com>
2008-03-10 19:47:15 +01:00
Jim Meyering
3c7a6ae340 make syntax-check: also check src/*.h files for extern functions,
* src/Makefile.am (sc_tight_scope): ... now that there is one.
2008-03-10 19:23:41 +01:00
Jim Meyering
381e69eace dd: avoid unnecessary, but harmless close_stdout call.
* src/dd.c (close_stdout_required): New global.
(maybe_close_stdout): New function.
(main): Set the global.
Reported by Ulrich Drepper in http://bugzilla.redhat.com/436368
2008-03-07 12:21:37 +01:00
Jim Meyering
c58c2ea3e4 Now that ChangeLog is no longer under version control, ...
* Makefile.maint (alpha beta major): Don't make changelog-check.
(changelog-version-check): Rename from changelog-check.
2008-03-06 14:33:20 +01:00
Jim Meyering
d44893c5db * src/c99-to-c89.diff: Accommodate a C99-ism in id.c. 2008-03-05 11:38:30 +01:00
ribalba
b7a836c0a3 Work around AFS bug: id and groups would print invalid group number.
* src/id.c (main): Call print_group_list with a user name, if possible.
* src/groups.c (main): Likewise.
* NEWS: Mention this.
For details, see
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12852
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12875

Signed-off-by: ribalba <geerd.dietger.hoffmann@gmail.com>
2008-03-05 11:38:26 +01:00
Jim Meyering
f5d58041d5 Now that Makefile.maint is used in VPATH builds, too...
* Makefile.maint (prev_version_file): Prefix with $(srcdir)/.
(syntax-check-rules): Prefix $(ME) with $(srcdir)/.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-05 10:36:21 +01:00
Jim Meyering
c7d33788e0 Avoid new "make distcheck" failure, now that VPATH has GNUmakefile.
* GNUmakefile: Remove commands to create ".version".
They were unnecessary, and caused creation of a newer .version
file in a VPATH build, which in turn caused creation of updated
man/*.1 files reflecting the newer time stamp on .version.
Those *.1 files were not removed (since they're distributed), and
the fact that they remained after "distclean" triggered the failure.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-05 10:36:21 +01:00
Eric Blake
07bc841590 Reinstate GNUmakefile patch, but with workaround for automake.
* configure.ac (AC_CONFIG_LINKS): Use shell variable to bypass
automake distclean rules.
* Makefile.am (distclean-local): Clean GNUmakefile in VPATH builds,
since we are bypassing automake.
* GNUmakefile (_is-dist-target): 'distclean' is not a dist target.
2008-03-04 20:54:45 +01:00
Jim Meyering
dd647e78ca Clarify comment and attribute preceding change: Reported by Ralf Wildenhues. 2008-03-04 12:59:40 +01:00
Jim Meyering
87a2903cca Comment out yesterday's VPATH-friendly addition, for now.
* configure.ac: ...while we wait for a fixed version of automake.
2008-03-04 12:56:45 +01:00
Eric Blake
137c167a16 Use m4_PACKAGE_VERSION, not AC_AUTOCONF_VERSION.
* configure.ac: The latter is only in post-2.61 autoconf.
2008-03-03 23:52:19 +01:00
Eric Blake
8eacedd3b5 GNUmakefile build tweaks.
* GNUmakefile: When Makefile is not present, make common targets depend
on "all" in order to trigger nicer error message.
* configure.ac: If autoconf is new enough, link GNUmakefile into VPATH
builds.
For more details, see
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/12853>.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-03 21:19:10 +01:00
Simon Josefsson
dcc543f44c Define SHA*_DIGEST_SIZE symbols.
* gl/lib/sha256.h (SHA224_DIGEST_SIZE, SHA256_DIGEST_SIZE): Define.
* gl/lib/sha512.h (SHA384_DIGEST_SIZE, SHA512_DIGEST_SIZE): Define.
2008-03-03 08:56:52 +01:00
Ralf Wildenhues
b22067a582 Fix so that out-of-tree VPATH "make dist" works, too.
* GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument.
2008-03-02 22:18:37 +01:00
Jim Meyering
cce03822fc One more for non-srcdir "make dist".
* GNUmakefile: Also cd $(srcdir) before running autoreconf.
2008-03-02 16:33:53 +01:00
Jim Meyering
b4be756402 Adjust so that non-srcdir "make dist" works, too.
* GNUmakefile: Add $(srcdir)/ prefix to git-version-gen and argument.
2008-03-02 16:24:52 +01:00
Jim Meyering
e8139f2768 Don't infringe namespace of "sub"-Makefiles.
* GNUmakefile (_dummy, _have-Makefile): Add "_" prefix.
2008-03-02 16:13:02 +01:00
Jim Meyering
f33599c144 Create sha256 and sha512 modules and move files into gl/.
* bootstrap.conf (gnulib_modules): Add sha256 and sha512.
* m4/prereq.m4: Don't require gl_SHA256 or gl_SHA512.
* gl/modules/sha512: New file.
* gl/modules/sha256: New file.
* m4/sha256.m4: Move to ...
* gl/m4/sha256.m4: ...here, removing use of AC_SOURCES.
* m4/sha512.m4: Move to ...
* gl/m4/sha512.m4: ...here, removing use of AC_SOURCES.
* lib/sha256.c, lib/sha256.h: Move to ...
* gl/lib/sha256.c, gl/lib/sha256.h: ...here.
* lib/sha512.c, lib/sha512.h: Move to ...
* gl/lib/sha512.c, gl/lib/sha512.h: ...here.
* lib/u64.h: Move to ...
* gl/lib/u64.h: ...here.
2008-03-02 12:16:49 +01:00
Jim Meyering
39fc8c581b * bootstrap: Remove only *.m4, and only from $m4_base/. Rewrite the comment. 2008-03-02 10:46:48 +01:00
Jim Meyering
d622ad088b * bootstrap: Sync from gnulib. 2008-03-02 10:14:58 +01:00
Jim Meyering
5a0b032e9e Don't skip the groups-version test.
* tests/Makefile.am (built_programs): Remove unused definition.
* src/Makefile.am (built_programs.list): Print a space-separated
list of program names, not NL-separated, since all clients now
expect a space-separated list.
2008-03-01 10:50:35 +01:00
Jim Meyering
e81d5a49b7 Don't exempt "groups" from write-failure test, now that it's a C program.
* tests/misc/help-version: Since groups is no longer a shell
script, a buggy bourne shell can't cause trouble.
2008-03-01 10:39:12 +01:00
Jim Meyering
710e5f32fc * configure.ac (AC_INIT): Use .tarball-version, not .version. 2008-03-01 10:01:09 +01:00
Jim Meyering
46e51208c7 Don't depend on gnulib's deprecated "free" module.
* bootstrap.conf (obsolete_gnulib_modules): Remove free.
* gl/modules/mgetgroups (Depends-on): Remove free.
2008-03-01 09:56:56 +01:00
Jim Meyering
d2177c280c Merge bootstrap changes from gnulib.
* bootstrap (MSGID_BUGS_ADDRESS): Define and use.
(version_controlled_file): Use "git rm", not "git-rm".
2008-02-29 13:36:00 +01:00
Jim Meyering
0dc92c8fde Use "git tag", not "git-tag", in preparation for git-1.6.0.
* Makefile.maint (VC-tag): Remove '-': s/git-tag/git tag/
2008-02-29 13:35:52 +01:00
Jim Meyering
3bb1783158 Make copyright comments consistent.
* src/mktemp.c: Update copyright to use newer form.

Make first copyright lines consistent. Some did not end in ", Inc.".
Due to that missing ", Inc" at end of line, emacs' copyright-updating
code missed some opportunities.  This corrects most of those, and
adds some mistakenly omitted years.
* src/chown-core.c: Adjust.
* src/chown-core.h: Likewise.
* src/copy.c: Likewise.
* src/copy.h: Likewise.
* src/cp-hash.c: Likewise.
* src/cp.c: Likewise.
* src/group-list.h: Likewise.
* src/mktemp.c: Likewise.
* src/stat.c: Likewise.
* tests/chmod/equal-x: Likewise.
* tests/dd/skip-seek: Likewise.
* tests/envvar-check: Likewise.
* tests/mv/into-self-2: Likewise.
2008-02-28 19:53:07 +01:00
Bob Proulx
fcdf32c159 Fix test failure where rm would appear to succeed incorrectly.
* tests/rm/fail-eperm: Ignore files that were opportunistically chosen
to test permission failures but disappear before we can finish the test.
2008-02-25 21:03:53 +01:00
Jim Meyering
9396e9104e * gl/lib/mgetgroups.c (mgetgroups): Parenthesize correctly. 2008-02-24 18:12:15 +01:00
Jim Meyering
dacff7cb2b * gl/lib/mgetgroups.c: Include <stdlib.h>. 2008-02-24 14:56:19 +01:00
Jim Meyering
f656cafd4c Avoid test failures when root (/) is not readable.
* tests/test-lib.sh (require_readable_root_): New function.
* tests/misc/pwd-long: Skip this test when / is unreadable.
* tests/du/slash: Likewise.
This is required at least for Mandrake/Mandriva in "secure" mode.
Reported by Theodoros V. Kalamatianos in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12800
2008-02-23 23:25:17 +01:00
Jim Meyering
a15329798c id: avoid race when a group is added between getgrouplist calls
* gl/lib/mgetgroups.c (mgetgroups) [N_GROUPS_INIT]: Rename enum.
Use a larger value.
Update *groups only upon success.
Iterate upon failed getgrouplist.
2008-02-22 20:47:54 +01:00
James Youngman
49f7ebaac4 id: use getgrouplist when possible
* gl/m4/mgetgroups.m4: Check for getgrouplist.
* gl/lib/mgetgroups.c (mgetgroups): Use getgrouplist, if available.
* TODO: Remove the item about switching to getgrouplist.
* NEWS: mention this
2008-02-21 15:02:07 +01:00
Paul Eggert
bf9e98344d du vs. hard links and argument order: improve documentation
* doc/coreutils.texi (du invocation): Document default behavior on
hard links, and why argument order matters.
2008-02-21 09:40:07 +01:00
James Youngman
0f8faebb97 join: avoid new leaks
* src/join.c (prevline): Make prevline module-level static, so that
the allocated items can be freed at exit.
(free_prevline): new atexit function; frees items in prevline[].
Use ARRAY_CARDINALITY, so include "argmatch.h" to get that.
(main): Arrange for free_prevline to be called during exit.
(get_line): Free prevline[which - 1] also, as that
will have been allocated by dup_line.
2008-02-20 21:44:53 +01:00
Jim Meyering
d2d9234098 Remove xdelta support, clean up distcheck process.
* Makefile.maint (writable-files): Don't create $(release_archive_dir).
(my-distcheck): Don't depend on prev-tgz.
Remove xdelta-related variables and uses.
(alpha beta major): Skip steps if $(release_archive_dir) doesn't exist.
2008-02-20 19:33:56 +01:00
Jim Meyering
a1ec12dad6 * bootstrap: Remove dangling symlinks before invoking aclocal. 2008-02-20 19:29:28 +01:00
Andreas Schwab
cb3147d298 sort: add --sort=... option.
* src/sort.c (SORT_OPTION): New enum.
(sort_args, sort_types): Define.
(usage, long_options, main): New option --sort.
* tests/sort/Test.pm: Test it.
* doc/coreutils.texi (sort invocation): Document --sort option.
* NEWS: Mention this.
2008-02-20 08:41:29 +01:00
Jim Meyering
c78039b87d 2008-02-19 Jim Meyering <meyering@redhat.com>
* TODO: Remove final seq-related item.
2008-02-19 18:20:46 +01:00
Jim Meyering
59b803e3d0 * src/c99-to-c89.diff: Adjust seq.c offsets. Accommodate a new C99-ism. 2008-02-19 15:41:16 +01:00
Steven Schubiger
4f3ff2e700 seq: give better diagnostics for invalid formats.
* src/seq.c: (validate_format): New function.
(main): Use it.
* tests/misc/seq (fmt-d, fmt-e): Test for expected diagnostics with
invalid formats.
* NEWS: Mention this change.
* TODO: Remove this item.
[jm: src/seq.c: make diagnostics more consistent
 tests/misc/seq (fmt-eos1): adjust the expected diagnostic ]
2008-02-19 15:41:16 +01:00
James Youngman
a1e715698a join: new options: --check-order and --nocheck-order.
* src/join.c: Support --check-order and --nocheck-order.
New variables check_input_order, seen_unpairable and
issued_disorder_warning[]. For --check-order, verify that the
input files are in sorted order.  For the default case, check the
order only if there are unpairable lines.
(join): Perform ordering checks after reaching EOF on either
input.
(usage): Mention --check-order and --nocheck-order.
(dupline): Save a copy of the previously-read input line so that
we can detect disorder on the input.
(get_line): Temporarily save a copy of the previous line (by
calling dupline) and check relative ordering (by calling
checkorder) before returning the newly-read line.
(getseq, join): Tell get_line which file we are reading from.
(advance_seq): New function, factoring out some of the code
commonly surrounding calls to getseq.
(checkorder): New function.  Verifies that a pair of consecutive
input lines are in sorted order.
* doc/coreutils.texi (join invocation): Document the new options
--check-order and --nocheck-order.
* tests/join/Test.pm (tv): Added tests for --check-order and
--nocheck-order.
* NEWS: Mention this new feature.
2008-02-19 15:17:39 +01:00
James Youngman
4242d4f5c4 Fix non-srcdir "make distcheck" failure.
* Makefile.am (check-ls-dircolors): Look for sources under
$(srcdir), not under ".".
2008-02-19 13:31:56 +01:00
Jim Meyering
b8108fd2dd seq: give a proper diagnostic for an invalid --format=% option
* src/seq.c (long_double_format): Handle '%' at end of string.
* tests/misc/seq [fmt-eos1, fmt-eos2]: New tests for the bug.
* NEWS: Mention this.
Reported by Pádraig Brady.
2008-02-18 18:38:52 +01:00
Jim Meyering
1d96b88c66 .gitignore, src/.gitignore: ignore more 2008-02-17 12:20:17 +01:00
Jim Meyering
38bfb60c11 Clean up Makefile.maint.
* Makefile.maint: Remove obsolete comments.
(local-checks-available): Remove changelog-check.
2008-02-17 11:16:18 +01:00
Jim Meyering
f0bafdb427 Clean up ls.c.
* src/ls.c (put_indicator): Use fwrite, not a loop.
2008-02-17 11:16:18 +01:00
Jim Meyering
ace5387fb6 Ensure that dircolors.c and ls.c remain in sync.
* Makefile.am (check-ls-dircolors): New rule.
(distcheck-hook): Depend on it.
2008-02-17 11:16:18 +01:00
Jim Meyering
bbb82c231a Expand "ls --color" tests to also use the dircolors defaults.
* tests/misc/ls-misc: Adjust this test so each is run twice.  First, as usual,
and the second time with LS_COLORS set using the default settings
produced by running dircolors.
* tests/Coreutils.pm: See below.

This required some changes:
  - save and restore $ENV{LS_COLORS} for each individual test
  that requires a specific value.
  - Since this is the first test to call the run_tests command more
  than once, it has exposed that that function erroneously modifies
  the \@Tests array.  Fix that in tests/Coreutils.pm.
2008-02-17 11:16:18 +01:00
Jim Meyering
5b9f908ce3 Adjust dircolors to match ls.c.
* src/dircolors.hin: comment out NORMAL and FILE, define RESET.
* src/dircolors.c (slack_codes) Add "RESET".
(ls_codes): Add "rs".
2008-02-17 11:16:18 +01:00
Ed Avis
483297d5dd ls --color no longer outputs unnecessary escape sequences
In --color mode, plain files do not get any color, not even white.
When no highlighting is required, ls outputs no escape sequence at all.
* src/ls.c (print_with_color):
(used_color): New global.
(indicator_no) [C_RESET]: New enum value.
(indicator_name) ["rs"]: Corresponding new string.
(color_indicator): Make the 'normal' and 'file' markers be NULL.
Use "rs" (C_RESET) to reset to ordinary colors.
(process_signals): Restore default colors only if necessary.
(main): Don't call prep_non_filename_text here.
(print_name_with_quoting): Call it here, instead.
(prep_non_filename_text): Use C_RESET, not C_NORM.
(print_color_indicator): Return bool, not void.
Print nothing, when possible.
(put_indicator): Call prep_non_filename_text the first time.
* tests/misc/ls-misc: Test for above.
* tests/ls/color-dtype-dir: Adapt: no escapes around regular file name.
* TODO: Remove item.
* NEWS: Mention this.
2008-02-17 11:16:08 +01:00
Dan Jacobson
7dc26da47c ls: Improve description of --group-directories-first.
* src/ls.c (usage) [--group-directories-first]: Improve description.
* doc/coreutils.texi (Which files are listed): Likewise.
2008-02-17 08:53:28 +01:00
Jim Meyering
526e43a1c2 Avoid tests/cp/acl test failure.
* tests/check.mk (TESTS_ENVIRONMENT) [CONFIG_HEADER]: Define
to an absolute name, so it can be used from any point in the
test hierarchy.  Reported by James Youngman.
2008-02-16 23:10:45 +01:00
James Youngman
2c42c1c2ce Use the gettime module in ls.c.
Implement TODO list item to make ls.c use the gettime module.
* TODO (ls): Now that we use gettime, remove the TODO entry.
* src/ls.c: Use timespec.h and the gettime module.
(current_time): Change type from time_t to struct timespec.
(current_time_ns): Removed.
(get_current_time): Removed.
(print_long_format): Remove when and when_ns, since we have
when_timespec anyway.  Change type of variable six_months_ago from
time_t to struct timespec.
2008-02-16 19:30:55 +01:00
Jim Meyering
cc8b73b1d9 groups: don't test printf and putchar calls for failure
They are unnecessary, since we use gnulib's closeout module.
* src/group-list.c (print_group): Remove explicit error tests.
* src/groups.c (main): Likewise.
(write_error): Remove function.
2008-02-14 11:31:57 +01:00
James Youngman
167b8025ac Replace groups.sh with groups.c.
* src/groups.c (main): New file, replacing groups.sh.
* src/group-list.c, src/group-list.h: New files, factored out of id.c,
implementing the functionality that "id" and "groups" have in common.
* src/id.c (print_full_info): Avoid a segfault when trying to print
an error message if getgroups fails.
(print_group_list): Move to group-list.c.
(print_group): Likewise.
* man/Makefile.am: When building groups.1, obtain the help text
from src/groups.c, not src/groups.sh.
(noinst_HEADERS): Add group-list.h.
(group): Remove rule.
(dist_man_MANS): Remove groups.1.
* doc/coreutils.texi (groups: Print group names a user is in):
Explain why "groups" and "groups $(id -un)" give different results
in existing login sessions after you change the group database.
(id: Print user identity): Likewise for "id".
* po/POTFILES.in: Add src/group-list.c and src/groups.c.
* NEWS: mention this.
* AUTHORS: Update.
2008-02-13 14:37:22 +01:00
Jim Meyering
0601086bd8 Move more test_skip_-using code to follow ". test-lib.sh".
* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-12 18:48:14 +01:00
Peter Fales
70a2bd1864 tests/touch/not-owner: Source test-lib.sh before using skip_test_.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-12 18:48:14 +01:00
Jim Meyering
31d7d5d8c8 * tests/Makefile.am (EXTRA_DIST): Remove strace. 2008-02-12 00:10:06 +01:00
Jim Meyering
6ed90c719e tests: Migrate sourced strace file into a function, require_strace_.
* tests/strace: Remove file.
* tests/test-lib.sh (require_strace_): New function.
* tests/mv/atomic: Use require_strace_, rather than ". strace".
* tests/ls/stat-free-symlinks: Likewise.
Peter Fales reported that stat-free-symlinks failed without strace.
2008-02-11 21:44:54 +01:00
Jim Meyering
5b954a8756 * tests/rm/inaccessible: Source test-lib.sh *before* using skip_test_.
Reported by Peter Fales.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-11 21:40:07 +01:00
Jim Meyering
2746a6c05c Ensure there are no removable (useless) if-before-free tests.
* bootstrap.conf (gnulib_modules): Add useless-if-before-free.
* Makefile.maint (sc_avoid_if_before_free): New rule.
2008-02-10 17:18:03 +01:00
Jim Meyering
d80aaca2da Use a better dirname emulation.
* build-aux/check.mk (_dirname): Define.
(am__check_pre): Use it.
2008-02-10 13:52:47 +01:00
Jim Meyering
48b9ff8555 Avoid test failure when run with risky PATH ("." before /usr/bin).
* build-aux/check.mk (approx_dirname_filter): Define.
(am__check_pre): Emulate dirname using sed.
Report and suggested fix from Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12587/focus=12590
2008-02-10 11:26:57 +01:00
Jim Meyering
b0823fb415 * build-aux/.gitignore: Remove file from version control. It's generated.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-10 10:53:24 +01:00
Jim Meyering
61d93cb0d8 Generate ChangeLog from git log.
* bootstrap.conf (gnulib_modules): Add gitlog-to-changelog.
Ensure that ChangeLog exists, for automake.
* Makefile.am (gen-ChangeLog): New rule.
(dist-hook): Depend on it.
(EXTRA_DIST): Add ChangeLog-2006, ChangeLog-2007, ChangeLog-2008.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-10 10:53:16 +01:00
Jim Meyering
29ebe8f50a Remove ChangeLog, dividing its content into ChangeLog-200?
* ChangeLog: Remove file.
* ChangeLog-2005: Prepend the 2005 entries.
* ChangeLog-2006: New file.
* ChangeLog-2007: New file.
* ChangeLog-2008: New file.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-10 10:44:47 +01:00
Jim Meyering
06a369c34e * ChangeLog: Manually update copyright notice at *bottom*.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-02-10 10:44:47 +01:00
Jim Meyering
64b39468b8 tests: rm/fail-eperm: require-non-root in perl, not sh
Since it creates no temporaries and since it requires non-root,
do the require-non-root bit in perl, rather than using test-lib.sh.
2008-02-09 10:30:34 +01:00
Jim Meyering
39137a5d05 tests: Remove priv-check. Use new require_root_ function instead.
* tests/priv-check: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove priv-check.
* tests/test-lib.sh (require_root_): New function.
Use this function rather than sourcing the priv-check file.
* tests/sample-test: Use require_root_ rather than priv-check.
* tests/chown/basic: Likewise.
* tests/cp/cp-a-selinux: Likewise.
* tests/cp/preserve-gid: Likewise.
* tests/cp/special-bits: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/misc/chcon: Likewise.
* tests/mkdir/writable-under-readonly: Likewise.
* tests/mv/sticky-to-xpart: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/rm/no-give-up: Likewise.
* tests/rm/one-file-system: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/touch/now-owned-by-other: Likewise.
* tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check.
* Makefile.maint (sc_root_tests): Reflect this change:
search for the new function name.
2008-02-09 10:30:33 +01:00
Jim Meyering
5282e54c08 tests: factor out the perl-requiring code in many test scripts
* tests/require-perl: New file.
* tests/Makefile.am (EXTRA_DIST): Add require-perl.
* tests/dd/skip-seek: Use it, and remove manual tests.
* tests/du/files0-from: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/misc/base64: Likewise.
* tests/misc/basename: Likewise.
* tests/misc/cut: Likewise.
* tests/misc/date: Likewise.
* tests/misc/dircolors: Likewise.
* tests/misc/dirname: Likewise.
* tests/misc/expand: Likewise.
* tests/misc/expr: Likewise.
* tests/misc/factor: Likewise.
* tests/misc/fmt: Likewise.
* tests/misc/fold: Likewise.
* tests/misc/head-elide-tail: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/md5sum: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/mktemp: Likewise.
* tests/misc/od: Likewise.
* tests/misc/paste-no-nl: Likewise.
* tests/misc/pr: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/seq: Likewise.
* tests/misc/sha1sum: Likewise.
* tests/misc/sha1sum-vec: Likewise.
* tests/misc/sha224sum: Likewise.
* tests/misc/sha256sum: Likewise.
* tests/misc/sha384sum: Likewise.
* tests/misc/sha512sum: Likewise.
* tests/misc/sort-merge: Likewise.
* tests/misc/stat-printf: Likewise.
* tests/misc/sum: Likewise.
* tests/misc/sum-sysv: Likewise.
* tests/misc/test-diag: Likewise.
* tests/misc/tsort: Likewise.
* tests/misc/tty-eof: Likewise.
* tests/misc/unexpand: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* tests/mv/i-1: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/unreadable: Likewise.

(EXTRA_DIST): *do* require require-perl as a stand-alone, 'source'able script.
2008-02-09 10:30:33 +01:00
Jim Meyering
72565ddffe tests: call skip_test_ in place of echo+exit 77
* tests/mv/no-target-dir: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/unreadable: Likewise.
* tests/setgid-check: Likewise.
* tests/sparse-file: Likewise.
* tests/strace: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/touch/dangling-symlink: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/not-owner: Likewise.
* tests/mv/i-3: Likewise.
* tests/umask-check: Likewise.
* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chmod/setgid: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/slink: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/nice: Likewise.
* tests/misc/od-x8: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before*
the use of skip_test_.
2008-02-09 10:30:33 +01:00
Jim Meyering
52d9bba712 tests: move the very-expensive file into test-lib.sh
* tests/very-expensive: Remove file.
* tests/test-lib.sh (very_expensive_): New function.
* tests/Makefile.am (EXTRA_DIST): Remove very-expensive.
* tests/cp/perm: Call the new function, rather than sourcing the file.
* tests/tail-2/assert: Likewise.
* tests/tail-2/assert-2: Likewise.
* tests/du/2g: Likewise.
2008-02-09 10:30:33 +01:00
Jim Meyering
0f197c8acd tests: start migrating sourced-file function-like tests into test-lib.sh.
* tests/acl: Remove file.
* tests/test-lib.sh (require_acl_): New function.
* tests/cp/acl: Use require_acl_ instead.
* tests/mv/acl: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove acl.
2008-02-09 10:30:33 +01:00
Jim Meyering
1bfffd6a2d tests: mv/acl: Don't mention "yes" as a partition name in diagnostic. 2008-02-09 10:30:33 +01:00
Jim Meyering
16c005fe6a We *do* need two different version files.
One for tarball-only, the other to be updated any time we
get a new value of $(VERSION).
* Makefile.am (dist-hook): Create .tarball-version in dist tarball.
* GNUmakefile (_curr-ver): Make git-version-gen use it.
* .gitignore: Ignore it.
2008-02-07 23:31:17 +01:00
Jim Meyering
5ae0543737 Fix a typo in description of size suffixes: s/GB/G/.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Spotted by Bert Wesarg.
2008-02-07 23:06:28 +01:00
Jim Meyering
dcc6638e46 NEWS [6.9.90]: head, od, split and tail accept the standard size suffixes 2008-02-07 22:58:38 +01:00
Steven Schubiger
a09dadf100 mkdir, split: write --verbose output to stdout, not stderr.
* src/mkdir.c (verbose_output): New function.
(announce_mkdir): Use it.
* src/split.c (usage): Update.
* src/split.c (cwrite): Write to stdout, not stderr.
* doc/coreutils.texi (split invocation): Remove the mention
of --verbose output being printed to stderr.
* tests/mkdir/p-v: Redirect stdout, not stderr.
* tests/misc/split-a: Likewise.
* NEWS: Mention this change.
* TODO: Remove this item.
2008-02-07 08:26:48 +01:00
Jim Meyering
0981b56f26 Makefile.maint (announcement): Remove stale comment. 2008-02-04 13:24:01 +01:00
Jim Meyering
ae96ae296b Clarify a comment.
* tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL.
2008-02-02 09:04:24 +01:00
Bob Proulx
7cf7888ee9 Improve wording of date and time man page.
* man/date.x: Improve compact description of the --date=STRING.
* man/touch.x: Likewise.
Suggested by A. Costa.
2008-01-31 17:33:54 +01:00
Jim Meyering
1d6931a643 Remove alignment constraint from the sha*_read_ctx functions.
* lib/sha256.c (set_uint32): New function.
(sha256_read_ctx, sha224_read_ctx): Use it.
* lib/sha512.c (set_uint64): New function.
(sha512_read_ctx, sha384_read_ctx): Use it.
* lib/sha256.h: Remove warning about alignment constraint.
* lib/sha512.h: Likewise.
Prompted by similar changes in gnulib's sha1 and md[45] modules.
2008-01-31 14:45:02 +01:00
Jim Meyering
ffd3ba2805 Adapt to new version of vc-list-files.
* tests/check.mk (vc_exe_in_TESTS): Adapt to new constraint
that vc-list-files be run only from $(top_srcdir).
2008-01-31 13:26:28 +01:00
Jim Meyering
9a0b4599c7 Pull vc-list-files from gnulib.
* bootstrap.conf (gnulib_modules): Add vc-list-files.
* build-aux/vc-list-files: Remove file.
2008-01-31 12:17:07 +01:00
Jim Meyering
49d22be1a6 Improve the cp/parent-perm test.
* tests/cp/parent-perm: Also check that perms of existing dest
dirs are changed to match those of corresponding src dir
2008-01-31 10:06:06 +01:00
Paul Eggert
e8bb94a4e3 Don't modify argv in dd due to ',' in arguments.
* src/dd.c: Include quotearg.h.
(operand_matches): New function.
(parse_symbols, operand_is): Use it.
(parse_symbols): 1st arg is now const pointer.  Don't modify it.
msgid arg is now just the message, not a format.
(scanargs): Add some 'const's to check for problems like the above.
2008-01-31 09:24:35 +01:00
Jim Meyering
62b7b422a2 * src/c99-to-c89.diff: Adjust remove.c offsets, again. 2008-01-30 19:37:07 +01:00
Jim Meyering
839f321fde Now that system.h defines is_empty_dir, include "openat.h".
* src/system.h: Include "openat.h" here, ...
* src/chcon.c: ... not here.
* src/chmod.c: Likewise.
* src/chown-core.c: Likewise.
* src/remove.c: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-30 19:29:11 +01:00
Jim Meyering
afeeea66f3 * src/c99-to-c89.diff: Adjust remove.c offsets. 2008-01-30 16:15:18 +01:00
Jim Meyering
ed5c4e770a Improve "rmdir --ignore-fail-on-non-empty"
* src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty,
suppress a diagnostic also for other errno values, which can arise
with read-only media or when the parent directory has the immutable
attribute (set via chattr +i).
(errno_may_be_empty, ignorable_failure): New functions.
* src/remove.c (is_empty_dir): Move function to ...
* src/system.h (is_empty_dir): ...here, and make it inline.
Suggested by Josselin Mouette in <http://bugs.debian.org/363011>
via Bob Proulx.
* NEWS: Mention the improvement.
2008-01-30 13:51:38 +01:00
Paul Eggert
194ca7b3f9 Don't modify argv in dd.
* src/dd.c (operand_is): New function.
(scanargs): Use it so that we don't need to modify argv, as a nicety.
Problem reported by Adam Goode in
<http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00264.html>.
2008-01-30 07:33:01 +01:00
Jim Meyering
b0d3d97a0f * Makefile.am (BUILT_SOURCES): Ensure that .version exists.
Reported by Bob Proulx.
2008-01-29 17:19:29 +01:00
Bob Proulx
69b1a35c6d Improve the man pages of --date=STRING for 'date' and 'touch'.
* man/date.x: Add a compact description of the --date=STRING.
* man/touch.x: Likewise.
Reported by A. Costa in http://bugs.debian.org/363011
2008-01-29 14:27:06 +01:00
Michael Stone
c1c51585f6 Improve the description of when dd outputs its final statistics.
* doc/coreutils.texi (dd invocation): Say that dd prints stats
upon normal termination and upon SIGINT.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-29 14:14:07 +01:00
Jim Meyering
a7f5e64909 Avoid "make distcheck" failure: newly-created man/*.1 files not removed
* Makefile.am (EXTRA_DIST): Add .version.
(.version): New rule.
(dist-hook): Don't create $(distdir)/.version here, now that it's
being distributed.
* man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
(../VERSION): Remove rule.
* GNUmakefile (dummy): Create .version, not VERSION.
Add an extra "...:= $(shell..." statement to ensure that
.version exists even when the preceding code is not run.
* .gitignore: Remove both .version and VERSION.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-29 09:40:31 +01:00
Jim Meyering
533391a2a7 ls: don't segfault on files in /proc with an old libselinux
* src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15
whereby getfilecon returns 0 yet sets the context to NULL.
Reported by Jan Moringen via Michael Stone in
http://bugs.debian.org/463043
* tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault.
* tests/ls/proc-selinux-segfault: Test for the above fix.
* NEWS: Mention the fix.
2008-01-29 09:23:51 +01:00
Jim Meyering
a6228c5437 Work around Darwin9's set-GID-like group ownership inheritance.
This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
* tests/cp/preserve-gid: Accept a group ID of 0, as well.
Reported by Elias Pipping.
2008-01-26 23:05:01 +01:00
Jim Meyering
77abf69a60 Emit "info coreutils 'PROG invocation'" into the man page,
rather than just "info PROG".  The latter would often fail
or simply display the man page.
* man/help2man: Change the template.
Prompted by http://bugs.debian.org/399684
2008-01-26 19:37:23 +01:00
Jim Meyering
ae17ae779e chcon: correct description of --no-dereference (-h) option.
* src/chcon.c (usage): Remove invalid reference to lchown.
Reported by Göran Uddeborg.
2008-01-26 17:40:28 +01:00
Jim Meyering
ca3de82a18 Ensure that each version string change propagates to man pages.
* man/Makefile.am (common_dep): Don't depend on configure.ac for
version changes.  Instead, depend on ../VERSION.
(../VERSION): New rule.
* Makefile.am (DISTCLEANFILES): Define.
* GNUmakefile: Update ./VERSION.
* .gitignore: List VERSION.
Reported by Sven Joachim.
2008-01-26 17:16:38 +01:00
Jim Meyering
76c9c9845e Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1)
* tests/cp/preserve-gid: Set group as well as owner on ".".
Reported by Elias Pipping.
2008-01-26 17:16:38 +01:00
Jim Meyering
c0c8685d46 Improve a warning about non-portable "mv" usage.
* doc/coreutils.texi (mv invocation): Adjust the warning: moving a
dir-symlink-specified-with-a-trailing-slash works in a surprising
manner only on some systems.  Reported by Tomas Pospisek in
http://bugs.debian.org/343652.
2008-01-26 17:16:38 +01:00
Mike Frysinger
2c6754363f src/dircolors.hin (TERM): Add jfbterm. 2008-01-26 17:16:37 +01:00
Jim Meyering
b5d6e9db91 Clean up build-related rules.
* Makefile.cfg (gnulib_dir): Update comment.
* Makefile.maint (announcement) [cl_date, utc_date]: Don't set
now-unused variables.
2008-01-26 17:16:22 +01:00
Jim Meyering
73cfcbac05 TODO: Update the note on getgrouplist. 2008-01-26 12:31:19 +01:00
Zvi Har'El
6b5f3dd224 Add a ";", so "make install" works with --enable-install-program=su.
* src/Makefile.am (install_su): Add a semicolon.
2008-01-26 10:04:17 +01:00
Jim Meyering
d81716addb Avoid misinterpreting mgetgroups failure in running root-only tests.
* src/setuidgid.c (main): Don't misinterpret as size_t an error
return from mgetgroups.  Reported by Theodoros V. Kalamatianos.
2008-01-26 10:04:17 +01:00
Jim Meyering
3b9b0c5c16 * README: Remove/convert a few stray mentions of CVS. 2008-01-23 00:18:24 +01:00
Jim Meyering
5983242eef Require automake-1.10.1, for its support of dist-lzma.
* configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1.
2008-01-22 23:03:48 +01:00
Jim Meyering
ce0adae571 .prev-version: Record version: 6.10. 2008-01-22 08:12:02 +01:00
Jim Meyering
1440ca24fd Version 6.10 2008-01-22 00:31:02 +01:00
Jim Meyering
9675ed627d * NEWS: Record release date. 2008-01-22 00:30:14 +01:00
Jim Meyering
ec8e146a6d * README-hacking: Update to reflect existence of automake-1.10.1. 2008-01-22 00:28:23 +01:00
Jim Meyering
9783d76bf6 Update README.
* README: Remove a note about failing tests on SunOS 4.
On Mac OS 10.5.1 (Darwin 9.1), you'll need --disable-acl.
(Running tests as root): Recommend using "check-root", not "check".
2008-01-18 09:26:49 +01:00
Jim Meyering
27d1636b33 Do not define-away __attribute__ when __STRICT_ANSI__ is set.
* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
It has been unnecessary since approximately gcc-2.6, and now, leaving
it would cause gcc -Werror -ansi to fail to compile csplit.c.
* gl/lib/randread.c (__attribute__): Likewise.
2008-01-17 10:53:44 +01:00
Jim Meyering
0702758ca4 NEWS: Mention the configure.ac fix. 2008-01-16 21:20:36 +01:00
Jim Meyering
1a8e00ef27 * TODO: Add an introduction.
Remove a few entries.  Update a few others.
2008-01-16 20:18:47 +01:00
Jim Meyering
d2e298b45d Remove each output redirection target before writing to it.
* tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_,
in case they exist beforehand and are not writable.
* build-aux/check.mk (am__check_pre): Likewise, remove $@-t.
2008-01-13 12:47:42 +01:00
Elias Pipping
f088d94d25 * configure.ac: Correct a non-portable use of sed. 2008-01-13 09:16:09 +01:00
Mike Frysinger
9e8a6b696e * src/dircolors.hin (image formats): Add the .svg suffix. 2008-01-12 16:21:04 +01:00
Jim Meyering
daf28a3110 Use new version of announce-gen.
* Makefile.maint (announcement): Remove use of the
--gnulib-snapshot-time-stamp option.
Use new --gnulib-version option instead.
(gnulib-version): New variable.
2008-01-12 09:55:29 +01:00
Jim Meyering
e4c0fce73c .prev-version: Record previous version: 6.9.92. 2008-01-12 01:17:10 +01:00
Jim Meyering
8ad8aa5322 Version 6.9.92 2008-01-12 00:34:31 +01:00
Jim Meyering
e52a7c28ac tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
Suggestions from James Youngman and Pádraig Brady in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227
2008-01-11 10:07:01 +01:00
Jim Meyering
6d80b05c5a * README-hacking: Add Git to the list of required tools. 2008-01-10 14:43:17 +01:00
Paul Eggert
424feb6301 Fix a minor race condition when using cp -p --parents.
* src/cp.c (make_dir_parents_private): If stat fails on the parent
directory, do not add it to the list of directories whose modes
might need fixing later.  Also, do not bother invoking 'stat'
unless the stat results might be needed later.
2008-01-09 11:24:12 +01:00
Jim Meyering
e80379051b parent-perm: avoid a bizarre test failure.
* tests/cp/parent-perm: Accommodate the situation in which
chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.
2008-01-08 15:53:29 +01:00
Jim Meyering
0c3544ddc2 Remove uses of now-undefined Makefile variable.
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
2008-01-08 10:34:56 +01:00
Jim Meyering
b84880d980 cp (but not copy.c): plug a small leak.
* src/cp.c (do_copy) [--parents]: Free the attribute list.
2008-01-07 17:10:07 +01:00
Jim Meyering
2deb4bd589 Make a racy test failure less likely to happen.
* tests/misc/tty-eof: Uncomment a debug "warn".
This change happens to make this test far less likely to fail.
With that statement commented out, this test would fail about
20% of the time on my desktop.  Now, it's gone 100 iterations
in a row with no failure.
2008-01-07 14:21:34 +01:00
Jim Meyering
ab1c9b54b1 NEWS: Mention the cp bug fix. 2008-01-07 12:18:00 +01:00
Jan Blunck
a54e8bb8a5 cp --parents: don't use uninitialized memory when restoring permissions
* src/cp.c (make_dir_parents_private): Always stat each source
directory, in case its permissions are required in re_protect,
when setting permissions of a just-created destination directory.
2008-01-07 12:13:42 +01:00
Jim Meyering
db58094e11 cp: add a test for today's bug fix.
* tests/cp/parent-perm: New script.  Test today's change.
Based on reproducer from Jan Blunck.
* tests/cp/Makefile.am (TESTS): Add parent-perm.
2008-01-07 12:07:07 +01:00
Jim Meyering
9b76bc2b54 touch: add a test for today's change.
* tests/touch/now-owned-by-other: New script.  Test today's change.
* tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
* tests/Makefile.am (all_t): Add td, a new root-only test.
(td): New target.
* NEWS: Mention the improvement.
2008-01-06 12:50:54 +01:00
Paul Eggert
fd12e98f36 touch: ignore "-d now" option, when appropriate
* src/touch.c (main): Treat "-d now" as if it were absent, if
neither -a nor -m is specified.  Problem reported by Dan Jacobson in:
http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
2008-01-06 09:54:15 +01:00
Jim Meyering
6efd10462d Avoid tr case-conversion failure in some locales.
* src/tr.c (skip_construct): New function.
(main): When processing a pair of case-converting classes, don't
iterate through the elements of each [:upper:] or [:lower:] class.
Reported by Gerald Pfeifer in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
* tests/tr/Test.pm [tolower-F]: New test for the above fix.
[upcase-xtra, dncase-xtra]: New tests, for a related code path.
* NEWS: Mention the tr bug fix.
2008-01-06 00:09:29 +01:00
Jim Meyering
df8c2bcfe0 * .gitignore: Ignore lzma-compressed files, too.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-02 20:06:09 +01:00
Jim Meyering
092a7e3e4b Update copyright date.
* tests/sample-test: Likewise.
* doc/coreutils.texi: Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-02 20:06:09 +01:00
Jim Meyering
d1cfc46855 Add a syntax check, so this doesn't recur. Reorganize existing checks.
* doc/Makefile.am (sc-exponent-grouping):
(syntax_checks): New variable.
(sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone):
(sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted
from check-texinfo.
(check-texinfo): Depend on $(syntax_checks).
2007-12-31 11:28:02 +01:00
Jim Meyering
bad0510aea doc: Put braces around multi-digit exponents.
Reported by Darrel Francis.
2007-12-31 11:24:14 +01:00
Mike Frysinger
eef4fff743 * src/dircolors.hin (TERM): Add gnome-256color. 2007-12-30 09:25:06 +01:00
Ralf Wildenhues
012f96b95d doc/coreutils.texi: Fix a typo. Avoid the term `relationals'. 2007-12-21 19:34:50 +01:00
Jim Meyering
c3cac089b1 Use comma-separated list in ./configure --help output.
* configure.ac: Map commas to spaces in excluded-program list.
Use a comma-separated list, not a space-separated one.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG):
Expect list of program names to be comma-separated.
Reported by Jan Bauke Douma.
2007-12-20 17:38:57 +01:00
Jim Meyering
2fc00bda8c Avoid another "make check" failure due to omitted programs.
* tests/test-lib.sh (require_built_): New function.
* tests/misc/groups-version: Use it to skip this test if
either groups or id is not built.
2007-12-20 14:19:56 +01:00
Jim Meyering
8ddc5056f2 Avoid spurious "make check" failures due to omitted programs.
* man/Makefile.am (distcheck-hook): Make check rules dependents of
this target, not of check-local, so that people aren't distracted by
failures due to programs omitted via --enable-no-install-program=...
2007-12-20 14:03:12 +01:00
Paul Eggert
875e96efab Improve wording in uniq's --help "Note". 2007-12-19 10:01:57 +01:00
Jim Meyering
bbc55e488d * src/uniq.c (usage): Say "key-selection", not "field-selection".
Quote example commands consistently.
2007-12-18 21:14:49 +01:00
Jim Meyering
e19a5aa428 Note that sorting uniq's input is often useful.
Suggested by Eric Blake.
2007-12-18 11:20:45 +01:00
Jim Meyering
d1dba816fb .prev-version: Record previous version: 6.9.91. 2007-12-15 10:13:44 +01:00
Jim Meyering
7477cd1662 Version 6.9.91. 2007-12-15 09:44:40 +01:00
Jim Meyering
e657807596 * Makefile.cfg (gpg_key_ID): Use new, longer signing subkey. 2007-12-15 09:43:43 +01:00
Jim Meyering
d11bfb0454 * tests/mv/part-symlink: Redirect diff output to stderr. 2007-12-12 10:25:38 +01:00
Jim Meyering
7407dc042a Add a test to exercise today's bug fix.
* tests/misc/selinux: Test for today's bug fix.
* NEWS: Mention the SELinux "ls -l" fix.
2007-12-11 21:41:52 +01:00
Paul Eggert
4245876e23 "ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.
* src/ls.c (gobble_file): Also get the file context if -l is specified.
Treat getfilecon failures like file_has_acl failures.
(UNKNOWN_SECURITY_CONTEXT): New constant.
(clear_files): Don't free it.
(gobble_file): Set unknown security contexts to it; that way, we
don't have to have special cases for unknown contexts.
(print_long_format, print_file_name_and_frills): Don't worry
about scontext being null, since it's always some string now.
2007-12-11 21:16:24 +01:00
Jim Meyering
291eb90a0a * NEWS: Add the "Bug fixes" heading. 2007-12-11 19:08:03 +01:00
Jim Meyering
de5b055bbf "rm" as root would fail to unlink a non-directory on OS X 10.4.x
* src/remove.c (remove_entry) ["can unlink directories"]: Fix a
mistakenly reversed condition.
* NEWS: Mention this bug fix.
Reported by Pieter Bowman.
2007-12-09 00:57:00 +01:00
Jim Meyering
f16499e4d5 * src/c99-to-c89.diff: Adjust shred.c offsets. 2007-12-08 14:08:16 +01:00
Jim Meyering
d7ed77980b Reflect change in gnulib: don't include getpagesize.h,
now that it's provided by unistd.h.
* src/cat.c: Don't include getpagesize.h.
* src/copy.c: Likewise.
* src/dd.c: Likewise.
* src/shred.c: Likewise.
* src/split.c: Likewise.
2007-12-04 00:42:18 +01:00
Jim Meyering
ecec47635a Copy a .po file into place also when the target doesn't exist.
* bootstrap (gnulib_tool): ... not just when the checksum differs.
So now, if I manually remove po/xx.po, rerunning bootstrap will
copy the latest into place.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-12-02 21:03:42 +01:00
Jim Meyering
681dc1ee01 Make my-distcheck depend on "check".
* Makefile.maint (my-distcheck): Also depend on "check", so I can't tag
and release something that fails "make check" (however harmless) when
run in a checked-out-from-git dir, but not in the distributed tarball.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-12-02 21:03:42 +01:00
Jim Meyering
b1a1db5900 * NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line. 2007-12-02 18:39:40 +01:00
Jim Meyering
6bbbf0314e Remove just-installed su, if unable to make it set-UID root.
Normally, su isn't even installed.  However, if you configure with
--enable-install-program=su, and then install with insufficient
privileges, we now make sure to remove the just-installed binary.
* src/Makefile.am (install-exec-hook): Rename from install-exec-local,
so that this rule is guaranteed to be run *after* installation.
If unable to chown and chmod the installed "su" program, remove it.
Reported by Greg Schaefer.
2007-12-02 16:19:04 +01:00
Bob Proulx
5891814f34 Make test script, existing-perm-race, executable.
* tests/cp/existing-perm-race: Update file mode.
2007-12-02 08:57:38 +01:00
Jim Meyering
cc5f0b31b2 .prev-version: Record previous version: 6.9.90. 2007-12-01 23:11:13 +01:00
Jim Meyering
98b872c48a Version 6.9.90. 2007-12-01 22:46:33 +01:00
Jim Meyering
bb5c20212f NEWS: Remove the now-untrue statement about cp vs. dangling symlinks 2007-12-01 22:46:05 +01:00
Jim Meyering
065db950f0 Change release procedure: tag *before* running e.g., "make stable".
* Makefile.maint (vc-dist): Don't tag.  Now, you must apply the tag
before running "make beta", "make stable", etc.
(vc-tag-check): Remove rule.  No longer makes sense.
2007-12-01 20:04:44 +01:00
Jim Meyering
f25ce1bc94 * Makefile.maint (vc-tag-check): Correct check for existing git tag. 2007-12-01 19:03:00 +01:00
Jim Meyering
214d27e146 Defer NEWS and ChangeLog checks until after the version-changing tag.
* Makefile.maint (alpha beta major): Don't depend on the
news-date-check changelog-check targets.  They must fail before
applying the version-changing tag.  Instead, run them after "vc-dist".
2007-12-01 18:50:40 +01:00
Jim Meyering
ab73462d4b * NEWS: Mention some of the SELinux changes.
Record release date and new version number.
* src/stat.c (main): Adjust a comment.
2007-12-01 18:48:43 +01:00
Jim Meyering
e7c03171d1 TODO: Add entries (documentation needed); remove the "add mktemp program" one. 2007-12-01 17:43:49 +01:00
Jim Meyering
0d9438bb87 Add "extern" keyword to declaration of cp_options_default.
* src/copy.c (cp_options_default): Mark as "extern", so the
"sc_tight_scope" part of "make distcheck" passes.
2007-12-01 17:04:52 +01:00
Jim Meyering
9fed2e35c0 Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.
* tests/cut/Test.pm: Adjust comment.
* tests/misc/cut: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/od: Likewise.
* tests/misc/stty-invalid: Likewise.
* tests/tr/Test.pm: Likewise.
2007-12-01 16:22:47 +01:00
Paul Eggert
20ef6c7b9c Add a test for cp -p and existing file permissions.
* tests/cp/Makefile.am (TESTS): Add existing-perm-race.
* tests/cp/existing-perm-race: New test.  It isn't much of a
test yet, since it's hard to catch the race, but it has a FIXME
that will let us do a better test later.
2007-12-01 10:10:52 +01:00
Paul Eggert
b64119bc54 Fix a security race with "cp -p A B" when B already exists.
* src/copy.h (struct cp_options): New member owner_privileges.
* src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
(owner_failure_ok): New function.
(set_owner): Avoid a security-related race by doing an extra chmod
first if it looks like there might be trouble right after a chown.
Accept a source struct stat rather than a uid and gid, and
accept a boolean NEW_DST and destination struct stat.
All callers changed.
* src/copy.h (cp_options_default): New function, replacing the
old chown_privileges.
* src/copy.c (cp_options_default): Likewise.
* src/cp.c (cp_option_init): Use it.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.
2007-12-01 10:09:57 +01:00
Jim Meyering
317413874c Avoid a spurious test failure when build directory is set-GID.
* tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.
2007-11-30 17:05:07 +01:00
Jim Meyering
9db1c230c4 Be extra careful to quote $abs_top_builddir-derived names.
* tests/misc/ls-misc (shell_quote): New function.
Use it to quote file names derived from $abs_top_builddir,
in case it contains shell meta-characters.  This is not currently
needed, since CuTmpdir detects the fishy name and skips the test.
But it's important enough to add the extra protection.
Reported by Ralf Wildenhues.
2007-11-30 13:45:38 +01:00
Jim Meyering
94a2bd5bf7 Include test name in the "unsafe working directory name" diagnostic.
* tests/CuTmpdir.pm (import): If $ME is '-', use $prefix.
2007-11-30 13:40:25 +01:00
Ralf Wildenhues
0db207c66c Add quotes to protect against white space in build dir name.
* tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
* tests/chmod/setgid: Quote absolute names.
* tests/misc/help-version: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/rmdir/ignore: Likewise.
* tests/test-lib.sh: Likewise.
2007-11-30 12:14:57 +01:00
Ralf Wildenhues
d7ed3bcb8d Define `tst', for CU_TEST_NAME.
* build-aux/check.mk (am__check_pre): Set `tst', for
CU_TEST_NAME in tests/check.mk.
2007-11-30 10:25:09 +01:00
Ralf Wildenhues
688073771d * tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not
defined, because it then goes wild and changes the mode of all
directories below $HOME.  Undefined $dir can happen if the test
is to be skipped because of an unsafe working directory name.
2007-11-30 08:53:38 +01:00
Paul Eggert
9962f24cc4 Close a file descriptor leak when cp --preserve=context fails.
* src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
or fsetfilecon fail.
2007-11-29 08:32:54 +01:00
Jim Meyering
4352534a0c README: Document the known problem with gettext <= 0.17. 2007-11-28 22:44:38 +01:00
Paul Eggert
77f8502ea7 * gl/modules/randread (Depends-on): Remove nonexistent rand-isaac. 2007-11-28 22:29:38 +01:00
Jim Meyering
9696161574 Don't block use of 'cat' or 'wc' in "make check".
* Makefile.maint (my-distcheck): Add "cat" and "wc" to the list
of programs that we can't blacklist.
2007-11-27 20:03:08 +01:00
Jim Meyering
3a60f14cbb Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf.
* configure et al: Regenerate with very latest version of autoconf
(v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation
on big-endian systems (like sparc) due to lack of the required
definition in of WORDS_BIGENDIAN in lib/config.h.
2007-11-27 19:26:25 +01:00
Jim Meyering
ac8a9a1ff0 setuidgid.c: more cleanup
* src/setuidgid.c: Include "mgetgroups.h".
(main): Don't presume there's a fixed limit on the maximum number
of group IDs.  Don't use NGROUPS; it's artificially low.
Change the name of a local: s/gids_count/n_gids/.
Remove non-portable "const": s/const int tmp =.../int tmp =.../
2007-11-26 18:16:13 +01:00
Jim Meyering
9d0a315369 Document install's -D option.
* doc/coreutils.texi (install invocation): Document -D.
Reported by Akim Demialle.
2007-11-25 18:39:47 +01:00
Jim Meyering
910267665e setuidgid: Update --help output.
* src/setuidgid.c (usage): Describe -g GID[,GID1...] option.
Mention that USER may be a numeric ID or a user name.
2007-11-25 18:26:03 +01:00
Jim Meyering
3669d2b820 Tweak new test.
* tests/cp/preserve-gid: Split some long lines.
Prepend "+" to numeric uid and gid chown arguments, on principle.
Use skip_test_.
2007-11-24 15:10:59 +01:00
Jim Meyering
ada15fc823 setuidgid: minor clean-up.
* setuidgid.c: Include "xstrtoul.h".
(main): Detect overflow in string-to-gid_t and -to-uid_t conversions.
Improve diagnostics.
2007-11-24 15:10:28 +01:00
Jim Meyering
0125fd0fcb setuidgid.c: Normalize leading white space: no more TABs 2007-11-24 15:10:04 +01:00
Lasse Collin
a382db6a04 Test the new feature: cp -p preserves the GID whenever possible.
* tests/cp/preserve-gid: New file.  Test for today's change.
* tests/cp/Makefile.am (TESTS): Add preserve-gid.
* tests/Makefile.am (all_t): Add tc.
(tc): New target.
2007-11-24 15:09:17 +01:00
Lasse Collin
5c11250915 setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...
* src/setuidgid.c: Add functionality for the new test above.
2007-11-24 15:08:43 +01:00
Lasse Collin
cbc06bb639 "cp -p" tries to preserve GID even if preserving the UID fails.
* NEWS: Mention this new feature.
* src/copy.c (set_owner): Try to preserve just the GID,
when initial fchown/lchown fails.
* src/cp.c (re_protect): Likewise.
2007-11-24 15:06:43 +01:00
Jim Meyering
ad8fbe0dd2 * src/runcon.c (main): Remove unused parameter, "envp". 2007-11-23 09:03:23 +01:00
Jim Meyering
0e9b06482e Add tests to show new class of strings accepted by date -d.
* tests/misc/date (rel-1day, rel-plus1): New tests for the recent
change in gnulib's getdate.y.
* NEWS: Mention the fix.
2007-11-23 08:27:16 +01:00
Jim Meyering
849c3830dc Quiet warnings about unused parameters.
* src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]:
"Use" each of the parameters.
2007-11-22 09:24:17 +01:00
Jim Meyering
7794100ef8 * GNUmakefile: Correct the "rerunning..." diagnostic. 2007-11-22 08:44:38 +01:00
Jim Meyering
fe9033c309 Make it easier to diagnose PATH-induced "make distcheck" failures.
* Makefile.maint (write_loser): Define.
(my-distcheck): Use an always-failing wrapper script, that gives
a diagnostic, not "false".
Run only "make -C tests check" with the restrictive PATH.
Run the new gnulib-tests/ with the usual PATH.
2007-11-22 08:42:32 +01:00
Jim Meyering
2bdc481219 cp: by default, refuse to copy through a dangling destination symlink
* NEWS: Mention this change.
* doc/coreutils.texi (cp invocation): Describe the new behavior.
* src/copy.c: No longer include "canonicalize.h".
(copy_reg): Upon failure to open a dangling destination symlink, don't
canonicalize the name, but rather fail (default) or, with POSIXLY_CORRECT,
repeat the open call without O_EXCL (potentially dangerous).
* src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
New member.  Reorder the others, grouping "bool" and "enum"
members together.
* tests/cp/thru-dangling: Test for changed and new behavior.
* src/cp.c (cp_option_init): Initialize new member.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-11-22 00:19:06 +01:00
Jim Meyering
fa636dcf6a Fix Pádraig's name in ChangeLog. 2007-11-21 22:13:17 +01:00
Pádraig Brady
4e732c7379 Improve the descriptions of the split command options.
* doc/coreutils.texi (split invocation):
2007-11-21 21:07:50 +01:00
Jim Meyering
2fb649815c * src/c99-to-c89.diff: Adjust seq.c offsets. 2007-11-21 18:41:06 +01:00
Paul Eggert
32f31bad5e * src/seq.c (print_numbers): Rewrite in an attempt to avoid the
more-general rounding issues exposed by the previous patch.
2007-11-21 18:37:08 +01:00
Jim Meyering
a9805326e4 * src/c99-to-c89.diff: Adjust seq.c offsets. 2007-11-18 21:20:37 +01:00
Jim Meyering
98ed526f44 Remove unused parameter in remove.c.
* src/remove.c (fd_to_subdirp): Remove unused parameter.
(remove_cwd_entries, remove_dir): Update callers.
2007-11-18 21:19:33 +01:00
Jim Meyering
e81fce4a73 bootstrap: work also with 4-argument variant of AC_INIT (from gnulib)
2007-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
* bootstrap (gnulib_extra_files): Adjust sed command.
2007-11-18 11:55:45 +01:00
Jim Meyering
93914c7b12 Correct preceding patch.
* src/seq.c (print_numbers): Also handle first < last && step < 0.
* tests/misc/seq [empty-rev]: New test for this case.
2007-11-17 10:04:07 +01:00
Jim Meyering
a03811f519 "seq .1 .1" would mistakenly generate no output on some systems
* NEWS: Say this.
* src/seq.c (print_numbers): Handle another floating point corner case.
This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
2007-11-17 09:39:42 +01:00
Paul Eggert
6076d0ae2f Port tests/rmdir/ignore away from GNU/Linux.
* tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail
with errno==ENOTEMPTY when $PWD is not empty; Posix also allows
rmdir to fail with errno==EBUSY.
2007-11-17 00:04:08 +01:00
Jim Meyering
a2f12f2e41 Avoid an obscure new "make distcheck" failure.
* Makefile.maint (my-distcheck): Also allow 'mv', for its use
in gnulib-tests/Makefile.
2007-11-16 11:08:19 +01:00
Paul Eggert
fe18e9f7e5 Port readlink-fp-loop to Solaris.
* tests/misc/readlink-fp-loop (symlink_loop_msg): New var,
which records the symlink-loop message, whose wording is
not standardized by Posix.  Do not rely on "echo x > p/1"
to work when p/1 has a lot of indirect symlinks.  (I'm surprised
that it works on Linux.  Perhaps a Linux bug?)
2007-11-16 11:04:31 +01:00
Jim Meyering
1379ed974f Port to Solaris 'make' and use a Posixish shell on Solaris.
* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
* build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
so that commands can assume Posix syntax.
(ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
(SH_E_WORKAROUND): New macro.
(am__check_pre, $(TEST_SUITE_LOG)): Use it.
(am__check_pre): Fail if "mkdir" fails.  Use $(SHELL)
rather than relying on the "#!/bin/sh" in the file, so that tests
can use Posix syntax.
(am__check_pre, am__tty_colors): Use $$src rather than $$<, to
support the Posix-make $(TEST_LOGS) rule.
(%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
that rely on a GNU Make extension and cause Solaris 'make' to fail.
(SUFFIXES): New macro, so that we can use Posix style inference rules.
(%.log: %): Use this rule only if GNU_MAKE.
Set $$src so that macros can use $$src rather than $$<.
(CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
which rely only on Posix 'make' semantics, and are used only with
non-GNU 'make' implementations.  $(TEST_LOGS) invokes 'make'
recursively (and a bit inefficiently) to simulate the GNU 'make'
rules.
(.log.html): Renamed from "%.html: %.log", so that it relies only
on Posix 'make' semantics.
(check-clean, .PHONY): Do not depend on check-clean-local, since
Solaris 'make' complains about nonexistent rules like that.
* src/Makefile.am (SUFFIXES): Remove; no longer needed.
(groups): Use a specific rule rather than an inference rule that
is only instantiated once.  The inference-rule approach does not
work with Solaris 'make', which gets confused by the "groups:
Makefile" line.  It's not clear from the Posix spec that Solaris
'make' is buggy here, so instead of worrying about it, rewrite
the makefile so that it clearly conforms to Posix.
* tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT.
GNU 'make' does this automatically for us, but Solaris 'make'
doesn't.

2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2007-11-16 11:03:03 +01:00
Paul Eggert
f77576a775 Port to Solaris 8 perl, which does not support "use warnings;".
* tests/dd/skip-seek: Skip test if "use warnings;" fails.
* tests/du/files0-from: Likewise.
* tests/misc/base64: Likewise.
* tests/misc/basename: Likewise.
* tests/misc/cut: Likewise.
* tests/misc/date: Likewise.
* tests/misc/dircolors: Likewise.
* tests/misc/dirname: Likewise.
* tests/misc/expand: Likewise.
* tests/misc/expr: Likewise.
* tests/misc/factor: Likewise.
* tests/misc/fmt: Likewise.
* tests/misc/fold: Likewise.
* tests/misc/head-elide-tail: Likewise.
* tests/misc/ls-misc: Likewise.
* tests/misc/md5sum: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/mktemp: Likewise.
* tests/misc/od: Likewise.
* tests/misc/paste-no-nl: Likewise.
* tests/misc/pr: Likewise.
* tests/misc/seq: Likewise.
* tests/misc/sha1sum: Likewise.
* tests/misc/sha1sum-vec: Likewise.
* tests/misc/sha224sum: Likewise.
* tests/misc/sha256sum: Likewise.
* tests/misc/sha384sum: Likewise.
* tests/misc/sha512sum: Likewise.
* tests/misc/sort-merge: Likewise.
* tests/misc/stat-printf: Likewise.
* tests/misc/sum: Likewise.
* tests/misc/test-diag: Likewise.
* tests/misc/tsort: Likewise.
* tests/misc/unexpand: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* tests/mv/i-1: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Likewise.
2007-11-16 09:35:54 +01:00
Andreas Schwab
9c31db8cc4 * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.
Remove trailing space from result.
2007-11-15 14:06:12 +01:00
Jim Meyering
2ed532618f Avoid misbehavior of a cross-device "mv" or "install".
Those programs must not dereference a destination symlink.
* src/copy.c (copy_reg): Don't treat a dangling destination symlink
differently in move mode.  In move mode, the only way the added
O_EXCL can cause failure is when some other process has recreated
the file this code unlinked a few instructions before.
2007-11-15 13:04:13 +01:00
Jim Meyering
47a46c844c Another bootstrap kludge.
* bootstrap: Ensure gnulib-tests/test-*.sh are executable
2007-11-14 23:52:42 +01:00
Jim Meyering
9c59b53d8b src/install.c (setdefaultfilecon): Stub-out the entire function. 2007-11-14 23:34:56 +01:00
Jim Meyering
92490afb6d #ifdef-out matchpathcon-related code, for now.
* src/install.c (setdefaultfilecon): #ifdef-out all of the
matchpathcon-related code, until it's more efficient.
2007-11-14 22:36:10 +01:00
Jim Meyering
8e412d1ac0 Use gnulib's stpncpy module, now required by install.c
* bootstrap.conf (gnulib_modules): Add stpncpy.
2007-11-14 20:37:06 +01:00
Jim Meyering
c369e79c60 Enable gnulib-tool's --with-tests option.
* bootstrap: After all is done, transform the generated gnulib-tests/gnulib.mk.
* bootstrap.conf (gnulib_tool_option_extras): Set it here.
* gnulib-tests/Makefile.am: New file.
* Makefile.am (SUBDIRS): Add gnulib-tests.
* configure.ac (AC_CONFIG_FILES): Add gnulib-tests/Makefile.
* m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the
"extern " prefix to "void usage ()", so that the macro string value can
be used to construct a function definition in gnulib's test-argmatch.c.
2007-11-14 20:35:34 +01:00
Benno Schulenberg
080ac77850 Likewise for description of cp -a in doc/coreutils.texi: s/-dpPR/-dpR/. 2007-11-13 00:02:29 +01:00
Benno Schulenberg
b7c2db6766 Clarify description of cp's -a option.
* src/cp.c (usage) [-a]: Remove unnecessary 'P'.
Since option -d of 'cp' includes the function of -P, mentioning the
latter in the description of option -a is redundant and therefore
slightly confusing, as the reader tries to figure out what it adds.
2007-11-12 19:13:32 +01:00
Jim Meyering
ba34974090 bootstrap: fix typo to enable use of $gnulib_tool_option_extras.
* bootstrap (gnulib_tool_options): Add a space before the use
of $gnulib_tool_option_extras, so that it's separated from the
preceding argument.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-11-10 18:41:41 +01:00
Jim Meyering
56e3106e93 install+SELinux: reduce a 12x performance hit to ~1.5x
* src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
to mitigate what would otherwise be a large performance hit due to
the use of matchpathcon.
Dan Walsh suggested the use of matchpathcon_init_prefix.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-11-10 18:41:14 +01:00
Jim Meyering
ca5b9746c8 Adapt to gnulib's s/jm_/gl_/ cache variable renaming.
* configure.ac: Change the cache variable name prefix "jm_" to "gl_",
to match today's change in gnulib.
2007-11-08 10:55:02 +01:00
Jim Meyering
656c37d630 Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.
* bootstrap (cp_mark_as_generated): Create any required parent
destination directories before copying a file into place.
2007-11-05 18:06:38 +01:00
Jim Meyering
17d3924e9e * src/c99-to-c89.diff: Adjust offsets. 2007-11-05 14:57:09 +01:00
Jim Meyering
3bf4bb761c Don't use GNU-sed-specific \< \> operators here, either.
* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below.
2007-11-05 12:08:27 +01:00
Jim Meyering
d471effd85 Use tighter regexps when performing name substitution.
* man/Makefile.am (mapped_name): Add ^ and $$ anchors.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-11-05 11:14:05 +01:00
Jim Meyering
25e3dd5365 Don't use GNU-sed-specific \< \> operators.
* configure.ac (MAN): Transform ginstall.1 to install.1 using
a loop, rather than sed with \<...\>.
Problem reported by Bruno Haible.
Andreas Schwab reminded me that \< and \> are not portable.
2007-11-05 11:13:21 +01:00
Jim Meyering
b8da93bee9 Get git-version-gen from gnulib.
* build-aux/git-version-gen: Remove file.
* build-aux/.gitignore: Add git-version-gen.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
2007-11-05 08:31:51 +01:00
Jim Meyering
4c9b376271 git-version-gen: Sync from autoconf's version.
* build-aux/git-version-gen: Run git-status
2007-11-03 22:52:33 +01:00
Jim Meyering
ae559eabcd Sync copyright and scriptversion bits from gnulib.
* build-aux/git-version-gen: No semantic change.
2007-11-03 18:04:40 +01:00
Jim Meyering
8beb69b148 Change the first '-' to '.' in the snapshot version string,
e.g., 6.9-377-08144 -> 6.9.377-08144
* build-aux/git-version-gen: ... and add comments.
2007-11-03 17:46:42 +01:00
Jim Meyering
0814422a7d seq: add another test for the %% bug
* tests/misc/seq (fmt-c): Test the other fixed case, too.
2007-11-03 10:42:52 +01:00
Paul Eggert
a860ca32b0 Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format.
* NEWS: Mention the %%-in-format bug fix.
* src/seq.c (struct layout): New type.
(long_double_format): New arg LAYOUT.  Fill it in.  Fix mishandling
of %% in formats.
(print_numbers): New arg LAYOUT.  Don't convert LAST to output format
when deciding whether to go slightly past LAST.  Instead, convert
X to output format and back.  This fixes a bug reported by
Andreas Schwab in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00237.html>
where "seq 10.8 0.1 10.95" would output 11.0 on platforms where
10.95 rounds to a value that prints as 11.0 when only one digit
past the decimal point is asked for.
(main): Compute layout, for benefit of print_numbers.
* tests/misc/seq (float-3): Undo previous change, since the bug
should be fixed now.
(fmt-b): New test, for the %% bug.
2007-11-03 10:00:26 +01:00
Jim Meyering
3e3f8f0161 tests/misc/printf-surprise: Correct sed transform.
Reported by Bob Proulx.
2007-11-01 23:40:21 +01:00
Jim Meyering
c70fc8d87b Add example inspired by "make dist" running gzip and lzma in sequence.
* doc/coreutils.texi (tee invocation): Show how to run tar just
once, compressing the tee'd output streams in parallel.
2007-11-01 22:34:36 +01:00
Jim Meyering
e556eaa59e Say that the first process substitution example is contrived.
* doc/coreutils.texi (tee invocation): ... and show how to do
it properly.  Pointed out by James Antill.
2007-11-01 21:25:28 +01:00
Jim Meyering
636f0e101a Use mktemp, not mkdtemp, to create test directories.
* tests/test-lib.sh: Use the mktemp binary we've just built,
not the mkdtemp script.
* tests/mkdtemp: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove mkdtemp.
2007-11-01 20:13:11 +01:00
Jim Meyering
d1986f81d0 Adjust a seq subtest not to depend on the vagaries of floating point.
* tests/misc/seq (float-3): Use 10.94 as the endpoint, not 10.95,
since 10.95 was precisely in the middle of the interval, and with
a %.1f format could map to either 10.9 or 11.0.
Reported by Mike Frysinger
2007-11-01 12:10:06 +01:00
Jim Meyering
094e533fad Make the new printf-surprise test more precise.
* tests/test-lib.sh (require_ulimit_): New function.
* tests/misc/printf-surprise: Use ulimit -v to trigger the fixed bug,
and rather than checking printf's exit status (which would go wrong
on FreeBSD 6.1, since their printf(3) function doesn't require
lots of memory in this case) simply test whether it outputs
the first 10 bytes.
2007-11-01 12:06:11 +01:00
Jim Meyering
accad81d2b Accommodate FreeBSD 6.1 hard-link-to-symlink differences.
* tests/cp/same-file: Detect when linking to a symlink links to
the target of the symlink (FreeBSD 6.1 does this, Linux does not),
and skip the few tests that would otherwise fail.
Redirect output of final comparison to stderr, since all stdout
is already redirected.
2007-11-01 11:59:08 +01:00
Jim Meyering
75d6936a08 Fix a "make distcheck" failure.
* Makefile.maint (my-distcheck): Don't stub-out dirname,
since build-aux/check.mk now uses it.
2007-10-31 08:42:17 +01:00
Jim Meyering
8c8bf861de * bootstrap.conf (gnulib_modules): Add xprintf-posix. 2007-10-31 08:40:51 +01:00
Jim Meyering
5654415595 Avoid seq floating-point test failure on FreeBSD 6.1.
* tests/misc/seq (float-4): Also accept -0.0.
2007-10-30 11:17:59 +01:00
Jim Meyering
b00f87cfa3 Change a "make dist" diagnostic.
* GNUmakefile: Don't imply that $(_curr-ver) is the new version string.
2007-10-29 12:24:39 +01:00
Bob Proulx
b8e8d02861 Improve color terminal escape usage.
* build-aux/check.mk (am__tty_colors): Use 'tput' to deduce
terminal color capabilities.
2007-10-29 05:10:23 -06:00
Jim Meyering
b63b1b4ce2 Don't try to colorize a dumb terminal.
* build-aux/check.mk (am__tty_colors): Skip colors if $TERM is "dumb".
Thanks to Bob Proulx.
2007-10-29 10:37:09 +01:00
Jim Meyering
0cc7aa3a29 Remove gnulib's printf-posix module, for now.
* bootstrap.conf (gnulib_modules): It caused too many test failures.
2007-10-29 10:14:58 +01:00
Jim Meyering
cb75780b50 Remove spurious semicolon after "else".
* build-aux/check.mk (am__tty_colors): Fix syntax error.
2007-10-29 10:01:25 +01:00
Jim Meyering
3e9a0b87d7 Attribute suggestion for last change. 2007-10-29 09:49:50 +01:00
Jim Meyering
89157ad207 If $TERM is empty, don't use colors. This helps the buildbot,
since it produces its result in an environment with a tty, but
we don't want color codes in that case.
* build-aux/check.mk (am__tty_colors): Test for nonempty $TERM.
2007-10-29 09:47:52 +01:00
Jim Meyering
973d42b90d Always initialize terminal colorization string variables.
* build-aux/check.mk (am__tty_colors): Always initialize red, grn, etc.,
In case they're defined in the environment.
2007-10-29 08:41:08 +01:00
Jim Meyering
e1bb6139fb Avoid test failure in non-srcdir build vs. the git tree.
* tests/check.mk (vc_exe_in_TESTS): Run this test only in a
srcdir build directory.  Reported by Andreas Schwab.
2007-10-29 07:47:21 +01:00
Jim Meyering
709a27ba48 Define ENOTSUP, not ENOSYS. Needed on OpenBSD 3.9.
* gl/lib/se-context.in.h (ENOTSUP): Define if missing.
* gl/lib/se-selinux.in.h: Likewise.
2007-10-28 19:04:59 +01:00
Jim Meyering
39e668ce5b Define ENODATA, for FreeBSD 5.0 and 6.1.
* src/system.h (ENODATA): Define, if missing.
2007-10-28 18:16:54 +01:00
Jim Meyering
68c33a103d Run autoreconf, not just autoconf, to avoid warnings.
* GNUmakefile (dummy): Otherwise, we'd sometimes get a warning
about autoconf version mismatch between what was used to generate
aclocal.m4 and the currently-running autoconf.
2007-10-28 15:54:44 +01:00
Jim Meyering
6555874879 Require gnulib's printf-posix module, to support Interix.
* bootstrap.conf (gnulib_modules): Add printf-posix.
2007-10-28 15:38:17 +01:00
Jim Meyering
39639a8a6a Help xgettext recognize more printf-style format strings.
* bootstrap.conf (XGETTEXT_OPTIONS): Add directives for
error, error_at_line, xasprintf, xfprintf and xprintf.
2007-10-28 15:37:56 +01:00
Jim Meyering
1f05c616d2 Adjust format string so msgfmt doesn't object.
* src/df.c (main): Use "%s%s" (not %smsg) to print "msg" with or
without a "Warning: " prefix.  Reported by Clytie Siddall.
2007-10-27 09:42:27 +02:00
Jim Meyering
2e270515f7 Clean up tests/Makefile.am.
* tests/Makefile.am (EXTRA_DIST): Remove $(TESTS).  No longer defined.
(TESTS_ENVIRONMENT): Remove definition.
2007-10-27 09:06:11 +02:00
Jim Meyering
5d9cb87197 * build-aux/check.mk: Merge with latest from Akim. 2007-10-27 09:04:47 +02:00
Jim Meyering
cdd44f674b Add a test for the printf fix of 2007-10-21.
* tests/misc/printf-surprise: New file.  Test for 2007-10-21's fix.
* tests/misc/Makefile.am (TESTS): Add printf-surprise.
2007-10-27 08:50:10 +02:00
Jim Meyering
e80f3acc36 Add attribution for the expr.c-vs-xgettext report. 2007-10-25 09:20:44 +02:00
Jim Meyering
3c6e338b0f Remove vestiges of cvs-gnulib-checkout process. Now we use git.
* bootstrap: Remove support for now-unnecessary option, --cvs-user,
and envvars CVS_USER, CVS_RSH.

2007-10-24  Micah Cowan  <micah@cowan.name>
2007-10-25 09:06:29 +02:00
Micah Cowan
35eca590ad Tell xgettext that "ARG1 % ARG2" is not a C format string.
* src/expr.c (usage): Add a comment to override xgettext's default
behavior, which would classify "ARG1 % ARG2" as a fprintf-style
format string.
2007-10-25 08:59:30 +02:00
Jim Meyering
edb5faa297 Avoid diagnostics from sha1sum when there is no cached checksum.
* bootstrap (update_po_files): Skip the sha1sum check if the po.s1
file hasn't been created yet.
2007-10-24 22:31:35 +02:00
Jim Meyering
0edca4f61f Get gnulib from the git repository, not from an obsolete cvs one.
* bootstrap: Suggestion from Micah Cowan.
2007-10-24 22:09:57 +02:00
Jim Meyering
ffc29e91c4 Doc improvements.
* README-hacking: Prefer the no-hyphen variant of git commands,
e.g., use "git pull" not "git-pull".
Don't presume that the only way to read this document is via a
prior git clone: provide instructions for cloning coreutils, too.

* README-hacking: Add "cd automake" in build instructions.
From Bob Proulx.
2007-10-24 09:13:59 +02:00
Jim Meyering
b924d0380e Don't fail part 2 of tests/rm/unreadable when run as root.
* tests/rm/unreadable: With UID == 0, expect different results.
Reported by Mike Frysinger.
2007-10-24 08:50:09 +02:00
Jim Meyering
def157c927 * README-hacking: Refer to LZMA Utils <http://tukaani.org/lzma/>. 2007-10-23 15:44:58 +02:00
Paul Eggert
758a615bb5 * README-hacking: Describe how to build with LZMA. 2007-10-22 23:29:40 +02:00
Jim Meyering
433a31d3dc Remove git-version-gen's first parameter.
* build-aux/git-version-gen: Add comments.
Remove first command-line parameter.
* configure.ac: Remove corresponding first argument.
* GNUmakefile (_curr-ver): Likewise.
2007-10-22 21:43:12 +02:00
Jim Meyering
74695771cb Attribute the printf bug report. 2007-10-21 18:19:54 +02:00
Jim Meyering
ffa639900b * NEWS: Mention the printf fix. 2007-10-21 18:17:30 +02:00
Jim Meyering
a64e33f79b Reorder tests to run more basic ones earlier.
* tests/misc/Makefile.am (TESTS): Reorder.
* tests/Makefile.am (SUBDIRS): Reorder.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-21 14:01:28 +02:00
Jim Meyering
af5d0c363a tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.
* NEWS: Mention this.
* src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when
processing [:lower:] and [:upper:].
(main): Require [:lower:] or [:upper:] in SET1 only when
when one of those is specified in SET2.
* tests/tr/Test.pm: Add tests for this fix.
Reported by Per Starbäck.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-21 14:01:28 +02:00
Jim Meyering
c365bafa81 * tests/misc/help-version: Add a comment.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-21 14:01:28 +02:00
Jim Meyering
b1ab7101aa Detect printf(3) failure due to ENOMEM.
* src/printf.c: Include "xprintf.h"
(print_direc): Use xprintf, rather than printf.
* bootstrap.conf (gnulib_modules): Add xprintf.
* po/POTFILES.in: Add lib/xprintf.c.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-21 14:01:27 +02:00
Jim Meyering
60a5ad4b94 Put always-failing programs first in PATH, so tests cannot mistakenly run installed versions.
* Makefile.maint (my-distcheck): Set up a bogus bin/ dir, to be used
for "make check".

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-21 14:01:15 +02:00
Jim Meyering
a34bea4976 * doc/coreutils.texi: Add a cross-reference to bashref's Process Substitution node. 2007-10-20 13:53:45 +02:00
Jim Meyering
4319cbc0a1 * doc/coreutils.texi (tee invocation): Fix typo. Add a little. 2007-10-20 12:00:54 +02:00
Jim Meyering
5dabe472b0 Adjust tests to pass, now that Test.pm ones use check.mk.
* tests/check.mk (vc_exe_in_TESTS): Adjust regexp not to match the
"TESTS = $x-tests" line in each Test.pm-derived Makefile.am file.
* tests/sort/main: Remove this unused file.
2007-10-20 10:07:12 +02:00
Jim Meyering
736b78af4f Ensure that Test.pm-derived tests use the right $PATH.
* tests/Makefile.am.in: Include $(top_srcdir)/tests/check.mk.
2007-10-20 09:06:39 +02:00
Bob Proulx
18e4c15198 Prevent "make check" from leaving mktemp /tmp/tmp.* files behind.
* tests/misc/help-version (mktemp_args): Tell mktemp to create
its temporary file in the current directory.
2007-10-20 08:26:57 +02:00
Jim Meyering
2a0e737cfd Show how to make tee redirect to multiple processes. 2007-10-16 12:46:18 +02:00
Jim Meyering
84c3fb94ac Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.
* tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition.
* tests/chgrp/Makefile.am: Likewise.
* tests/chmod/Makefile.am: Likewise.
* tests/chown/Makefile.am: Likewise.
* tests/cp/Makefile.am: Likewise.
* tests/dd/Makefile.am: Likewise.
* tests/du/Makefile.am: Likewise.
* tests/install/Makefile.am: Likewise.
* tests/ln/Makefile.am: Likewise.
* tests/ls/Makefile.am: Likewise.
* tests/misc/Makefile.am: Likewise.
* tests/mkdir/Makefile.am: Likewise.
* tests/mv/Makefile.am: Likewise.
* tests/readlink/Makefile.am: Likewise.
* tests/rm/Makefile.am: Likewise.
* tests/rmdir/Makefile.am: Likewise.
* tests/tail-2/Makefile.am: Likewise.
* tests/touch/Makefile.am: Likewise.
* tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]:
[CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]:
[REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here.
* tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR.
* tests/dd/skip-seek: Don't use $ENV{PROG}.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Likewise.
* tests/mv/i-1: Likewise.
2007-10-14 21:47:08 +02:00
Jim Meyering
b81697cd4a Fix a minor typo.
* configure.ac (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a
difference only when running "make dist" without a .git/ subdir.
2007-10-14 13:35:34 +02:00
Jim Meyering
b69049da7b Move the help-version test into misc/.
* tests/help-version: Move to...
* tests/misc/help-version: ...here.
Source test-lib.sh, as usual.
Use $abs_top_builddir, rather than ".." and "../..".
2007-10-09 17:13:09 +02:00
Jim Meyering
3e53920470 Make the runcon-no-reorder test slightly more general.
* tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t".
Use slightly more general "runcon $(id -Z)".
Suggestion from Stephen Smalley.
2007-10-09 15:49:00 +02:00
Jim Meyering
4597f40b7f Skip the chcon test on a system with no SELinux support.
* tests/test-lib.sh (require_selinux_): New function.
* tests/misc/chcon: Use it.
* tests/misc/selinux: Use it here, too.
* tests/cp/cp-a-selinux: and here.
* tests/selinux: Remove file.
* tests/Makefile.am (EXTRA_DIST): Remove selinux.
Reported by Mike Frysinger and Bauke Jan Douma.
2007-10-09 10:13:39 +02:00
Jim Meyering
91bef1af62 * src/dircolors.hin: Recognize .lzma as a compressed-file suffix. 2007-10-09 09:39:13 +02:00
Jim Meyering
b75e3b8569 * configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2. 2007-10-09 09:37:43 +02:00
Jim Meyering
c25152b455 Now that we don't install su, don't make misleading suggestions.
* src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]:
Don't suggest running "make install-root".
(uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
the installed binary.
2007-10-09 09:35:30 +02:00
Jim Meyering
e6f4b28275 When forming a truncated name, use the "[...]" prefix even for
an extremely long name in the current directory.

* src/remove.c (full_filename_): Rename a local variable.
Use two separate "truncated" variables, in case the second
call to right_justify does not indicate any truncation -- which
would happen only if the single component FILENAME were longer
than 511 bytes and DIR_NAME were empty.
2007-10-08 10:47:40 +02:00
Jim Meyering
689186b88c rm could malfunction under unusual circumstances:
When operating on a relative name longer than 511 bytes,
and (when either processing a directory that is neither writable
nor readable (but still searchable) or when determining whether
to prompt), and encountering an ENOMEM error while forming the
file name, rm would operate on a truncated-to-511-byte name
starting with "[...]" rather than the intended one.
* NEWS: Describe the bugs.
* src/remove.c: Correct two misuses of full_filename:
(full_filename0, xfull_filename): New functions.
(full_filename_): Rewrite to use full_filename0.
(AD_pop_and_chdir): Use xfull_filename, not full_filename.
(write_protected_non_symlink): Likewise.
2007-10-08 10:26:05 +02:00
Jim Meyering
035a5ca2b0 Don't let a helper function modify errno.
* src/remove.c (full_filename_): Save and restore errno.
Spotted by Bruno Haible.
2007-10-07 21:57:55 +02:00
Jim Meyering
847fbc4eba Reflect 2->3 GPL copyright version update in gnulib.
* gl/lib/tempname.h: Update copyright from gnulib.
* gl/lib/tempname.c: Likewise.
* .x-sc_GPL_version: Don't make an exception for those two files.
2007-10-07 21:04:21 +02:00
Jim Meyering
a5fa9f9cc9 * configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet. 2007-10-07 20:33:57 +02:00
Jim Meyering
99b039fead New program: mktemp.
* NEWS: Mention this.
* README: Add mktemp to the list.
* AUTHORS: Add this: mktemp: Jim Meyering
* src/mktemp.c: New file.
* src/Makefile.am (bin_PROGRAMS): Add mktemp.
(mktemp_LDADD): Add $(LIB_GETHRXTIME).
* man/mktemp.x: New file.
* man/Makefile.am (dist_man_MANS): Add mktemp.1.
(mktemp.1): New dependency.
* man/.cvsignore: Add mktemp.1.
* man/.gitignore: New file.
* src/.cvsignore, src/.gitignore: Add mktemp.
* tests/misc/mktemp: New file.
* tests/misc/Makefile.am (TESTS): Add mktemp.
* tests/Coreutils.pm (run_tests): Give the POST-test function
access to stdout and stderr contents, so it can verify that
the named-on-stdout file/dir does indeed exist and has proper
permissions, etc.
[po/ChangeLog]
* POTFILES.in: Add src/mktemp.c.
2007-10-07 19:44:38 +02:00
Jim Meyering
7eab7d027e Make tempname more random, via the randint module.
* gl/modules/tempname (Depends-on): Add randint and stdbool.
* gl/lib/tempname.c: Include randint.h and stdbool.h.
(uint64_t): Remove definition.  Not needed.
[_LIBC] (RANDOM_BITS): Remove this block, now that we have proper random bits.
(check_x_suffix): New function.
(gen_tempname_len): Rename from __gen_tempname.
Add a parameter, x_suffix_len, telling how many X's there must be at
the end of the template.
Use pseudo-random numbers all the way, rather than adding 7777
from one iteration to the next.
(__gen_tempname): New function, to call gen_tempname_len, requiring a
suffix length of 6.
* gl/lib/tempname.h: Add prototype for gen_tempname_len.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-07 19:44:07 +02:00
Jim Meyering
58a7ead41d Convert coreutils' rand*.{c,h,m4} into modules.
First step: move these files to gl/lib:
* lib/rand-isaac.c, lib/rand-isaac.h
* lib/randint.c, lib/randint.h
* lib/randperm.c, lib/randperm.h
* lib/randread.c, lib/randread.h

Step 2: add modules/rand* and remove now-unneeded .m4 files.
* gl/modules/randint: New file.
* gl/modules/randperm: New file.
* gl/modules/randread: New file.
* m4/randint.m4: Remove file.
* m4/randperm.m4: Remove file.
* m4/randread.m4: Remove file.

Step 3: use the new modules
* bootstrap.conf (gnulib_modules): Add randint and randperm.
* m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
These have been removed.
(gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.
2007-10-07 19:43:35 +02:00
Jim Meyering
696f4a8042 Copy from gnulib the parts of tempname that we'll modify.
* gl/lib/tempname.c: Copy from gnulib.
* gl/lib/tempname.h: Likewise.
* gl/modules/tempname: Likewise.

Allow GPLv2 on temporarily(?)-imported file from gnulib/libc.
* .x-sc_GPL_version: New file.
* Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version
2007-10-07 19:42:53 +02:00
Jim Meyering
11d4de7eb3 Avoid a pseudo-leak in sort.
* src/sort.c (main) [lint]: Avoid a nominal leak.
2007-10-07 18:41:49 +02:00
Jim Meyering
abdb73fc11 Use puts, rather than printf ("%s\n". Slightly cleaner.
* src/tsort.c (tsort): ...and more efficient.
2007-10-07 18:16:07 +02:00
Jim Meyering
f62f1d302a Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.
* bootstrap.conf (gnulib_modules): Add vasprintf-posix.
Suggestion from Bruno Haible.

Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-07 16:57:01 +02:00
Jim Meyering
fbaf2fbb18 Avoid a used-uninitialized error.
* src/copy.c (copy_internal): Don't overload "use_stat".
2007-10-07 16:56:46 +02:00
Jim Meyering
b4148f567d Make a failing cross-partition mv give a sensible diagnostic.
A cross-partition move of a file in a sticky tmpdir and owned by
another user would evoke an invalid diagnostic after copying it:

  mv: cannot remove `x': Operation not permitted

Either of the following (mv.c, remove.c) changes would fix the bug by
itself.  I think it's slightly better to use both; the added cost is
minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition,
rm: an extra lstat-per-unlink-that-fails-w/EPERM.
* src/remove.c (remove_entry): Also lstat the file upon EPERM.
* src/mv.c (rm_option_init): Initialize root_dev_ino just as is done
in rm, so that a cross-partition invoked remove.c:rm call works the
same way as one invoked from the command-line use of "rm".  That
setting of root_dev_ino makes rm() do the equivalent of an additional
lstat for each argument, which in turn gives rm enough information to
issue the right diagnostic.
* tests/mv/sticky-to-xpart (version): New file.  Test for the above.
* tests/mv/Makefile.am (TESTS): Add sticky-to-xpart.
Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (tb): New target, to run the new root-only test.
(all_t): Add tb.
* src/c99-to-c89.diff: Adjust offsets.
2007-10-05 13:26:46 +02:00
Jim Meyering
068fa34adc Add PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk.
* tests/check.mk (TESTS_ENVIRONMENT): Add PACKAGE_VERSION here,
rather than in every Makefile.am that needs it.
* tests/rm/Makefile.am (TESTS_ENVIRONMENT): Remove PACKAGE_VERSION.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
2007-10-05 12:57:03 +02:00
Jim Meyering
f8cd8d524c List two systems on which chroot works when run by non-root. 2007-10-05 09:03:42 +02:00
Jim Meyering
43d0c30bf0 Adapt to new gnulib naming scheme.
* gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h.
* gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h.
* gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES.
* gl/m4/selinux-selinux-h.m4: Likewise.
* gl/modules/selinux-h (Files, Makefile.am): Reflect renaming.
(Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h.
2007-10-04 12:33:32 +02:00
Jim Meyering
a7acdf85e4 lib/search_.h: Remove unused file. 2007-10-04 12:20:46 +02:00
Jim Meyering
7ba2dd8082 * bootstrap (update_po_files): Work also when there are no .po files in po/. 2007-10-04 11:55:31 +02:00
Jim Meyering
1641186cb3 * bootstrap (slurp): Adapt to _.h -> .in.h name change.
Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-10-04 11:53:46 +02:00
Jim Meyering
545cbc2cc8 Remove test program: lib/t-fpending.c.
* lib/t-fpending.c: Remove file.  Now, this test is in gnulib.
* lib/Makefile.am: Remove associated rules.
* .gitignore: Remove lib/t-fpending.
2007-10-04 10:26:11 +02:00
Jim Meyering
5cf961f0ea * tests/misc/selinux: Skip this test if the initial chcon fails. 2007-10-03 12:56:32 +02:00
Jim Meyering
1b8c8befd9 Never copy through a symlink that cp has just created.
* src/copy.c (copy_internal): When same-file detection requires
'stat'ing the destination file, also 'lstat' it and ensure that
it wasn't the destination of a preceding copy operation.
This bug was introduced on 2007-06-18.
* tests/cp/abuse: New test for the above.
* tests/cp/Makefile.am (TESTS): Add abuse.
2007-10-02 11:20:19 +02:00
Jim Meyering
65ee3d9630 cp: do not abbreviate in --help output.
* src/cp.c (usage): Don't abbreviate: s/=link/=links/.
Reported by Géraud Meyer in <http://bugs.debian.org/444137>.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-30 09:58:24 +02:00
Eric Blake
17f0d568d3 Fix testsuite on cygwin.
* check.mk (%.log): Also allow suffix-less tests, on platforms
where $(EXEEXT) is not empty.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-30 09:40:26 +02:00
Eric Blake
3c98f1d3ee Test previous patch.
* tests/misc/groups-dash: New test.
* tests/misc/Makefile.am (TESTS): Add it.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-30 09:40:25 +02:00
Eric Blake
329982b723 * src/groups.sh: Don't ignore first argument if later argument is --.
Signed-off-by: Eric Blake <ebb9@byu.net>
2007-09-29 07:53:49 +02:00
Jim Meyering
5b0e904272 Avoid spurious test failure when SELinux stats "selinux/class".
* tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.
2007-09-27 22:37:33 +02:00
Jim Meyering
491c54ca99 Move file-set and hash-triple modules to gnulib.
* bootstrap.conf (gnulib_modules): Remove file-set, now that
it's in gnulib, and the canonicalize module requires it there.
* gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
* gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set: Remove.
2007-09-27 10:53:36 +02:00
Jim Meyering
beaa39a649 Add a test to exercise a readlink bug.
* tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
fixed through today's change to Gnulib's canonicalize module.
* tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
Bug report and a test case from mpb.mail@gmail.com.
2007-09-27 10:53:08 +02:00
Pádraig Brady
23d293cbc2 Make "Date input formats" easier to find in info file
* doc/coreutils.texi (date invocation):
`man date` gives all options for the date command except
the description of the date input formats. Therefore it
should be easy to browse to this info using `info date`.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
2007-09-27 08:41:03 +02:00
Jim Meyering
0359c2e1ca Use XOR, not OR to combine bits.
* gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to
combine the bits from hashing the name and those of the inode number.
Add a few comments and remove out-of-context ones.
2007-09-25 21:27:14 +02:00
Jim Meyering
e2a6cbca3b * NEWS: The recent rm-diagnostic fix also affects cross-partition "mv". 2007-09-24 16:33:35 +02:00
Jim Meyering
49e002db5e copy.c: Remove definitions of factored-out functions.
* src/copy.c: Include "file-set.h".
(seen_file, record_file): Remove functions that I factored
out on 2007-08-23.
2007-09-24 15:09:26 +02:00
Jim Meyering
1b246cc692 Don't print the commands of a 10-line script that's run in each subdir.
* tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise.
2007-09-22 23:26:45 +02:00
Jim Meyering
a7ec8caffe rm: give a sensible diagnostic when failing to remove a symlink
On some systems (those with openat et al), when rm would fail to
remove a symlink, it would fail with the misleading diagnostic,
"Too many levels of symbolic links".
* NEWS: Mention the bug fix.
* src/remove.c (is_nondir_lstat): New function.
(remove_entry): Use it to catch failed-to-remove symlink (and any
other non-dir) here so that we don't fall through and try to treat
it as directory, which -- with a symlink -- would provoke the bogus
ELOOP failure.
* tests/rm/fail-eacces: Add a test for the above.
* src/c99-to-c89.diff: Adjust offsets.
2007-09-22 13:27:57 +02:00
Jim Meyering
920b4416c1 rm: fix a tiny, nearly inconsequential bug.
Don't perform a "."-relative lstat, when the file in question
may well not be in ".".  Although this is a bug, a few attempts
to exercise it on a linux-2.6.22 system failed.  You probably need
a pre-openat system to trigger the failure.  The consequence of this
bug would be a lower-quality diagnostic upon failed dir removal.
* src/remove.c (is_dir_lstat): Add a parameter, fd_cwd.
Use it instead of hard-coding AT_FDCWD.
(remove_entry): Call is_dir_lstat with fd_cwd.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-22 08:44:42 +02:00
Karl Berry
ebeb56f9df TODO: It'd be nice to add renice.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-22 08:39:44 +02:00
Jim Meyering
308adf1691 Avoid a test failure due to now-parallelized tests.
* tests/du/two-args: Run "du .." from a sub-directory one level deeper.
2007-09-21 08:30:55 +02:00
Jim Meyering
5d0c06a24a Fix typo in previous change.
Spotted by Andreas Schwab.
2007-09-19 11:13:46 +02:00
Jim Meyering
cbade34401 * coreutils.texi (expr invocation): Correct description of relative
operator precedence.  Reported by hanpingtian@gmail.com.
2007-09-19 10:25:40 +02:00
Jim Meyering
dbab417753 tests/misc/tac-continue: Arrange to remove a temporary file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
ed2a9e9637 tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of $(TESTS),
so that "make check TESTS=test-name" works once again.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
d423f4a14b tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-16 11:29:57 +02:00
Jim Meyering
2983e54536 Revamp most test scripts.
Add a ChangeLog entry summarizing the preceding 30+ change sets.
2007-09-16 01:24:37 +02:00
Jim Meyering
57c4cb5d88 * tests/rm/v-slash: Avoid test failure with non-C locale.
Reported by Michael Stone.
2007-09-16 01:06:16 +02:00
Jim Meyering
d96a863cf5 Enable some previously omitted test scripts. Add a test cross-check.
* tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Reenable this test.  Adjust for new rm.
* tests/mkdir/Makefile.am: Add writable-under-readonly.
* tests/mkdir/writable-under-readonly: Add some comments.
This test is always skipped, for now.
* tests/Makefile.am (ta): Hook up the new root-only script.
* tests/tail-2/infloop-1: Make this test pass.
* tests/tail-2/Makefile.am (TESTS): Add infloop-1.
* tests/tail-2/fflush: Remove unused file.
* tests/check.mk (vc_executable_is_in_TESTS): More portable.
* tests/check.mk (check): Depend on the above.
* build-aux/check.mk: Remove comment mentioning AUTHORS file.
2007-09-15 18:59:08 +02:00
Jim Meyering
56f1bd10fc Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
tests/check.mk (top_srcdir): Define.
tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir),
$(abs_top_srcdir), and $(abs_top_builddir), since they're
defined via the included tests/check.mk.
2007-09-15 08:40:39 +02:00
Jim Meyering
fbae6a7b39 tests/general: Remove from VC, this long-unused directory and contents. 2007-09-15 08:40:39 +02:00
Jim Meyering
53d36aaf9a Adapt tests/tail-2/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
10d190b8b6 Adapt tests/readlink/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
5cb2610710 Move the sole test in tests/ls-2/ to tests/misc/.
* tests/ls-2/basic-1: Move this file to ...
* tests/misc/ls-misc: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add ls-misc.
* tests/Makefile.am (SUBDIRS): Remove ls-2.
* tests/ls-2: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
a669dfdabb More misc, test-related changes. (some to allow running tests as root) 2007-09-15 08:40:39 +02:00
Jim Meyering
0539705768 Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
Reflect these renamings:
od/od-N             misc/od-N
od/x8               misc/od-x8
sha1sum/basic-1     misc/sha1sum
sha1sum/sample-vec  misc/sha1sum-vec
shred/exact         misc/shred-exact
shred/remove        misc/shred-remove
stty/basic-1        misc/stty
stty/invalid        misc/stty-invalid
stty/row-col-1      misc/stty-row-col

* tests/misc/Makefile.am (TESTS): Add the new files.
* tests/Makefile.am (SUBDIRS): Remove the dir names.
* tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the directories.
* configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile names.
2007-09-15 08:40:39 +02:00
Jim Meyering
44629cf147 Move the two tests in tests/tee to tests/misc/.
* tests/tee/basic: Move this file to ...
* tests/misc/tee: ...here.  Don't rely on $PROG in env.
* tests/tee/dash: Move this file to ...
* tests/misc/tee-dash: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tee.
* tests/Makefile.am (SUBDIRS): Remove tee.
* tests/tee: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
eb3f59b7e1 Move the two tests in tests/sum/ to tests/misc/.
* tests/sum/basic-1: Move this file to ...
* tests/misc/sum: ...here.  Don't rely on $PROG in env.
* tests/sum/sysv: Move this file to ...
* tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
* tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
* tests/Makefile.am (SUBDIRS): Remove sum.
* tests/sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
1529be6051 Move the sole test in tests/tsort/ to tests/misc/tsort.
* tests/tsort/basic-1: Move this file to ...
* tests/misc/tsort: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add tsort.
* tests/Makefile.am (SUBDIRS): Remove tsort.
* tests/tsort: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
47b7234de3 Move the sole test in tests/unexpand to tests/misc/unexpand.
* tests/unexpand/basic-1: Move this file to ...
* tests/misc/unexpand: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add unexpand.
* tests/Makefile.am (SUBDIRS): Remove unexpand.
* tests/unexpand: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.
2007-09-15 08:40:39 +02:00
Jim Meyering
d62bdb30f7 Move the sole test in tests/seq to tests/misc/seq.
* tests/seq/basic: Move this file to ...
* tests/misc/seq: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add seq.
* tests/Makefile.am (SUBDIRS): Remove seq.
* tests/seq: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
be23f60132 Convert tests/mkdir/ to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
570fd054c6 Move the two tests in tests/md5sum to tests/misc/md5sum.
* tests/md5sum/basic-1: Move this file to ...
* tests/misc/md5sum: ...here.  Don't rely on $PROG in env.
* tests/md5sum/newline-1: Move this file to ...
* tests/misc/md5sum-newline: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add md5sum.
* tests/Makefile.am (SUBDIRS): Remove md5sum.
* tests/md5sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile
2007-09-15 08:40:39 +02:00
Jim Meyering
b10817d9bd tests/sample-test: Update to use test-lib.sh. 2007-09-15 08:40:39 +02:00
Jim Meyering
03a08a4cd0 Convert tests/misc/ to use test-lib.sh, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
28f1844cef Convert tests/ls/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
7455bf9432 Convert tests/ln/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
74ffe86ed0 Convert tests/install/, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
a0cbaa4fc8 Move the two tests in tests/fmt to tests/misc/fmt.
* tests/fmt/basic: Move this file to ...
* tests/misc/fmt: ...here.  Don't rely on $PROG in env.
* tests/fmt/long-line: Move this file to ...
* tests/misc/fmt-long-line: ...here.
* tests/misc/Makefile.am (TESTS): Add fmt.
* tests/Makefile.am (SUBDIRS): Remove fmt.
* tests/fmt: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
aa3a727dc0 Move the sole test in tests/factor to tests/misc/factor.
* tests/factor/basic: Move this file to ...
* tests/misc/factor: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add factor.
* tests/Makefile.am (SUBDIRS): Remove factor.
* tests/factor: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
fd9f53cfdf Move the sole test in tests/expr to tests/misc/expr.
* tests/expr/basic: Move this file to ...
* tests/misc/expr: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add expr.
* tests/Makefile.am (SUBDIRS): Remove expr.
* tests/expr: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
ec2064acc8 Convert tests/du/*, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
18b3231bbf Move the sole test in tests/dircolors to tests/misc/dircolors.
* tests/dircolors/simple: Move this file to...
* tests/misc/dircolors: ...here.  Don't rely on $PROG in env.
* tests/misc/Makefile.am (TESTS): Add dircolors.
* tests/Makefile.am (SUBDIRS): Remove dircolors.
* tests/dircolors: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile
2007-09-15 08:40:38 +02:00
Jim Meyering
ceb5b04614 Convert tests/dd/*, too. 2007-09-15 08:40:38 +02:00
Jim Meyering
33173e867a Convert tests/mv, too.
* tests/other-fs-tmpdir: Before, all callers would exit 77 upon failure to
find the required dir.  Now, exit 77 in this script so callers don't have to.
Adjust callers.
2007-09-15 08:40:38 +02:00
Jim Meyering
df0beae1eb Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
* tests/check.mk: Also define abs_top_builddir.
2007-09-15 08:40:38 +02:00
Jim Meyering
c840cd4334 Parallel "make check" support.
* build-aux/check.mk: New file, from The Vaucanson Group.
* .x-sc_GPL_version: New file, to allow "version 2 or later"
in build-aux/check.mk.
* Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
* tests/check.mk: New file.
* tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.

Begin factoring "sample-test" out of test scripts.
* tests/test-lib.sh: New file, to be sourced by all tests that
were previously derived from the "sample-test" template.
* tests/mkdtemp: New file.
* tests/touch/dir-1: Use test-lib.sh.
* tests/touch/empty-file: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/no-rights: Likewise.  Also, don't sleep.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
* tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
to get the parallel-"make check" bits.

Move a slow test into tests/misc.

* tests/check.mk: Wrapper.
* tests/ls/time-1: Move this file to tests/misc/ls-time.
* tests/misc/ls-time: New file.  From tests/ls/time-1.
* tests/ls/Makefile.am (TESTS): Remove time-1.
* tests/misc/Makefile.am (TESTS): Add ls-time.
2007-09-15 08:40:38 +02:00
Jim Meyering
7a6a30b8a2 Add support for parallel "make check" (in tests/misc, for now) 2007-09-15 08:40:38 +02:00
Jim Meyering
5c2f8101c5 * vc-list-files: Remove mercurial support.
Check for CVS first.  Adjust comments.
2007-09-15 08:39:53 +02:00
Jim Meyering
eaa1c07fa1 Accommodate gnulib's renaming: __fpending.h -> fpending.h.
* lib/t-fpending.c: Include "fpending.h", not "__fpending.h".
2007-09-08 21:35:31 +02:00
Jim Meyering
500eccdbe4 chmod: don't ignore a dangling symlink
* NEWS: Mention the bug fix.
* src/chmod.c (process_file): Handle the case of FTS_SLNONE,
i.e., give a diagnostic saying we cannot operate on such a file.
* tests/chmod/thru-dangling: Compare new stderr output with expected.
2007-09-07 10:45:22 +02:00
Bob Proulx
e70487cda7 Add a test: demonstrate that chmod ignores a dangling symlink
* tests/chmod/thru-dangling: New test.  Fails.
* tests/chmod/Makefile.am (TESTS): Add thru-dangling.
2007-09-07 10:31:14 +02:00
Jim Meyering
0fb836f179 Adapt to new SELinux behavior: "?" vs. new "unlabeled"
* src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
from getfilecon/lgetfilecon the same way we interpret a negative
return value: no security context.  So we don't print the "+".
* tests/selinux: Recognize that "unlabeled" means insufficient
support for SELinux, just like "?".
2007-09-05 10:58:45 +02:00
Jim Meyering
4055cd5a26 Run autoconf manually, if needed to get an updated version string.
* GNUmakefile: Don't actually touch configure.ac.
That would make git-version-gen always print "...-dirty".
2007-09-03 11:22:20 +02:00
Jim Meyering
d0bd493a2a Don't change '-'s to '.'s in the string from git-describe.
* build-aux/git-version-gen: Leave '-'s in the string from git-describe.
Otherwise, s/-/./g would make it too hard to distinguish the base
version number from the appended .DD suffixes.

2007-09-03  Jim Meyering  <jim@meyering.net>
2007-09-03 10:38:22 +02:00
Jim Meyering
698091be0e README-hacking: Require rsync, rather than wget. 2007-09-03 09:07:20 +02:00
Jim Meyering
e4637b48b5 * bootstrap (WGET_COMMAND): Remove code to set this variable. 2007-09-02 13:49:49 +02:00
Jim Meyering
3ed2b48d10 Ensure that $(VERSION) is up to date for dist-related targets.
* GNUmakefile: Arrange to rerun autoconf, if the version reported
by git-version-gen doesn't match $(VERSION), but only for dist targets.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-02 13:48:36 +02:00
Jim Meyering
2c57c49cc3 bootstrap: uses rsync to download the .po files
* bootstrap (po_download_command_format): New global.
(download_po_files): Use rsync.
(update_po_files): Don't remove .po files after download,
so future rsync runs can take advantage of the copies.
2007-09-02 09:38:50 +02:00
Jim Meyering
5fabec7fb6 * bootstrap (gnulib_tool): Make sha1sum check quietly.
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-09-01 19:54:04 +02:00
Jim Meyering
940c1a61f4 Ensure that snapshot version changes make it to groups, too.
* src/Makefile.am (groups): Depend on Makefile.
2007-09-01 11:22:30 +02:00
Jim Meyering
6873756075 Make groups-version executable,
* tests/misc/groups-version: ... as it was in the patch.
2007-09-01 11:20:42 +02:00
Eric Blake
3637b9572b Test yesterday's change to groups.
* tests/misc/groups-version: New test.
* tests/misc/Makefile.am (TESTS): Add groups-version.
2007-08-31 23:26:44 +02:00
Jim Meyering
89907ec099 Solve the unnecessary-.po-file-regeneration problem once and for all.
* bootstrap (download_po_files): New function, renamed from
get_translations.  Now, downloads, but doesn't update LINGUAS.
(update_po_files): New function.
2007-08-31 22:18:01 +02:00
Jim Meyering
42a4957361 Shorten the snapshot version string by removing the "g".
* build-aux/git-version-gen: Remove git-describe's "g" that would
always precede the abbreviated SHA1.  Suggestion from Dmitry V. Levin.
2007-08-30 23:13:12 +02:00
Jim Meyering
624d125cee Perform the s,rm,/bin/rm, fix-up properly. No more kludge.
* Makefile.am (EXTRA_DIST): Remove .kludge-stamp.
(.kludge-stamp): Remove rule.  Instead, ...
(dist-hook): Do the job here, operating on the file in $(distdir).
(rm_subst): Adjust regexp to match "rm -f rm$(EXEEXT)", not "rm -f rm".
(MAINTAINERCLEANFILES): s/+=/=/, now that this is the sole use.
(dist-hook): Remove the legacy-from-cvs install-sh is-executable check.
* .gitignore: Remove .kludge-stamp.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-30 17:28:12 +02:00
Jim Meyering
bfe49f506f Make inter-release --version output more useful.
Now, each snapshot has a version "number" like 6.9-219-g58ddd,
which indicates that it is built using the 219th change set
(in _some_ repository) following the "v6.9" tag, and that 58ddd
is a prefix of the commit SHA1.
* build-aux/git-version-gen: New file.
* configure.ac: Run it to set the version.
* Makefile.am (dist-hook): Arrange so that .version appears only
in distribution tarballs, never in a checked-out repository.
* .gitignore: Add .version here, too.  Just in case.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-30 17:26:31 +02:00
Eric Blake
8138613746 * src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT). 2007-08-30 17:25:20 +02:00
Eric Blake
4b11f24c64 Use PACKAGE_NAME instead of GNU_PACKAGE.
* src/Makefile.am (.sh, uninstall-local): Adjust all users of
hand-rolled GNU_PACKAGE to instead use autoconf-provided
PACKAGE_NAME.
* src/basename.c (main): Likewise.
* src/chroot.c (main): Likewise.
* src/dirname.c (main): Likewise.
* src/echo.c (main): Likewise.
* src/expr.c (main): Likewise.
* src/factor.c (main): Likewise.
* src/groups.sh (version): Likewise.  Also, reflect change in
--version output due to GPLv3.
* src/hostid.c (main): Likewise.
* src/hostname.c (main): Likewise.
* src/link.c (main): Likewise.
* src/logname.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/nohup.c (main): Likewise.
* src/printenv.c (main): Likewise.
* src/printf.c (main): Likewise.
* src/pwd.c (main): Likewise.
* src/setuidgid.c (main): Likewise.
* src/sleep.c (main): Likewise.
* src/system.h (case_GETOPT_VERSION_CHAR): Likewise.
* src/test.c (main): Likewise.
* src/true.c (main): Likewise.
* src/unlink.c (main): Likewise.
* src/uptime.c (main): Likewise.
* src/users.c (main): Likewise.
* src/whoami.c (main): Likewise.
* src/yes.c (main): Likewise.
* configure.ac (AC_CHECK_DECLS): No need to check strtoimax,
strtoumax, since gnulib does this.
2007-08-30 17:12:56 +02:00
Jim Meyering
58ddd2c5a1 Ensure that TMPDIR is valid. Otherwise, it would cause test failures.
* tests/misc/tty-eof: Set TMPDIR=.
* tests/misc/sort-compress: Likewise.
2007-08-29 00:17:27 +02:00
Jim Meyering
35755454e4 Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
* src/system.h (EXIT_FAIL): Remove definition.
* src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE.
* src/env.c (main): Likewise.
* src/nice.c (main): Likewise.
* src/su.c (change_identity, main): Likewise.
* src/tty.c (main): Likewise.
Suggestion from Eric Blake.
2007-08-29 00:14:23 +02:00
Jim Meyering
adfc479d47 * src/test.c (usage): Say that [ honors --help and --version, but test does not. 2007-08-28 18:42:45 +02:00
Jim Meyering
d6d5658df6 By default, do not install hostname anymore; no kidding, this time.
* src/Makefile.am (EXTRA_PROGRAMS): Remove hostname from this list,
now that it's no longer being installed by default.  This should
have been part of the 2007-08-21 change.
(check-duplicate-no-install): New rule to ensure this doesn't
happen again.
(check): Depend on it.
2007-08-28 18:24:54 +02:00
Jim Meyering
c370a7e62f Reflect renaming: mreadlink-with-size -> areadlink-with-size.
* bootstrap.conf: Update module name.
* src/copy.c (copy_internal): Update header and function names.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.
2007-08-28 11:23:27 +02:00
Jim Meyering
cbdbbc4a58 Add file system type names and magic numbers from "man 2 statfs".
* src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC,
FUSECTL, HUGETLBFS, NFSD and OPENPROM.
2007-08-28 00:14:20 +02:00
Jim Meyering
505eee2f38 Add some file system type names and magic numbers from glibc.
* src/stat.c (human_fstype): Add any file system names and values
present in glibc's linux_fsinfo.h but not in this list.
Alphabetize the S_* names and capitalize the hexadecimal constants.
2007-08-27 23:47:45 +02:00
Jim Meyering
ddb029b0f0 tests/misc/fold: Fix a typo: missing \ in a never-seen diagnostic 2007-08-26 18:45:19 +02:00
Eric Blake
a2f768f65e Avoid case-insensitive clash in one-page-per-node html docs.
* coreutils.texi (Concept index): Rename from Index.
2007-08-26 14:54:33 +02:00
Jim Meyering
eea7d892c4 * src/dircolors.hin: Add .dz and .svgz as archive suffixes. 2007-08-25 20:47:03 +02:00
Jim Meyering
6e3e819f4b Remove all .cvsignore files from version control. 2007-08-25 00:27:11 +02:00
Jim Meyering
ec06465572 bootstrap: Ignore more.
* bootstrap (symlink_to_dir): Add a directory name like
uniwidth to e.g., lib/.gitignore.
(slurp): Handle the sys_stat_.h -> sys mapping, too.
* .hgignore: Remove this file, too.
* Makefile.am (EXTRA_DIST): Remove .gitignore and .hgignore.
2007-08-25 00:21:30 +02:00
Jim Meyering
ee84700f76 No longer version-control .???ignore files in lib/, m4/, and po/.
* .gitignore: Ignore a few files in lib/, m4/, and po/ that are not
picked up automatically.
* lib/.gitignore, lib/.cvsignore: Remove files.
* m4/.gitignore, m4/.cvsignore: Remove files.
* po/.gitignore, po/.cvsignore: Remove files.
2007-08-24 23:53:19 +02:00
Jim Meyering
d71657c17b bootstrap: when fetching .po files, do not remove .gmo files.
* bootstrap (get_translations): Don't remove *.gmo files!
They can be expensive to regenerate.
2007-08-24 22:42:33 +02:00
Jim Meyering
8f3cb068fc Create .gitignore and/or .cvsignore from scratch, if absent.
This is in preparation for my removing those files from version
control in the directories managed by gnulib-tool.
* bootstrap: New setting: vc_ignore.
(insert_sorted_if_absent): Create $file if absent.
Adapt to new, possibly empty, list: $vc_ignore.
2007-08-24 22:42:07 +02:00
Jim Meyering
bcc1a1625c * src/system.h (fseeko, ftello): Remove now-unneeded definitions. 2007-08-24 14:55:24 +02:00
Jim Meyering
0ea19fb55c * src/od.c (LDBL_DIG): Remove now-unneeded definition. 2007-08-24 14:51:55 +02:00
Jim Meyering
dbb6c7b2e7 Arrange to use tag names like vM.N, rather than COREUTILS-M_N.
* Makefile.maint (this-vc-tag) [git]: Simply use v$(VERSION).
(this-vc-tag-regexp): New variable.
(vc-tag-check): Use it, rather than $(this-vc-tag).
2007-08-24 14:07:06 +02:00
Jim Meyering
90b11ce665 * src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
Suggestion from Dan Nicolaescu.
2007-08-23 16:33:11 +02:00
Jim Meyering
d02e4e7775 Don't let ln be a party to destroying user data.
* src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h".
(dest_set, DEST_INFO_INITIAL_CAPACITY): New globals.
(do_link): Refuse to remove a just-created link.
Record a name,dev,ino triple for each link we create.
(main): Initialize dest_set, if needed.
* tests/mv/childproof: Test for the above fix.
* NEWS: Document this.
Reported by Eric Blake.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-23 14:00:35 +02:00
Jim Meyering
22ed81c410 Move functions from copy.c into new modules, since ln needs them, too.
* bootstrap.conf (gnulib_modules): Add file-set.
* gl/lib/file-set.c (record_file, seen_file): Functions from copy.c.
* gl/lib/file-set.h: Add prototypes.
* gl/lib/hash-triple.c (triple_hash, triple_hash_no_name):
(triple_compare, triple_free): Functions from copy.c.
* gl/lib/hash-triple.h (struct F_triple): Define.  From copy.c.
Add prototypes.
* gl/modules/file-set: New module.
* gl/modules/hash-triple: New module.
* src/Makefile.am (copy_sources): New variable.
(ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it.
* src/copy.c: Include hash-triple.h.
No longer include hash-pjw.h.
(copy_internal): Don't pass a NULL third argument to record_file,
since that function no longer accepts that.
(record_file): Move this function to file-set.c.
Along the way, remove the code to allow a NULL stat-buffer pointer.
Adjust sole caller.
(seen_file): Move this function to file-set.c.
(struct F_triple): Move declaration to hash-triple.h.
(triple_compare, triple_free, triple_hash, triple_hash_no_name):
Move these functions to hash-triple.c.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-08-23 13:59:40 +02:00
Jim Meyering
173524ed7d bootstrap: generate more names and fix a bug
* bootstrap (slurp): Don't test for existence of $copied,
which is usually a newline-separated list of file names.
When generating ignorable names, also map .sin to .sed,
.gperf to .c, and .y to .c.
2007-08-23 10:57:07 +02:00
Jim Meyering
144fe359e1 * Makefile.maint (patch-check): Don't remove temporaries upon failure. 2007-08-23 09:46:14 +02:00
Jim Meyering
2005de6be9 * src/c99-to-c89.diff: Adjust offsets. 2007-08-22 23:49:51 +02:00
Jim Meyering
0918810a7d Change "rm --verbose -r a//" not to print extra slashes in a///b
* src/remove.c (push_dir): Don't copy trailing slashes onto the stack.
Reported by François Pinard.
* tests/rm/v-slash: New file.  Test for the above change.
* tests/rm/Makefile.am (TESTS): Add v-slash.
2007-08-22 20:02:34 +02:00
Jim Meyering
55539fc6bd Don't include "getline.h".
That file has just been removed from gnulib;
its declarations are now in <stdio.h>.
* src/md5sum.c: Likewise.
* src/dircolors.c: Likewise.
2007-08-22 16:59:40 +02:00
Jim Meyering
a5153c5b06 * src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment. 2007-08-22 11:20:41 +02:00
Jim Meyering
fba081f923 By default, do not install hostname anymore.
* configure.ac: Add "hostname" to the list of not-installed programs.
* src/Makefile.am (no_install__progs): Add "hostname" here, too.
* NEWS: Mention this.
2007-08-21 10:36:05 +02:00
Bob Proulx
741f851bf6 Clarify touch documentation of file arguments.
* src/touch.c (usage): Improve wording of documentation regarding
file argument handling and special handling of - argument.
* doc/coreutils.texi (touch invocation): Likewise.
Documentation problem reported by Vincent Lefevre.
2007-08-21 09:01:07 +02:00
Paul Eggert
6dfe8fc30d NEWS: note that a cp -p bug fixed in 6.7 affected releases before 6.0.
Problem reported by Soren Spies in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-08/msg00106.html>.
To be conservative, just say the bug was in all versions through 6.6.
2007-08-20 17:29:27 +02:00
Eric Blake
feed02af9d Avoid consuming too much seekable input when yesno is used.
* bootstrap.conf (gnulib_modules): Grab closein.
* src/system.h (includes): Also include closein.h.
* src/mv.c (main): Use close_stdin, not close_stdout.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/rm.c (main): Likewise.
* src/install.c (main): Likewise.
* NEWS: Document the fix.
2007-08-20 17:03:45 +02:00
Jim Meyering
a05ae2f716 Use new "idcache.h" header.
* src/ls.c: Remove ancient declarations of getuser and getgroup.
Include "idcache.h", instead.
2007-08-18 08:59:17 +02:00
Jim Meyering
b78c6b68f7 Run each Coreutils.pm-based test in its own subdirectory.
* tests/CuTmpdir.pm: New file.
* tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm.
* tests/misc/od, tests/misc/base64, tests/misc/basename:
* tests/misc/cut, tests/misc/date, tests/misc/dirname:
* tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
* tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
* tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
* tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
* tests/misc/wc-files0-from, tests/misc/xstrtol:
* tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
* tests/expr/basic, tests/factor/basic, tests/fmt/basic:
* tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
* tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
* tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
* tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
* tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
not "../../src/test", so it works when run from a subdirectory.
* tests/ls-2/tests: Create temp files and dirs from within the perl
script, so that they're removed, when run from a subdirectory.
2007-08-18 08:53:31 +02:00
Jim Meyering
d2e5e366a1 Consolidate od tests.
* tests/misc/od: Perform od-zero-len's test here.
Include boilerplate code, so tests run in a subdirectory.
* tests/misc/od-zero-len: Remove this file.
2007-08-16 19:18:29 +02:00
Jim Meyering
e069d38d35 * tests/ls/time-1: Include sample-test boilerplate code.
Remove the then-unnecessary, hard-coded envvar "unset" commands.
2007-08-16 15:50:00 +02:00
Jim Meyering
535a9fe512 od --skip (-j) works even on files in /proc, when the kernel lies
* src/od.c (skip): Don't let kernel misinformation (nonempty files
in /proc with stat.st_size == 0) make "od -j N" misbehave.
Patch by Paul Eggert.
* NEWS: Document this work-around.
* tests/misc/od-zero-len: New file, test for the above.
2007-08-15 22:45:55 +02:00
Jim Meyering
9ee7933b5c * src/printf.c (usage): Adjust summary to also mention OPTIONs.
From Karl Berry.
2007-08-15 10:05:22 +02:00
Jim Meyering
e769e6e632 Add tests for the just-fixed "od -j N FILE" bug.
* tests/misc/od: New file, test for the above.
* tests/misc/Makefile.am (TESTS): Add od.
2007-08-14 10:39:05 +02:00
Jim Meyering
1490f2dbf3 od: fix a bug that arises when skipping exact length of file
* NEWS: Document the bug fix.
* src/od.c (skip): Call fseek even when n_skip is exactly the
same as the length of the current file.  Otherwise, the next
iteration would use unadjusted input stream pointer, thus ignoring
the desired "skip".  Report and patch by Paul GHALEB.
2007-08-14 09:47:05 +02:00
Paul Eggert
ed31c612c1 Accommodate more xstrtol changes.
* src/df.c (long_options): Don't bother prepending "--" to long
options that OPT_STR might decode, as that hack is no longer needed.
(main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR.
* src/du.c (long_options, main): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (long_options, main): Likewise.
* src/pr.c (first_last_page, main): Likewise.
* src/sort.c (long_options, specify_sort_size): Likewise.
* src/pr.c (first_last_page): Accept option index and option char
instead of an assembled option string.  All callers changed.
* src/sort.c (specify_sort_size): Likewise.
* src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
Remove.
2007-08-11 08:32:50 +02:00
Jim Meyering
d243c0e840 Adapt to gnulib's latest xstrtol change.
* POTFILES.in: Use lib/xstrtol-error.c, not lib/xstrtol.h.
2007-08-08 20:02:55 +02:00
Jim Meyering
e1e97eccb7 Encapsulate a static variable.
* src/system.h (opt_str_storage): Move static var into...
(short_opt_str): ... new static inline function.
(OPT_STR): Use the new function.
2007-08-05 15:42:59 +02:00
Jim Meyering
8c8f3467f5 * POTFILES.in: Remove lib/human.c. 2007-08-04 13:45:34 +02:00
Jim Meyering
23183bb36b Exercise xstrtol's diagnostics via pr's --pages option.
* tests/misc/xstrtol: New file.
* tests/misc/Makefile.am (TESTS): Add xstrtol.
2007-08-04 13:45:21 +02:00
Paul Eggert
8188c3b48d Adapt to new human and xstrtol API.
* src/df.c (long_options): Prepend "--" to long options that
OPT_STR might decode.
* src/du.c (long_options): Likewise.
* src/od.c (long_options): Likewise.
* src/sort.c (long_options): Likewise.
* src/df.c (main): Adjust to new human and xstrtol API.
* src/du.c (main): Likewise.
* src/ls.c (decode_switches): Likewise.
* src/od.c (main): Likewise.
* src/pr.c (first_last_page): Likewise.  New argument OPTION.
All callers changed.
* src/sort.c (specify_sort_size): New arg OPTION.  All callers
changed.  Adjust to new xstrtol API.
* src/system.h (opt_str_storage): New static var.
(OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros.
2007-08-04 13:36:59 +02:00
Jim Meyering
33f95a9ab6 Adjust one more test to accommodate the recent fts change.
This matters only on systems with insufficient openat support.
* tests/du/inacc-dest: Adjust expected diagnostic.
2007-08-02 19:48:03 +02:00
Jim Meyering
674ea8b2dc Adjust the other two "no-x" tests and unify all three.
* tests/du/no-x: Factor out du-specific bits.
* tests/chmod/no-x: Use the same code.
* tests/chgrp/no-x: Use the same code.
2007-08-02 19:27:07 +02:00
Jim Meyering
df03463679 Adapt du's no-x test not to fail on older Linux systems.
* tests/du/no-x: Accept a third variant of the diagnostic.
2007-08-02 18:52:40 +02:00
Jim Meyering
fd9a6e860b du: print size (probably incomplete) of each inaccessible directory
* src/du.c (process_file): Print what we know of the size of a
 directory even when it is inaccessible.  What we print is just the
 size of the directory itself, not counting any of its contents.
 * tests/du/inacc-dir: Test for this.
 * NEWS: Mention this change.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-31 12:10:11 +02:00
Jim Meyering
3b03442c54 Add a test for du not counting size of inaccessible directories.
* tests/du/inacc-dir: New file. Test for fts.c bug fixed yesterday.
 * tests/du/Makefile.am (TESTS): Add inacc-dir.
 * NEWS: Mention the bug fix.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-31 12:10:11 +02:00
Jim Meyering
1b6f200c8e Adjust indentation to reflect today's change. 2007-07-29 15:47:11 +02:00
Jim Meyering
288524b39b Attempt to copy a regular file, even if stat says it is empty.
* NEWS: Document this bug fix.
* src/copy.c (copy_reg): Read from a regular file, even if it
appears (stat.st_size == 0) to be empty.  This reverts an
optimization introduced on 2005-11-23 for coreutils-6.0.
Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file,
on e.g., linux-2.6.20.
* tests/cp/proc-zero-len: New file.  Test for the above.
* tests/cp/Makefile.am (TESTS): Add proc-zero-len.
Reported by Dan Berrangé.
2007-07-29 12:03:15 +02:00
Bob Proulx
26468bd5a2 sort: Improve sort --random-sort test.
Jim Meyering wrote:
> so if your test were to run sort -R twice, and compare *those* outputs,
> then it would trigger on this bug.

Thanks.  I don't have a system with the failure so I was working
blind.  Here is a rework of the patch.

Bob

>From 76dafb0dde4f8d685eb2b4b43fbf3c1cf9f0ff4b Mon Sep 17 00:00:00 2001
From: Bob Proulx <bob@proulx.com>
Date: Thu, 26 Jul 2007 02:19:49 -0600
Subject: [PATCH] sort: Improve sort --random-sort test.
* tests/misc/sort-rand: If "locale" is available pick a random
non-C locale and check "sort --random-sort" behavior using it.

Signed-off-by: Bob Proulx <bob@proulx.com>
2007-07-26 10:32:21 +02:00
Jim Meyering
813d66cea7 NEWS: Move the other "sort" entry from the 6.9 section into 6.10 "Bug fixes". 2007-07-24 10:01:44 +02:00
Jim Meyering
c12bf5fb7f sort: add a test to exercise the affected code.
* tests/sort/Test.pm (realloc-buf): Exercise the code that changed
yesterday.  No other test in all of "make check" does this.
* NEWS: Mention the fix.
2007-07-24 09:59:14 +02:00
Paul Eggert
9d8e077ca1 sort: avoid unaligned access.
* src/sort.c (fillbuf): When enlarging the line buffer, ensure that
the new size is a multiple of "sizeof (struct line)".  This avoids
alignment problems when indexing from the end of the buffer.
Problem reported by Andreas Schwab in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-07/msg00158.html>.
2007-07-24 09:40:55 +02:00
Jim Meyering
71aa3ea880 Update all copyright notices to use the newer form. 2007-07-23 14:35:58 +02:00
Jim Meyering
5f606e6f1f * COPYING: Update to Version 3. 2007-07-23 14:31:01 +02:00
Jim Meyering
7326d1f1a6 Update c99/c89 patch for new, copyright-change-induced offsets.
* Makefile.maint (patch-check): Filter out '^Only in...' lines.
* src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-23 14:07:02 +02:00
Jim Meyering
cd098ea199 Arrange to rerun configure whenever src/Makefile.am changes.
* configure.ac: Arrange to rerun configure whenever src/Makefile.am changes.
That file contains the list of program names that must be substituted into
files like man/Makefile.
Add quotes around AC_SUBST arguments.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-22 19:26:22 +02:00
Paul Eggert
a0c8d0e0fe * bootstrap (slurp): Work even in environments where "ls" defaults
to "ls -A".  Put in a FIXME, though, since the current code does
not slurp files whose names start with ".", and this looks like
it might be a troublesome area.
2007-07-21 15:00:54 +02:00
Jim Meyering
366aaf59dc Document and add a test for today's sort bug fix.
* NEWS: Describe the bug fix.
* tests/sort/Test.pm (obs-inval): Add a test for today's fix.
2007-07-20 18:42:23 +02:00
Andreas Schwab
0cf6181947 * src/sort.c (main): Don't free a pointer to non-malloc'd memory. 2007-07-20 16:29:06 +02:00
Jim Meyering
1f2c2d7053 Fix a portability bug in the new ls-color test.
* tests/ls/stat-free-symlinks: Don't rely on the ability of
a built-in printf to interpolate '\e'.  Use '\033' instead.
2007-07-19 10:17:39 +02:00
Jim Meyering
7465b002f9 "cp -i --update older newer" no longer prompts; same for mv
* src/copy.c (copy_internal): Perform "update" check before the
possible interactive prompt.  Reported by zeno_AT_biyg_DOT_org
in <http://bugzilla.redhat.com/248591>
* tests/mv/update: Add tests for the above.
* NEWS: Mention the bug fix.
2007-07-19 10:14:41 +02:00
Jim Meyering
8062509aa7 ChangeLog: Mention the correct function name in the 2007-07-08 bootstrap
entry.
2007-07-17 09:16:59 +02:00
Jim Meyering
0a744370bb ls --color: Don't stat symlinks when neither ORPHAN nor MISSING attribute has a color.
* src/ls.c (main): Don't set check_symlink_color when C_EXEC is
colored, unless ln=target (aka color_symlink_as_referent) is set.
(gobble_file): Set f->linkok = true also when !check_symlink_color.
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927
Reported by Jeremy Maitin-Shepard.
* tests/strace: New file, contents extracted from...
* tests/mv/atomic: ...here.  Source strace.
* tests/ls/stat-free-symlinks: New file.  Test for the above.
Use strace to ensure that in this corner case, ls does not call stat.
* tests/ls/Makefile.am (TESTS): Add stat-free-symlinks.
* tests/Makefile.am (EXTRA_DIST): Add strace.
2007-07-15 22:13:44 +02:00
Jim Meyering
065109af86 * coreutils.texi: Revise node structure per new fdl.texi. 2007-07-15 22:11:45 +02:00
Jim Meyering
1e07a21459 Remove long-deprecated options.
* NEWS: Mention this.
* src/df.c, src/ls.c: Remove --kilobytes option.
* src/du.c: Remove --kilobytes and --megabytes options.
* src/who.c: Remove -i and --idle options.
* src/ptx.c: Remove --copyright option.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-14 19:17:01 +02:00
Jim Meyering
78adb282a7 Change interface: make 2nd param _space_-separated, not comma-separated
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Remove now-
unnecessary use of tr.
Improve comments.
* configure.ac: Adjust caller, as well as the code that ensures the
2nd parameter stays in sync with the list in src/Makefile.am.
2007-07-14 10:05:23 +02:00
Karel Zak
1ff9e235e7 * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
(gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter.
Don't mix comma- and space-separated lists.
Patch from Karel Zak.
2007-07-14 09:38:42 +02:00
Jim Meyering
916fcda554 Warn about non-portable use of unescaped backslash at end of string,
and treat it as if it were escaped.
* src/tr.c (unquote): Considering that such usage would make GNU tr
from coreutils-5.2.1 and earlier *fail*, the least we can do now is
to warn about it.  Solaris' tr ignores it.
* NEWS: Mention this.
2007-07-13 18:37:16 +02:00
Jim Meyering
d26ba897eb Use proper backslash-quoting inside backticks.
* configure.ac: Otherwise we run afoul of strict GNU tr:
a string ending in a lone backslash would provoke a failure.
2007-07-13 14:12:01 +02:00
Jim Meyering
cee14cc42f Expand default-no-install prog list in ./configure --help output,
and fix some []-quoting bugs in sed expressions.
* configure.ac: Hard-code the list, "arch,su" here as well
as in src/Makefile.am, and ensure the two stay in sync.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2,
rather than the nearly-equivalent shell variable.
Karel Zak reported that ./configure --help's output included
the literal string, $gl_no_install_progs_default.
2007-07-12 20:58:53 +02:00
Jim Meyering
13b2b9c342 Clean up include-exclude-prog.m4.
* m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN.
(gl_REMOVE_PROG): Likewise.
Add omitted "\>" in sed regexp.
Remove any leading or trailing spaces.
(gl_ADD_PROG): Remove any leading space.
* configure.ac: Instead, derive $MAN from $optional_bin_progs.
Append $(EXEEXT) to *all* names, not just the first one.
2007-07-12 11:41:32 +02:00
Jim Meyering
e345806d93 If there's a GPL vN copyright comment, require that N == 3.
* Makefile.maint (sc_GPL_version): New rule.
* tests/misc/arch: Fix the sole violation.
2007-07-11 11:25:57 +02:00
Jim Meyering
89dc019451 Skip "arch" test if it's not built.
* tests/misc/Makefile.am (built_programs): Define.
(TESTS_ENVIRONMENT): Add $(built_programs), for...
* tests/misc/arch: ...this: skip the test if arch is not built.
* src/Makefile.am (built_programs.list): New rule.
* tests/Makefile.am (built_programs): Rename from all_programs.
(TESTS_ENVIRONMENT): Use built_programs, not all_programs.
* tests/help-version: Likewise.
* NEWS: Mention that using --enable-no-install-program=X may
cause "make check" to fail.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10 23:39:05 +02:00
Jim Meyering
471d33582e Add support for enabling/disabling installation of specified programs.
* NEWS: Mention new configure-time options.
Mention that neither arch nor su is built/installed, by default.
* m4/include-exclude-prog.m4: New file.
* configure.ac: Use new macro, gl_ADD_PROG, rather than
manually appending to OPTIONAL_BIN_PROGS and MAN.
Move the code that adds "df" to the list of programs to build from
m4/jm-macros into this file.
Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [.
(NO_INSTALL_PROGS_DEFAULT): AC_SUBST it.  Used by man/Makefile.am.
* man/Makefile.am (dist_man_MANS): Remove from this list all man pages
corresponding to "bin" programs. Add $(MAN) instead.
(optional_mans): Remove all uses.
(check-x-vs-1): Adapt to work even though arch and su are typically
no longer built (and neither are their .1 files).
* src/Makefile.am (install_su): Rename from INSTALL_SU, now that
INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
2007-07-10 22:55:15 +02:00
Karel Zak
264021699c New program: arch
* NEWS: Mention arch.
* README: Add arch to the list of programs.
* AUTHORS: Add arch.
* src/uname.c: Include "uname.h".
(PROGRAM_NAME): Handle arch, too.
(ARCH_AUTHORS): Define.
(uname_long_options, arch_long_options): Renamed and new globals.
(usage): Handle arch-mode as well as uname-mode.
(decode_switches): New function, extracted from main,
to handle arch-mode as well as uname-mode.
(main): Handle both modes.
* src/uname-arch.c: New program, alias for "uname -m".
* src/uname-uname.c: New file, default uname mode.
* src/uname.h: New file, uname modes.
* src/Makefile.am (EXTRA_PROGRAMS): Add arch.
(uname_SOURCES, arch_SOURCES): Define.
* man/arch.x: New file.
* man/Makefile.am (dist_man_MANS): Add arch.1.
(arch.1): New dependency.
* tests/misc/arch: New test, compare "arch" with "uname -m"
* configure.ac (OPTIONAL_BIN_PROGS): Add arch.
(MAN): Add arch.1.
* .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c
from the always-include-<config.h> rule.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10 19:00:00 +02:00
Jim Meyering
33342c1a0a Change "version 2" to "version 3" in all copyright notices. 2007-07-10 13:35:56 +02:00
Jim Meyering
578332c0e2 Compensate for new c99'isms in seq.c.
* Makefile.maint (patch-check): Use -p1, not -p2, so a patch
generated via "make patch-check REGEN=1" actually works.
* src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-09 19:24:15 +02:00
P@draigBrady.com
86e4b778b1 Fix the automatic number width formatting in seq.
* src/seq.c: Fix the -w logic. Ignore spaces and '+'
characters of input numbers when determining width.
Set format correctly for input numbers in scientific notation.
* tests/seq/basic: Add various number width tests.
Details: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10903>

Signed-off-by: Pádraig Brady <Pádraig Brady P@draigBrady.com>
2007-07-09 17:55:57 +02:00
Jim Meyering
55c53863a8 Run the coreutils-specific code only if tests/Makefile.am.in exists.
* bootstrap (mam_template): Move definition out of loop.
2007-07-08 20:09:59 +02:00
Jim Meyering
432a7c21f0 Remove .gdb-history. 2007-07-08 19:12:48 +02:00
Jim Meyering
43d86d8c95 Add to .cvsignore and .gitignore files. 2007-07-08 17:25:05 +02:00
Jim Meyering
7b5c057f5f Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
* bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
Add a directory parameter.  Update all callers.
(cp_mark_as_generated): Also check for -- and link to -- files in gl/.
2007-07-08 17:24:29 +02:00
Jim Meyering
17cc46a11a THANKS: Add Pádraig Brady.
2007-07-08  Jim Meyering  <jim@meyering.net>
2007-07-08 16:42:50 +02:00
Jim Meyering
e7368caf47 Adapt to deeper hierarchy in gnulib.
* bootstrap (gnulib_tool): If the destination directory doesn't exist,
create it. This is required at least for "lib/uniwidth/cjk.h".
2007-07-08 12:42:05 +02:00
Jim Meyering
1cea914143 Use <wchar.h>, not "wcwidth.h".
* src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>,
include it and <wctype.h>, rather than "wcwidth.h".
* src/ls.c: Include <wchar.h>, rather than "wcwidth.h".
2007-07-08 12:39:24 +02:00
Jim Meyering
685d3c3f2a Fix typo in comment. 2007-07-07 01:49:12 +02:00
Jim Meyering
e0066f36c2 setuidgid: set all groups, not just the primary one; mgetgroups: new module
I wanted to use the xgetgroups function from id.c, so factored it out
and made it into a non-exiting function (hence the "m" prefix rather than "x").
* src/setuidgid.c (main): Use mgetgroups. Include "mgetgroups.h".

* src/id.c (xgetgroups): Remove function.
Include "mgetgroups.h".
(print_group_list): Use mgetgroups, not xgetgroups.

* gl/modules/mgetgroups: New module.
* gl/lib/mgetgroups.c: New file.  mgetgroups is derived from
id.c's xgetgroups function.
* bootstrap.conf (gnulib_modules): Add mgetgroups.
* gl/m4/mgetgroups.m4: New file.
* gl/lib/mgetgroups.h: New file.
2007-07-06 07:44:39 +02:00
Jim Meyering
b8031ff7c7 * bootstrap: Merge in changes from gnulib. 2007-07-05 17:44:31 +02:00
Jim Meyering
25e9ed1354 * src/id.c: Include "getugroups.h" rather than declaring manually. 2007-07-05 14:44:20 +02:00
Jim Meyering
4b9ab62580 Add Paul's ChangeLog for previous patch.
Restore the m4/.gitignore file I inadvertently removed.
2007-07-04 13:16:53 +02:00
Paul Eggert
36ce675bb4 pr -F no longer suppresses the footer or the first two blank header lines
Here's a patch along the lines of
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10849/focus=10857>.
It's a bit large since it changes the test cases to match the behavior,
and the test cases' file names depend on the behavior!

* NEWS: pr -F no longer suppresses the footer or the first two blank
lines in the header.
* doc/coreutils.texi (pr invocation): Likewise.  Also, a too-short
page length implies -t, not -T.
* src/pr.c (lines_per_header, lines_per_footer): Now constants.
(init_parameters): Don't try to change them.
(print_header): Use the same header and footer format regardless of
wither form feeds are being used.
(usage): Adjust to above change when describing too-short page length.
Too-short page length impliesy -t, not -T.
* tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects
only formfeed handling; it does not change the header.
* tests/pr/2-Sf-t_notab: Likewise.
...
* tests/pr/3-5l17f-t: Remove, since it's been renamed to another
file whose name has a line count 7 larger,
reflecting the new line count needed for this behavior.
* tests/pr/3a3l8f-t: Likewise.
...
* tests/pr/w72l24f-ll: Likewise.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-04 12:45:10 +02:00
Jim Meyering
519d7a95a3 Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
* src/base64.c (main): Likewise.
* src/install.c (setdefaultfilecon): Likewise.
* src/sort.c (main): Likewise.
* Makefile.maint (sc_prohibit_strcmp): New rule.
* .x-sc_prohibit_strcmp: New file, to list the few exceptions.
* Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
2007-06-23 10:11:25 +02:00
Paul Eggert
a0304574e9 seq no longer mishandles cases like "seq 0 0.000001 0.000003",
where it would not print the desired last number.
* doc/coreutils.texi (seq invocation): Remove advice about workaround
for seq off-by-one problem, since the bug is fixed now.  Replace
it with more-generic advice about rounding errors.
* src/seq.c (long_double_format, print_numbers):
New arg NUMERIC_FORMAT.  All uses changed.
2007-06-23 09:43:59 +02:00
Pádraig Brady
01616c9404 Add test cases for seq off-by-one problem. 2007-06-22 20:40:49 +02:00
Jim Meyering
2b25436813 * src/stat.c (long_options): Add a FIXME comment to help ensure
that the deprecated and undocumented "--filesystem" option is
removed someday.
2007-06-22 20:26:01 +02:00
Paul Eggert
811901cb41 A few more symlink-related fixes. Fix a bug triggered by cp
--parents and symlinks.  Close some race conditions possible when
the destination replaces a newly-created file with a symlink.
* NEWS: Document that 'cp --parents' no longer mishandles
symlinks in file name components of source.
* src/copy.c (HAVE_LCHOWN): Default to false.
(lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
* src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
* src/copy.c (set_owner): Use lchown instead of chown, for safety
in case the file got replaced by a symlink in the meantime.
* src/cp.c (re_protect): Likewise.
* src/install.c (change_attributes): Likewise.
* src/copy.c (copy_internal): Use ordinary C rather than an #if.
* src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
(struct dir_attr): Cache the entire struct stat of the directory,
rather than just its mode, so that we needn't stat the directory
twice (which can lead to races).
(re_protect): Don't use XSTAT as that's not appropriate in
this context (symlinks should be followed here).  Instead, use
the cached stat value.
(make_dir_parents_private): Save dir's entire struct stat, not
just its mode.
* tests/cp/cp-parents: Add test to check against bug with
cp --parents and symlinks.
2007-06-18 15:20:44 +02:00
Jim Meyering
0adc02a086 Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
* bootstrap.conf (gnulib_modules): Add readlink-with-size.
Remove xreadlink and xreadlink-with-size.
* src/copy.c (copy_internal): Use mreadlink_with_size,
not xreadlink_with_size.
* src/ls.c (get_link_name): Likewise.
* src/readlink.c (main): Likewise.
* src/stat.c (print_stat): Likewise.
2007-06-18 15:19:34 +02:00
Jim Meyering
063aa30a3d * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out. 2007-06-18 11:19:57 +02:00
Jim Meyering
c23c89db0f Make chgrp and chown diagnostics consistent.
* src/chown.c (main): Emit the diagnostic before the file name,
not after it, to be consistent with chgrp's diagnostic.
* src/chgrp.c (parse_group): Emit a ":" between the diagnostic
and the file name.
Reported by Egmont Koblinger.
* THANKS: Add Egmont Koblinger.
2007-06-16 12:53:40 +02:00
Paul Eggert
cdec7e6e93 Correct cp's handling of destination symlinks in some cases.
* NEWS: "cp" no longer considers a destination symlink to be the
same as the referenced file when copying links or making backups.
* src/copy.c (copy_reg): When following a symlink, use the
followed name in later chown etc. requests, so that the created
file is affected, rather than the symlink.  Use O_NOFOLLOW on
source when not dereferencing symlinks; this avoids a race.
Preserve errno correctly when doing multiple open attempts on the
destination.
(copy_internal): Follow destination symlinks only when copying a
regular file and only when we don't intend to remove or rename the
destination first, regardless of whether following source
symlinks; this is because since POSIX and tradition (e.g.,
FreeBSD) say we should ordinarily follow destination symlinks if
the system calls would ordinarily do so.
* src/copy.h (struct cp_options): Add comment that 'dereference'
is only for source files.
* src/cp.c (usage): Note that --derereference etc. are only for
source files.
(make_dir_parents_private): Follow symlinks, regardless of whether
--dereference is specified, because these are destination symlinks.
* tests/cp/same-file: Adjust tests to match revised behavior.
Filter out perror output since it might vary from host to host.
Use sed alone instead of also using echo.

* doc/coreutils.texi (cp invocation): Document the behavior better when
the destination is a symlink.  Clarify source versus destination
symlinks.  Describe the new behavior for destination symlinks.

2007-06-15  Jim Meyering  <jim@meyering.net>

* src/copy.c: Include "canonicalize.h".
(copy_reg): Use canonicalize_filename_mode to follow the symlink,
so that we can always open with O_EXCL and avoid a race.
2007-06-15 22:47:16 +02:00
Jim Meyering
cad884a245 Don't include "quote.h" when it is not used.
* src/md5sum.c: Remove unnecessary inclusion of "quote.h".
* src/expr.c: Likewise.
* src/shred.c: Likewise.
* Makefile.maint (sc_prohibit_quote_without_use): New rule.
* src/c99-to-c89.diff: Adjust offsets.
2007-06-15 15:49:00 +02:00
Paul Eggert
6a0dea3ca0 Clarify what "cat" documentation means by "blank" lines.
* doc/coreutils.texi (cat invocation): "Blank" lines actually mean
empty lines.
* src/cat.c (usage): Say that "nonblank" means nonempty.  Clarify
--squeeze-blank.
2007-06-15 09:29:18 +02:00
Jim Meyering
85c3924ce5 rmdir: give better diagnostics
* src/rmdir.c (remove_parents): Give a more descriptive/consistent
diagnostic upon failure.
(main): Likewise.
Suggestion from Joey Hess.
* THANKS: Add Joey Hess.
2007-06-13 15:53:12 +02:00
Jim Meyering
a780166b41 Don't include "quotearg.h" when it is not used.
* Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
* src/cp.c: Don't include "quotearg.h".  It wasn't used.
2007-06-13 15:33:38 +02:00
Jim Meyering
ae60d5bc4d * README-hacking: List Gperf as a build-requirement, too.
Reported by Steve Ward.
2007-06-13 08:00:41 +02:00
Jim Meyering
e1afd98589 README: Also mention README-hacking,
for whose who start from
cloned/checked-out sources rather than from a distribution tarball.
Reported by Steve Ward.
* THANKS: Add Steve Ward.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-06-11 11:10:23 +02:00
Jim Meyering
016af51031 Add to .cvsignore and .gitignore files. 2007-06-10 18:39:53 +02:00
Jim Meyering
b1b0f5c556 bug-fix: cp would fail to write through a dangling symlink
* NEWS: Mention the bug fix.
* src/copy.c (copy_reg): When open fails with EEXIST, the destination
is lstat'able, and a symlink, call open again, but now without O_EXCL.
* tests/cp/thru-dangling: New file, to test for the above fix.
* tests/cp/Makefile.am (TESTS): Add thru-dangling.
* THANKS: Add Michael McLagan.
Bug report from Michael McLagan in <http://bugzilla.redhat.com/243588>.
2007-06-10 15:01:18 +02:00
Jim Meyering
6c95b3f2bf * coreutils.texi (rmdir invocation): Fix a tiny typo. 2007-06-06 08:00:44 +02:00
Paul Eggert
e9c3d73c14 doc: -h and --human-readable are equivalent to --block-size=human-readable
* doc/coreutils.texi (Common options): Mention that -h and
--human-readable are equivalent to --block-size=human-readable.
Documentation problem reported by Steve Ward in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
(du invocation): Use optSi rather than duplicating the macro's
contents (incorrectly, since we claimed a "B" was output).
2007-06-04 19:32:07 +02:00
Jim Meyering
d43b54fa51 Remove constants.texi from version control.
This file has always been generated.
* .gitignore: Add constants.texi.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-06-03 21:56:24 +02:00
Jim Meyering
6d8bb4df3d Add to .cvsignore and .gitignore files. 2007-06-02 23:00:09 +02:00
Jim Meyering
536ac0ff6e Pull printf-related code from gnulib, rather than using forked copy.
* bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
modules.  While I dislike xsize-style overflow avoidance, maintaining
a forked version of e.g., vasnprintf.c was too much work.
* lib/printf-parse.c, lib/vasnprintf.c, lib/unicodeio.c: Remove local
copies, so we now get these files from gnulib.
2007-05-31 16:40:51 +02:00
Jim Meyering
1211a2cc2c * src/dircolors.hin: Add screen-256color.
Suggested by sdl.web@gmail.com in <http://bugzilla.redhat.com/239266>.
2007-05-31 08:05:02 +02:00
Jim Meyering
ca7c786f62 * TODO: Add an entry for comm --output-delimiter=STR 2007-05-31 08:03:40 +02:00
James Youngman
e82c7ddd47 wc: ignore multibyte-character decoding errors
* src/wc.c (wc): Don't issue an error message when mbrtowc
indicates that we have seen an invalid byte sequence.  This
makes "wc /bin/sh" bearable (though the word and line counts
are likely not to be useful).
* NEWS: Mention the change.
2007-05-26 07:13:50 +02:00
Jim Meyering
8ab7f351a1 Add to .cvsignore and .gitignore files. 2007-05-26 06:30:30 +02:00
Jim Meyering
9e450601b1 Check for an up-to-date copyright year in coreutils.texi.
* Makefile.maint (copyright-check): Also check for an up-to-date
copyright year in doc/$().texi, if that file exists.
* doc/coreutils.texi: Add 2007 to list of Copyright years.
Reported by Karl Berry.
2007-05-22 20:41:00 +02:00
Jim Meyering
a6a447fc58 cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
give a better diagnostic for a field-number/offset of 0.
* NEWS: Mention the fix.
* src/cut.c (ADD_RANGE_PAIR): Add an explicit check for 0.
Based on a patch from James Youngman.
* tests/misc/cut: Add tests for the above.
2007-05-22 18:47:17 +02:00
Jim Meyering
ae5717158f "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
Also, diagnose the '-' in "cut -f -" as an invalid range, rather
than interpreting it as the unlimited range, "1-".
* NEWS: Mention these changes.
* src/cut.c (set_fields): Don't interpret an accumulator "value"
of 0 as an unspecified range endpoint.
Give better diagnostics.
Adjust a comment so that it is true also for 64-bit size_t.
* tests/cut/Test.pm: Add tests for the above.
2007-05-22 13:56:34 +02:00
Jim Meyering
607614ae96 stty: fix a harmless syntax nit
* src/stty.c (visible): Use ";" as the statement terminator
between two assignments, not ",".
(integer_arg): Join an unnecessarily wrapped line.
2007-05-22 07:58:42 +02:00
Jim Meyering
02599650b1 stty: diagnose an invalid hex value in 35-colon commmand-line argument
* NEWS: Mention this.
* src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
(recover_mode): Use those functions (not sscanf), to parse the
string robustly.
* tests/stty/invalid: New file.  Test for the above.
* tests/stty/Makefile.am (TESTS): Add invalid.
* .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
Add tests/stty/invalid so we don't have to obfuscate the comment
about sscanf therein.
* Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
diagnostic, too.
2007-05-22 07:55:40 +02:00
Jim Meyering
a49f45acbe * TODO: Remove some now-completed or no longer relevant items. 2007-05-20 14:04:28 +02:00
Jim Meyering
5ab25eb05b Rename uses of futimens -> gl_futimens; glibc now declares the former.
* src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
* src/touch.c (touch): Likewise.
2007-05-19 18:36:03 +02:00
Jim Meyering
ab4f4bdc18 * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
for now, to avoid c89-check failure due to use of #include_next.
2007-05-18 09:01:03 +02:00
Jim Meyering
b3414967d5 Generate a dozen test-related Makefile.am files at bootstrap-time.
* README-hacking: Build-from-checkout now require Perl, too.
* bootstrap: Now that these generated Makefile.am files are no longer
under version control, they must be created at bootstrap time.
2007-05-15 10:18:48 +02:00
Paul Eggert
f4a5097ea3 * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
Remove misleading implication about leading zero.  Problem
reported by Jan Engelhardt in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
2007-05-15 07:14:55 +02:00
Jim Meyering
893ac688cc Remove the generated tests/*/Makefile.am files from version control.
* tests/cut/Makefile.am: git-remove this generated file.
* tests/head/Makefile.am: Likewise.
* tests/join/Makefile.am: Likewise.
* tests/pr/Makefile.am: Likewise.
* tests/sort/Makefile.am: Likewise.
* tests/tac/Makefile.am: Likewise.
* tests/tail/Makefile.am: Likewise.
* tests/test/Makefile.am: Likewise.
* tests/tr/Makefile.am: Likewise.
* tests/uniq/Makefile.am: Likewise.
* tests/wc/Makefile.am: Likewise.
* .cvsignore, .gitignore: Ignore these generated files.

* src/.cvsignore, src/.gitignore: Add chcon here, ...
* .cvsignore, .gitignore: ... not here.
2007-05-13 18:23:41 +02:00
Jim Meyering
16385191ce Test uniq's new --zero-terminated (-z) option.
* tests/uniq/Test.pm: When possible, create a "-z"-testing variant
of each existing test.
(2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2007-05-13 11:29:54 +02:00
James Youngman
e06252480a Add -z option to uniq. Originally proposed by Egmont Koblinger.
* NEWS: Mention uniq's new option: --zero-terminated (-z).
* src/uniq.c: Add new option, --zero-terminated (-z), to make
uniq use the NUL byte as separator/delimiter rather than newline.
(check_file): Add a parameter: delimiter.  Update caller.
Use readlinebuffer_delim in place of readlinebuffer everywhere.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (uniq invocation): Describe the new option.
2007-05-13 11:02:43 +02:00
Jim Meyering
cdd66362dc * NEWS: Mention that last week's tr bug dates back to 1992. 2007-05-07 21:56:27 +02:00
Jim Meyering
283dadf095 Avoid test failure when run with an unusual umask.
* tests/ls/color-dtype-dir: Set umask to 022.
Suggestion from AIDA Shinra.
2007-05-04 13:32:46 +02:00
Jim Meyering
3affac54ed Avoid failure of root-only test when run with a restrictive umask.
* tests/rm/no-give-up: Ensure that non-root can access "d/" through
root-owned ".".  Reported by AIDA Shinra.
2007-05-04 12:01:43 +02:00
Jim Meyering
ab402c29f9 tr -c: don't abort when translating with S2 larger than complement of S1
* src/tr.c (main): Remove invalid assertion triggered by e.g.,
tr -c a '[b*256]'.  There's nothing wrong with having Set2 larger
than Set1.  Reported by Guntram Blohm.
* tests/tr/Test.pm (no-abort-1): Test for the above.
* NEWS: Mention this bug fix.
* THANKS: Add Guntram Blohm.
2007-05-04 10:03:01 +02:00
Jim Meyering
bf8cfacd24 Avoid test failure when run with a permissive umask.
* tests/rm/no-give-up: Set permissions of test directory properly,
i.e., not depending on umask prohibiting go=w.
Reported by AIDA Shinra.
2007-05-03 19:36:34 +02:00
Paul Eggert
2539b53760 The following commands and options now support the standard size
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
head -c, head -n, od -j, od -N, od -S, split -b, split -C,
tail -c, tail -n.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Document support for new size suffixes.
(head invocation, tail invocation):
Document that -n uses the same suffixes as -c.
(tail invocation): More-clearly document what leading "+" does.
* src/head.c (usage, string_to_integer): Support new suffixes.
* src/od.c (usage, main): Likewise.
* src/split.c (usage, main): Likewise.
* src/tail.c (usage, parse_options): Likewise.
Prompted by a patch from Evan Hunt.
2007-05-03 13:45:26 +02:00
Jim Meyering
4e89cf8fb8 * src/du.c (usage): Tweak description of --dereference-args (-D) again.
Prompted by another request for clarification from Justin Pryzby.
2007-05-02 23:37:55 +02:00
Jim Meyering
aa3f52d17b Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
* tests/rm/fail-2eperm: Patch from AIDA Shinra.
Reported by Peter Dyballa.
* THANKS: Add AIDA Shinra and Peter Dyballa.
2007-05-02 23:34:33 +02:00
Paul Eggert
60f3c362f5 * src/nohup.c (usage): Describe how standard input and output are redirected. 2007-04-28 20:48:36 +02:00
Jim Meyering
cebbc9ee6d Add "runcon" to .cvsignore and .gitignore files. 2007-04-25 15:52:53 +02:00
Jim Meyering
0de4ae4b25 * src/du.c (usage): Clarify description of --dereference-args (-D).
Prompted by a report from Justin Pryzby.
2007-04-25 13:54:21 +02:00
Jim Meyering
0e8bf7bffe * bootstrap.conf (gnulib_modules): Add autobuild.
* m4/autobuild.m4: Remove file.  Now, provided by gnulib.
2007-04-25 11:33:44 +02:00
Jim Meyering
3d19a12976 * bootstrap.conf (gnulib_modules): Add fseeko and ftello. 2007-04-25 10:55:56 +02:00
Jim Meyering
5c82d3f1ce Add to .cvsignore and .gitignore files. 2007-04-25 10:55:35 +02:00
Jim Meyering
0361f46554 * bootstrap.conf (gnulib_modules): Add fseeko. 2007-04-25 10:40:12 +02:00
Jim Meyering
9213769933 Add to .cvsignore and .gitignore files. 2007-04-25 10:39:48 +02:00
Jim Meyering
383713e030 * THANKS: Add Andreas Frische.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2007-04-24 09:20:52 +02:00
Eric Blake
1d85945321 ls --color once again colors dangling symlinks correctly
* src/ls.c (gobble_file): Much like the 2007-04-07 fix,
add a term to the expression that decides whether we need
stat and/or lstat calls.  Reported by Andreas Frische.
2007-04-24 09:18:56 +02:00
Jim Meyering
25b8a7a987 cut synopsis: fix coreutils.texi, too.
* doc/coreutils.texi (cut invocation): Adjust synopsis to show that an
* THANKS: Add Rudolf Kastl.
OPTION is required.  Reported by Rudolf Kastl.
2007-04-16 22:01:46 +02:00
Jim Meyering
14816cf338 * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
Reported by Rudolf Kastl.
2007-04-16 16:26:13 +02:00
Jim Meyering
74932c721b Add to .cvsignore and .gitignore files. 2007-04-12 14:48:50 +02:00
Paul Eggert
395fcee97a split --line-bytes=N (-C N): don't create an empty file.
* src/split.c (line_bytes_split): Don't create an empty line
afterwards if the last buffer happens to be exactly full.
* tests/misc/split-fail: Add a test case for this.
* NEWS: mention this.
2007-04-12 00:21:25 +02:00
Jim Meyering
f839bfad73 ls: don't form or compute the length of strings that won't be used.
* src/ls.c (gobble_file): Form and compute length of strings for
block size, owner, group, author, major+minor numbers and file size
only if they'll actually be used.  I.e., don't form most of them
when not producing long format output.
2007-04-10 00:21:07 +02:00
Jim Meyering
4d484fe09f Add a test for, and document, today's fix.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-target): Add a test for today's fix.
* THANKS: Add Kirk Kelsey.
2007-04-07 20:51:13 +02:00
Eric Blake
d63623eb7c Fix a bug in how the LS_COLORS ln=target attribute is handled.
* src/ls.c (gobble_file): Use "stat" (not lstat) also when the
ln=target attribute applies.  Reported by Kirk Kelsey.
2007-04-07 20:14:07 +02:00
Jim Meyering
abdf924333 * src/copy.c (copy_reg): Initialize local "con", before calling
getfscreatecon, in case that function (or its inline stub) does
not set it.
2007-04-02 22:06:22 +02:00
Paul Eggert
a3b65a63a0 * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
ls -x DIR would sometimes output the wrong string in place of the
first entry.
* NEWS: Mention the bug fix.
* tests/ls/x-option: New file.
* tests/ls/Makefile.am (TESTS): Add x-option.
2007-04-02 18:29:41 +02:00
Paul Eggert
0b39324840 gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
* bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
md5 to crypt/md5 and sha1 to crypt/sha1.
2007-04-02 14:48:35 +02:00
Jim Meyering
a301ea6697 * NEWS: Mention these SELinux changes. 2007-03-30 16:02:54 +02:00
Jim Meyering
e4e19d87a0 * ChangeLog-selinux: Remove file.
Move its contents into this file, removing old dates.
2007-03-30 11:16:00 +02:00
Jim Meyering
848bd19d21 * src/runcon.c (main): Don't reorder arguments. Reported by
Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
* tests/misc/runcon-no-reorder: New file.  Test for the above.
* tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
2007-03-29 21:37:06 +02:00
Jim Meyering
aefac2c02e * src/runcon.c (main): Remove "." at end of a diagnostic. 2007-03-29 21:37:06 +02:00
Jim Meyering
add8b36148 Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
(all_t): Add t9.

Use a directory on a loopback device mounted with -o context=...
* tests/cp/cp-a-selinux: Since this test now runs mount and umount,
it is a root-only one.
2007-03-29 21:37:06 +02:00
Jim Meyering
c6922b6f7e * src/runcon.c: New program.
* src/Makefile.am (bin_PROGRAMS): Add runcon.
(runcon_LDADD): Define.
* README: Add runcon to the list of programs.
* AUTHORS: Add this: runcon: Russell Coker
* tests/help-version: Add runcon as an exception.
* man/Makefile.am (dist_man_MANS): Add runcon.1.
(runcon.1): New dependency.
* po/POTFILES.in: Add src/runcon.c.
2007-03-29 21:37:06 +02:00
Jim Meyering
c2bbd117f5 Regenerate .cvsignore and .gitignore files. 2007-03-29 21:37:06 +02:00
Jim Meyering
447b254923 mkfifo, mknod: Accept new "-Z, --context=C" option.
* src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
301fbaf431 mkdir: Accept new "-Z, --context=C" option.
* src/mkdir.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
8a86223d45 * tests/cp/cp-a-selinux: New file. Test for the bug reported in
* tests/cp/Makefile.am (TESTS): Add cp-a-selinux.

* tests/selinux: New file.
* tests/Makefile.am (EXTRA_DIST): Add selinux.
* tests/misc/selinux: Source the new script, rather than open coding it.

Change how "cp -a" and "cp --preserve=context" work with SELinux.
Now, cp -a attempts to preserve context, but failure to do so does
not change cp's exit status.  However "cp --preserve=context" is
similar, but failure *does* cause cp to exit with nonzero status.
* src/copy.h (struct cp_options) [require_preserve_context]: New member.
* src/copy.c (copy_reg, copy_internal): Implement the above.
* src/mv.c (cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(decode_preserve_arg): Set it or reset it.

FIXME: add an on-writable-NFS-only test
2007-03-29 21:37:06 +02:00
Jim Meyering
adcfd944a8 * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define. 2007-03-29 21:37:06 +02:00
Jim Meyering
85ddc626be cp, mv, install: add SELinux support, but unlike with the Red Hat
patch, mv and cp do not provide the "-Z context" option.
* src/copy.c: Include <selinux/selinux.h>.
(restore_default_fscreatecon): New function.
(copy_reg): Make cp --preserve=context work for existing destination.
(copy_internal): Likewise for new destinations.
* src/copy.h (cp_options) [preserve_security_context]: New member.
* src/cp.c: Include <selinux/selinux.h>.
(selinux_enabled): New global.
(usage): Mention new --preserve=context option.
(PRESERVE_CONTEXT): Define/use.
(decode_preserve_arg): Handle PRESERVE_CONTEXT.
(main): Remove an obsolete comment.
If --preserve=context is specified on a system without SELinux
enabled, give a diagnostic and fail.
* src/mv.c: Include <selinux/selinux.h>.
Set x->preserve_security_context if SELinux is enabled.
* src/install.c: Accept new "-Z, --context=C" option.
Accept --preserve-context option (but not -P option).
Accept alternate spelling: --preserve_context, for now.
Include <selinux/selinux.h> and "quotearg.h".
(selinux_enabled, use_default_selinux_context): New globals.
(PRESERVE_CONTEXT_OPTION): Define.
(cp_option_init): Default: do not preserve security context.
(setdefaultfilecon): New function.
(main): Honor new options.
* src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
Add $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
5a7fe9c0f8 * tests/misc/selinux [VERBOSE]: Print version info for each
of the tested tools, not just ls.
2007-03-29 21:37:06 +02:00
Jim Meyering
3459fe4506 * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
temporarily removed the offending c99'ism.
2007-03-29 21:37:06 +02:00
Jim Meyering
380c858b71 * src/chcon.c (usage): Split a string literal that was longer than 509. 2007-03-29 21:37:05 +02:00
Jim Meyering
1411a53dc1 * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
2007-03-29 21:37:05 +02:00
Jim Meyering
e80cace874 * src/c99-to-c89.diff: Adjust offsets. 2007-03-29 21:37:05 +02:00
Jim Meyering
23c34b8bd9 * AUTHORS: Add chcon. 2007-03-29 21:37:05 +02:00
Jim Meyering
e4779654bd * src/c99-to-c89.diff: Remove trailing blanks. 2007-03-29 21:37:05 +02:00
Jim Meyering
da538a3975 * src/chcon.c: Don't include "dirname.h". system.h already includes it. 2007-03-29 21:37:05 +02:00
Jim Meyering
5349e96a32 * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H. 2007-03-29 21:37:05 +02:00
Jim Meyering
5a233cb81e * src/c99-to-c89.diff: Handle a new c99'ism in ls.c. 2007-03-29 21:37:05 +02:00
Jim Meyering
5dd7f137b7 * src/id.c (main): Tweak id -Z diagnostic. 2007-03-29 21:37:05 +02:00
Jim Meyering
1532bea5b5 * POTFILES.in: Add src/chcon.c. 2007-03-29 21:37:05 +02:00
Jim Meyering
5320d0fef1 id: Add SELinux support: -Z option.
* src/id.c (main): Apply patches from Fedora, with these changes:
Remove #ifdef WITH_SELINUX.
Use error (EXIT_FAILURE, not fprintf+exit(1).
* src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
2007-03-29 21:37:05 +02:00
Jim Meyering
bc5faec34a Keep SELinux-related ChangLog entries here. 2007-03-29 21:37:05 +02:00
Jim Meyering
4010e2d077 stat: Add support for SELinux in the form of a %C format directive.
* src/stat.c (follow_links): Make this variable file-global.
(out_file_context): New function.
(print_statfs): Honor %C.
(print_stat): Honor %C.
(do_stat): Remove follow_links parameter.
(usage): Document the two %C directives.
(main): Accept -Z (though it's a no-op).
* src/Makefile.am (stat_LDADD): Define.
2007-03-29 21:37:05 +02:00
Jim Meyering
8c94771b88 add chcon 2007-03-29 21:37:05 +02:00
Jim Meyering
3ea540c757 ls: Add support for SELinux and a slightly modified -Z option.
I started with the patches from Red Hat.
The entries below tell how the code evolved.

* src/ls.c (print_long_format, print_file_name_and_frills): When
there is no security context (due to getfilecon/lgetfilecon failing
with e.g. ENOTSUP), print it as "?", not "".
* src/ls.c (print_file_name_and_frills): Make -Z work without -l.
(length_of_file_name_and_frills): Likewise.

* src/ls.c: Remove the --lcontext and --scontext options.
Change the way -Z, --context work so that it no longer implies -l.
Thus, -Z -l will work like -lcontext and -Z without -l will work
like --scontext.

Adjust tests to reflect new 'ls -l' syntax -- affects only
systems with SELinux when operating on a file with no ACL.
These tests assumed that everything before the first space on
each line is the 10-byte mode string.  But there may also be a "+"
in the 11th column, just before the space.  However, note that this
is not new.  The same thing would have happened even without the
change below, when listing a file with an ACL.
* tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
* tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
* tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:

Don't make compilation depend on USE_ACL.  An SELinux security
context counts as an "alternate access control method", so ls
must output a "+" for each file with a security context.
* src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
(FILE_HAS_ACL): Remove macro definition.  Use f->have_acl directly.
(gobble_file): Record whether a file has a security context, and
update the condition used to determine whether to print the "+".
(gobble_file): Call getfilecon/lgetfilecon also when
format == long_format, so that we get the "+".

* src/ls.c (gobble_file): Add a comment explaining why (with a
security context option) ls doesn't exit nonzero due to e.g.,
getfilecon failing with errno == ENOTSUP.

* src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
to ENOTSUP.

* src/ls.c (gobble_file): Factor out three small blocks using
getfilecon and lgetfilecon.
Don't ignore return value from getfilecon and lgetfilecon.

* src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
ternary operator).
(print_scontext_format): Likewise.
(print_scontext): Declare to be "bool", not int.  Adjust uses.

* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).

* tests/misc/chcon: New file.
* tests/misc/chcon-fail: New file.
* tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
* tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.

* tests/misc/Makefile.am (TESTS): Add selinux.
* tests/misc/selinux: New file.
* tests/help-version: Skip chcon.
2007-03-29 21:37:05 +02:00
Jim Meyering
85d6c618b0 * man/chcon.x: New file.
* man/Makefile.am: Build chcon.1.
2007-03-29 21:37:05 +02:00
Jim Meyering
7e591c1009 .cvsignore, .gitignore: update 2007-03-29 21:37:05 +02:00
Jim Meyering
87516b80a5 New program: chcon
* gl/modules/selinux-at: New module.  Check for libselinux and set
LIB_SELINUX here, unconditionally, rather than depending on
the configure-time --enable-selinux option.
* gl/modules/selinux-h: New module.
* bootstrap.conf (gnulib_modules): Add selinux-at.
* gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
* gl/lib/se-selinux_.h: New file.
* gl/lib/se-context_.h: New file.
* gl/m4/selinux-selinux-h.m4: New file.
* gl/m4/selinux-context-h.m4: New file.
* src/Makefile.am (bin_PROGRAMS): Add chcon.
(chcon_LDADD): Define.
* README: Add chcon to the list of programs.
* src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
2007-03-29 21:37:05 +02:00
Jim Meyering
56fc172d11 Merge branch 'master' of /cu 2007-03-29 21:36:38 +02:00
Jim Meyering
8487f9c6bd * .vg-suppressions: Add libc-getpwuid-leak. 2007-03-29 21:35:20 +02:00
Jim Meyering
0f63eebd1e Merge branch 'master' of /cu 2007-03-28 23:39:18 +02:00
Jim Meyering
a0faff1a58 Help translators include translation team's web or email address.
* src/system.h (emit_bug_reporting_address): New function.
* src/base64.c: Use it rather than a literal printf.
* src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
* src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
* src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
* src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
* src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
* src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
* src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
* src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
* src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
* src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
* src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
* src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
* src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
* src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
* src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
* src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
* src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
* src/who.c, src/whoami.c, src/yes.c: Likewise.
2007-03-28 08:50:29 +02:00
Jim Meyering
59312fa3f9 Add to .cvsignore and .gitignore files. 2007-03-28 08:46:01 +02:00
Jim Meyering
2fa23f1f86 * src/stty.c: Don't include "vasprintf.h", now that its
declarations are guaranteed to be in gnulib's stdio.h.
* src/who.c: Likewise.
2007-03-28 08:34:03 +02:00
Jim Meyering
311b6df344 * README: Use "install", not "ginstall" in the list of program names.
* src/Makefile.am (check-README): Substitute s/ginstall/install/.
2007-03-27 16:08:29 +02:00
Jim Meyering
2e6e036896 Add to .cvsignore and .gitignore files. 2007-03-25 10:58:56 +02:00
Jim Meyering
b60a32376e * src/c99-to-c89.diff: Regenerate. 2007-03-25 10:20:43 +02:00
Paul Eggert
1efda4faf3 Avoid the need for euidaccess and/or lstat on every directory entry
with 'rm -r dir' (without -f), if we are root, or if we are removing
a directory tree that is full of symbolic links.
* bootstrap.conf (gnulib_modules): Add write-any-file.
* src/copy.c: Include write-any-file.h.
(UNWRITABLE): Remove macro, replacing with....
(writable_destination): New function, which uses can_write_any_file
to avoid the need for euidaccess when we are privileged.
(overwrite_prompt, abandon_move): Use it.
* src/remove.c: Include write-any-file.h.
(D_TYPE): New macro.
(DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
(write_protected_non_symlink): Don't bother to stat if we can write
any file.
(prompt): New arg PDIRENT_TYPE.  All callers changed.
Use readdir dirent type to avoid the need for 'lstat' on each directory
entry in cases like 'rm -r dir', if we are root, or if the tree is
full of symbolic links.
(DT_IS_KNOWN, DT_MUST_BE): Remove.
(remove_entry): New arg DIRENT_TYPE_ARG.  All callers changed.
2007-03-25 09:52:57 +02:00
Jim Meyering
de73024977 If strace malfunctions, skip the test rather than failing it.
* tests/mv/atomic: Required on a mips-unknown-linux-gnu system
running the aging linux-2.4.27-mipscvs-20040814.
2007-03-24 11:25:15 +01:00
Jim Meyering
beeade1473 * src/pathchk.c: Don't include euidaccess.h, as we don't call
euidaccess.
2007-03-23 21:40:11 +01:00
Jim Meyering
c634bb97af * README-package-renamed-to-coreutils: Add a URL for the FAQ,
and a couple more archive links.
2007-03-23 11:08:59 +01:00
Jim Meyering
c3abd70c67 Post-release version change.
* NEWS: Add a line for 6.9+.
* configure.ac (AC_INIT): Set new version string.
2007-03-23 08:22:35 +01:00
Jim Meyering
85fb8411dd .prev-version: Record previous version: 6.9. 2007-03-22 22:37:06 +01:00
Jim Meyering
804bdc3001 Version 6.9.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
2007-03-22 22:20:02 +01:00
Jim Meyering
25cdc8248d * tests/mv/hard-3: Correct the preceding change: $3 -> $2. 2007-03-22 22:11:03 +01:00
Eric Blake
826ff082db * coreutils.texi (md5sum invocation): Document escapes in output
format.  Reported by Armijn Hemel.
2007-03-22 21:46:54 +01:00
Paul Eggert
59e889f0f3 Improve a test script.
* tests/mv/hard-3: Check for 'ls' failure, too.
Generate more-useful debugging output when 'ls' fails.
2007-03-22 21:29:30 +01:00
Jim Meyering
3440b65ecf Fix a test script not to claim an ext2 file system is of type xfs.
* tests/du/slink: When using df --local and df --type=TYPE,
test only the exit code.  Don't bother with stdout.
Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
2007-03-21 17:19:30 +01:00
Jim Meyering
a59975a3fd Add to .cvsignore and .gitignore files. 2007-03-21 15:41:58 +01:00
Jim Meyering
373c95c45a * gl/lib/savewd.c: Remove this file, since the savewd_save change
is now in gnulib.  The other wasn't useful.
2007-03-21 09:09:34 +01:00
Jim Meyering
c63f4506cc Skip part of this test when "." is not a local file system.
* tests/mkdir/p-3: Likewise.
2007-03-20 16:47:36 +01:00
Jim Meyering
85de525557 * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it. 2007-03-20 15:51:21 +01:00
Jim Meyering
13e4c87ff6 Fix a typo in the handling of %x and %X.
* vasnprintf.c (VASNPRINTF): When adding 2 to buffer length,
don't double it.
2007-03-20 15:21:08 +01:00
Jim Meyering
de540a76eb Skip part of this test when "." is not a local file system.
* tests/install/basic-1: Otherwise, it would fail on some NFS
file systems.
2007-03-20 13:26:28 +01:00
Paul Eggert
02b2e48b12 * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
Add $(LIB_ACL_TRIVIAL).
2007-03-20 13:21:33 +01:00
Jim Meyering
5bc4b89be8 Fix a generic NFS-related test failure.
* tests/mkdir/p-3: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable.  Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-03-18 22:37:54 +01:00
Jim Meyering
93ff956de7 Merge branch 'master' of /cu 2007-03-18 18:14:49 +01:00
Jim Meyering
553d347d3e Fix a bug in how pr -m -s works.
* NEWS: Describe how the fix affects pr.
* src/pr.c (init_parameters): The --merge (-m) option does
not imply --expand-tabs (-e), so don't set "untabify_input".
Reported by Wis Macomson.
* tests/misc/pr: New file.  Test for the above fix.
* tests/misc/Makefile.am (TESTS): Add pr.
* THANKS: Update.
2007-03-18 16:21:26 +01:00
Jim Meyering
b1d89070f6 Fix a silly syntax error introduced in last change. 2007-03-17 13:15:17 +01:00
Jim Meyering
20bc0790a7 fix a syntax error 2007-03-17 13:01:56 +01:00
Jim Meyering
7828d1b4e2 Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
* bootstrap: Put ""s around use of $build_aux, in case
someone uses a name containing shell meta-characters.
Reported by Alfred M. Szmidt.
2007-03-17 12:54:28 +01:00
Jim Meyering
5b3313c120 * tests/misc/tty-eof: Add shuf to the list of tested commands. 2007-03-17 12:23:14 +01:00
Jim Meyering
0edae5eee6 Avoid test failure on NFS-mounted Solaris ZFS file system.
* tests/du/basic: Skip a test if "." is on a non-local file system.
2007-03-17 11:44:42 +01:00
Jim Meyering
11f43d2e22 Avoid an obscure build failure, prefer waitpid over wait.
* src/install.c (strip): Use waitpid, not wait.  It's equivalent,
but feels less obsolescent.
2007-03-17 10:43:04 +01:00
Jim Meyering
87c54fa0ae * bootstrap: Don't use \> in grep regexp. For HP-UX. 2007-03-17 09:46:54 +01:00
Jim Meyering
3715c01f8e Begin adding support for Solaris ZFS (4 entries per trivial ACL)
* gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
(file_has_acl, copy_acl): Use it, rather than enumerating errno values.
(is_trivial_acl): New function.  Incomplete, for now.
(file_has_acl, copy_acl): Use the new function, rather than
counting the number of entries in an ACL.
2007-03-16 22:24:09 +01:00
Jim Meyering
d2c7d7b58f * bootstrap: Update from gnulib. 2007-03-16 22:06:27 +01:00
Jim Meyering
d1e5a7af56 * .x-sc_prohibit_atoi_atof: Add TODO here, too. 2007-03-16 22:06:04 +01:00
Paul Eggert
369aaf7e5d * src/copy.c: Include filemode.h.
(overwrite_prompt): Say "try to overwrite", not "overwrite", to
make it clearer that the attempt may fail.  Problem reported by
Dan Jacobson in:
http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
Output symbolic mode as well as numeric.
* tests/mv/i-2 (fail): Adjust to new prompt format.
2007-03-16 21:41:50 +01:00
Paul Eggert
39e85b7258 Fix manual in response to bug reports by Dan Jacobson.
* coreutils.texi (sort invocation): Explain numeric sorts better.
Compress self-congratulation into a simple "comparison is exact"
notice; the --general-numeric-sort option already explains the
tradeoffs.
(seq invocation): Add example of -f.
2007-03-16 06:30:32 +01:00
Jim Meyering
487e5317be Enforce policy: don't use *scanf functions.
* Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
* .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
* TODO: note that stty.c needs this small clean-up.
2007-03-15 09:19:10 +01:00
Jim Meyering
112b9537dd Prepare to work on ACL-related failure when using Solaris ZFS.
* gl/lib/acl.c: New file, copied from gnulib.
2007-03-13 19:52:13 +01:00
Jim Meyering
24045feb85 Work around a failing test due to an NFS-based race condition.
* tests/cp/sparse: Accept a report that the copy is *smaller*.
2007-03-13 19:51:47 +01:00
Jim Meyering
64f972e94b * coreutils.texi (cp invocation): Mention that --preserve=timestamps
doesn't preserve time stamps on symbolic links.
Reported by Polo Talnir in <https://bugzilla.redhat.com/230866>.
2007-03-12 14:26:24 +01:00
Jim Meyering
0c1e917d6c Merge branch 'master' of /cu 2007-03-12 10:36:01 +01:00
Jim Meyering
1e7a0f088b Make bootstrap.conf a tiny bit more generic.
* bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
2007-03-12 09:47:36 +01:00
Jim Meyering
fd6fc97156 Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
* gl/lib/savewd.c: Copy this file from gnulib, then change
"errno != EACCES" to (errno != EACCES && errno != ESTALE).
The symptom was this failure in tests/install/basic-1:
ginstall: cannot create directory `rel/a': Stale NFS file handle
2007-03-10 11:39:50 +01:00
Jim Meyering
04131454e3 The preceding change solved part of the problem. Now ginstall fails.
* tests/install/basic-1: Temporarily, don't redirect ginstall's
stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
is failing.
2007-03-10 10:36:25 +01:00
Jim Meyering
bc86cb44e3 * tests/install/basic-1: When setting up an unreadable "." in an
inaccessible parent, make the parent inaccessible *after* making "."
unreadable.  Otherwise, running "chmod a-r ." in an already-
inaccessible parent would fail on NFS with "Stale NFS file handle".
Reported by Bob Proulx.
2007-03-10 09:53:49 +01:00
Jim Meyering
0a538a2488 remove trailing blanks 2007-03-10 08:17:19 +01:00
Jim Meyering
ca4f28bc83 * Makefile.maint (po-check): Exclude c99-to-c89.diff. 2007-03-10 00:43:50 +01:00
Jim Meyering
36aeb30081 Mention that both Jay Soffian and Charles Randall wrote early versions
of sort's temp-file-compression code.
2007-03-10 00:43:36 +01:00
Jim Meyering
fe3fbf2f54 * tests/chgrp/basic: Also avoid test failures on Darwin 8.8.x (MacOS X 10.4). 2007-03-09 20:09:46 +01:00
Jim Meyering
d9079b12e3 src/fs.h: git-rm a generated but already-ignored file 2007-03-09 15:19:21 +01:00
Jim Meyering
222b7c46bd Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
* tests/chgrp/basic: Don't let failure by chgrp to set the
group of a symlink make this test fail.  Do give a diagnostic.
In the chgrp-no-change-ctime test, add darwin7.9.0 as another
known-failing system.
When failing on some other system, print $host_triplet, too.
Reported by Peter Fales.
2007-03-09 08:47:33 +01:00
Jim Meyering
4bf9fe82c0 * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets. 2007-03-08 22:09:11 +01:00
Jim Meyering
fe068c60fb Add to .cvsignore and .gitignore files. 2007-03-08 22:01:27 +01:00
Jim Meyering
e3864a430e TODO: printf: support %a even when the native *printf(3) is deficient 2007-03-08 22:01:05 +01:00
Jim Meyering
2639ed8208 rm without -f: give a better diagnostic when euidaccess fails.
* src/remove.c (write_protected_non_symlink): Return int, not bool,
so that we can indicate failure too (as a postive error number).
(prompt): If write_protected_non_symlink fails, report that error
number and fail rather than charging ahead and removing the dubious
entry.  Redo the logic of printing a diagnostic so that we need to
invoke quote (full_filename (...)) only once.  More details at:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
2007-03-08 10:38:59 +01:00
Jim Meyering
09aab8cb41 Generalize a few more cvs-isms.
* bootstrap (checkout_only_file): Rename from CVS_only_file.
Change comments and diagnostics not to say "CVS".
2007-03-08 09:19:39 +01:00
Jim Meyering
9abd8baaaa * bootstrap: Run libtool, if necessary. 2007-03-08 01:06:41 +01:00
Jim Meyering
551bed87fa Make bootstrap a little more general.
* bootstrap (build_aux): Factor out/use this definition.
Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
(insert_sorted_if_absent): Move function definition "up", to
precede new first use.
If $build_aux/ doesn't exist initially, create it, and
mark it as ignored.
2007-03-08 00:23:00 +01:00
Jim Meyering
b7a568ece8 * vasnprintf.c (VASNPRINTF): Add missing semicolon. 2007-03-04 13:03:59 +01:00
Andrew Church
2871ad3b45 Fix a bug: cp -x would fail to set mount point permissions.
* NEWS: mention cp -x bug fix
* src/copy.c (copy_internal): Don't return immediately after
copying a mount point that we do not intend to recurse under.
Based on a patch by Andrew Church.
2007-03-03 23:00:18 +01:00
Jim Meyering
f0537a71f1 pwd-unreadable-parent: Skip test on ia64/Linux, too.
* tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
Reported by Bob Proulx.
2007-03-03 21:38:16 +01:00
Jim Meyering
1187f011d3 Add to .cvsignore and .gitignore files. 2007-03-02 14:54:52 +01:00
Jim Meyering
c872a5f7bb * vasnprintf.c (VASNPRINTF): Remove cast of alloca return value. 2007-03-02 14:33:12 +01:00
Jim Meyering
fe4f1227a5 pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Rather than trying to decide
whether this test has a chance of succeeding, run it only when
$(host_os) is linux-gnu.  It was failing on powerpc-apple-darwin8.8.0
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
2007-03-02 14:25:48 +01:00
Jim Meyering
13a4b23e79 * tests/misc/pwd-long: Also allow "+" in $PWD. 2007-03-02 13:18:43 +01:00
Jim Meyering
b655a2154e * Makefile.maint (my-distcheck): Skip the c99/c89 check if there's no such .diff file. 2007-03-02 11:13:54 +01:00
Jim Meyering
272d99e7a3 Remove another coreutils-ism. Formatting cleanup.
* Makefile.maint (my-distcheck): Update an outdated comment.
(emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
2007-03-02 10:57:08 +01:00
Jim Meyering
262963212b * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
(my-distcheck): Use the new variable, instead of too-long literal.
2007-03-01 11:06:58 +01:00
Jim Meyering
ea42025c70 Make "make syntax-check" rules less coreutils-specific.
* Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
(sc_cast_of_alloca_return_value): Likewise.
(sc_root_tests): Do nothing if there is no check-root target
in tests/Makefile.am.
2007-03-01 11:05:35 +01:00
Jim Meyering
7daf29845b Run the writable-files check only for release-building targets.
* Makefile.maint (local-checks-available): Remove writable-files.
(alpha beta major): Put it here, instead.
2007-03-01 11:02:25 +01:00
Jim Meyering
5703f662b7 "make syntax-check" now runs only Makefile.cfg-selected tests
* Makefile.maint (syntax-check-rules): Hoist this definition so that
it precedes the indirect use in the definition of $(local-check).
(local-check): Use :=, not just "=".
(syntax-check): Depend on $(local-check), not $(syntax-check-rules).
2007-03-01 11:00:12 +01:00
Jim Meyering
b3b6f52fad Merge in changes from gnulib:
* vasnprintf.c: Add a comment explaining why coreutils has its own
version of this file.
Include <stdint.h>.
(SIZE_MAX): Remove definition (now, stdint.h covers that).
(EOVERFLOW): Remove definition (now done via the eoverflow module).
Update some #ifdef to #if.
Use HAVE_LONG_LONG_INT, not HAVE_LONG_LONG.
* printf-parse.c: Likewise.
2007-03-01 10:41:48 +01:00
Bruno Haible
f6f2846bd8 * bootstrap.conf (gnulib_modules): Replace xreadlink with
xreadlink-with-size. Add xreadlink.
* src/copy.c (copy_internal): Update.
* src/ls.c (is_directory): Update.
* src/stat.c (print_stat): Update.
* src/readlink.c (main): Use the one-argument xreadlink function.
2007-03-01 08:06:24 +01:00
Paul Eggert
e5dbc71841 * doc/coreutils.texi (Common options): --si outputs "M", not "MB".
Problem reported by Philip Rowlands in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
2007-02-28 22:25:53 +01:00
Jim Meyering
b2a48ec240 * tsearch.c: Remove unused file. 2007-02-28 21:50:14 +01:00
Jim Meyering
c62a7156c5 * .x-sc_file_system: Add the new test, tests/misc/df-P, to this
list of exceptions, for the "make distcheck" sc_file_system rule.
2007-02-28 13:52:20 +01:00
Jim Meyering
195108489b * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition. 2007-02-28 10:27:31 +01:00
Jim Meyering
55bc95b4d3 * tests/misc/df-P: This script *is* executable. 2007-02-28 08:11:41 +01:00
Jim Meyering
d480544281 Add a test for today's df -P fix.
* tests/misc/df-P: New file.
* tests/misc/Makefile.am (TESTS): Add df-P.
2007-02-27 19:35:27 +01:00
Paul Eggert
817d0261eb Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
* NEWS: With -P, the default block size and output format is not
affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
* src/df.c (main): Implement this.
* doc/coreutils.texi (df invocation): With -P, the default block size
and output format is not affected by DF_BLOCK_SIZE, BLOCK_SIZE, or
BLOCKSIZE.
2007-02-27 19:33:03 +01:00
Jim Meyering
898d3df2f8 * Makefile.maint (announcement): Adjust so that it works with
announce-gen's --gnulib-snapshot-time-stamp option.
Indent one of the command lines using TAB, not 8 spaces.
2007-02-25 01:11:32 +01:00
Jim Meyering
9317cccb8f Post-release version change.
* NEWS: Add a line for 6.8+.
* configure.ac (AC_INIT): Set new version string.
2007-02-25 01:10:07 +01:00
Jim Meyering
cc2d4f6c46 Version 6.8.
* NEWS: Record release date and new version number.
* configure.ac (AC_INIT): New version number.
2007-02-24 21:16:52 +01:00
Jim Meyering
471eca0dd6 Don't skip this test on new-enough Linux/GNU systems.
* tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
rather than for __GETCWD_PREFIX in config.h (the latter is no
longer defined, ever, due to gnulib changes).
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
2007-02-24 20:57:14 +01:00
Jim Meyering
e98137ddd4 Remove the "gnits" option; it prohibits my using "+" as a version
string suffix, and all it does (beyond the default "gnu" option)
is to _require_ the THANKS file.
* configure.ac (AM_INIT_AUTOMAKE): Remove it.

Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
* tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
* tests/chown/Makefile.am, tests/cp/Makefile.am:
* tests/du/Makefile.am, tests/expr/Makefile.am:
* tests/factor/Makefile.am, tests/general/Makefile.am:
* tests/install/Makefile.am, tests/ln/Makefile.am:
* tests/ls/Makefile.am, tests/mkdir/Makefile.am:
* tests/mv/Makefile.am, tests/readlink/Makefile.am:
* tests/rm/Makefile.am, tests/rmdir/Makefile.am:
* tests/seq/Makefile.am, tests/stty/Makefile.am:
* tests/tee/Makefile.am, tests/touch/Makefile.am:
2007-02-24 13:57:51 +01:00
Jim Meyering
1b2056c435 * README: Document the OSF/1 4.0d build failure and work-around.
Reported by Bruno Haible.
2007-02-24 13:49:20 +01:00
Jim Meyering
f92a08e171 * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
Nicer connotations.
* configure.ac: Use 6.7+, not 6.7-dirty.
2007-02-24 13:13:45 +01:00
Paul Eggert
3ea177e3fa * NEWS: sort no longer compresses temporaries by default.
* bootstrap.conf: Remove findprog.
* doc/coreutils.texi (sort invocation): The default is to not
compress.  Don't treat "" specially.
* src/sort.c: Don't include findprog.h.
(create_temp): Compress only if the user specified --compress-program.
* tests/misc/sort-compress: Adjusts tests to match new behavior.
2007-02-24 12:24:27 +01:00
Jim Meyering
75460e090c Avoid a shell syntax error, when building with an inadequate Perl.
* man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
it can expand to "/.../missing perl".
2007-02-24 09:26:56 +01:00
Jim Meyering
90390c6a92 * man/Makefile.am (.x.1): Warn when unable to update a man page.
Suggestion from Bruno Haible.
2007-02-24 09:14:56 +01:00
Bruno Haible
63813d0950 Handle better the combination of old Perl and a pre-c99 compiler.
* man/Makefile.am (.x.1): If the autoconf test has determined that
perl is missing or not a sufficient version, do nothing.
2007-02-24 08:51:19 +01:00
Bruno Haible
2e140cfb42 * tests/readlink/can-e: Put the closing double-quote at the end of a
backquoted word, not in the middle. Works around a bug in sh on
OSF/1 4.0d.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
2007-02-24 08:22:08 +01:00
Bruno Haible
33176a7269 * tests/du/slink: Skip the test if executing on an nfsv3 file system.
This avoids a test failure at least on OSF/1 4.0d.
2007-02-24 08:20:37 +01:00
Jim Meyering
813de08e50 * randperm.c (randperm_new): Comment: say that this function
returns a pointer to malloc'd storage.
2007-02-23 22:16:12 +01:00
Jim Meyering
5a8a00e16e * src/date.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
2007-02-23 17:50:40 +01:00
Ed Santiago
54bdcc09ae * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
for a separator.  Include sample RFC 2822 and 3339 output.
2007-02-23 16:11:01 +01:00
Jim Meyering
cb121d8f36 With -Dlint, make shuf free all heap-allocated storage.
* src/shuf.c (main): Move declaration of input_lines to
function scope, and initialize to NULL, so we can free it.
[lint]: Free all malloc'd memory.
* tests/misc/shuf: Also test shuf's -e and -i options.
2007-02-23 15:18:16 +01:00
Jim Meyering
3a9070dce7 Correct typo in ChangeLog entry. 2007-02-22 23:51:43 +01:00
Jim Meyering
93f9b9be84 Merge in a change from some other incarnation of this file (gzip?)
* bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
2007-02-22 23:37:19 +01:00
Paul Eggert
4e73fea3e3 Honor dd's noatime flag if possible, even if not supported on build fs
* doc/coreutils.texi (dd invocation): Warn that noatime might not be
reliable.
* src/dd.c (flags, usage): Look at O_NOATIME, not
HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
flag, so that dd attempts O_NOATIME even if the build file system
does not support it.  Problem reported by Jim Meyering today in
bug-coreutils.
* tests/dd/misc: Generate a warning, not a failure, if noatime
exists but fails.
2007-02-22 19:09:35 +01:00
Jim Meyering
c450b625b4 Adjust preceding change not to perform an unaligned access.
* src/copy.c (copy_reg): Undo previous change.  Instead, make
it clearer that we're using a single-byte sentinel, and
[lint]: Initialize uintptr_t-1 bytes after the sentinel.
Reported by Andreas Schwab.
2007-02-22 16:32:45 +01:00
Jim Meyering
f48ca7f500 Placate valgrind, wrt ./cp --sparse=always
* src/copy.c (copy_reg): Place the sentinel by setting a
full word's worth of bits, not just a single byte's worth.
This avoids a harmless (but distracting) case of memory being
used-uninitialized.
2007-02-22 12:50:36 +01:00
Jim Meyering
c25841e0d4 Add to .cvsignore and .gitignore files. 2007-02-21 22:45:09 +01:00
Jim Meyering
45a35825dc * tests/misc/date: Remove vestigial use of Data::Dumper. 2007-02-21 17:26:32 +01:00
Paul Eggert
cc388d140c * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
about out-of-range initializer with Sun C 5.8.
2007-02-21 17:23:05 +01:00
Jim Meyering
c46549dc38 * bootstrap (CVS_only_file): Use README-hacking. 2007-02-20 22:44:15 +01:00
Jim Meyering
2d2255272d * README-hacking: Update to reflect that we now use git. 2007-02-20 22:42:56 +01:00
Jim Meyering
4cf919bcdf Now that we use GIT, not cvs, rename README-cvs.
* README-hacking: Renamed from...
* README-cvs: ...this.
2007-02-20 22:37:18 +01:00
Jim Meyering
d7226387a9 * src/env.c (main): When invoked with no arguments (i.e. when printing
the environment), use a local variable to iterate through the global
"environ" array, rather than "environ" itself.  This is solely to
avoid changing the environment for an LD_PRELOAD-substituted "puts"
or "exit" function.  Tiny patch by Harvey Eneman.  See
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
* THANKS: Update.
2007-02-20 17:23:51 +01:00
Jim Meyering
dd99d05b4a * bootstrap: Move definitions of temporary directory names and the
new bt_regex "up" to precede all uses, so it's clearer what their
scope is.  Also, use [.], rather than \\., since the former works
even if eval'd.
2007-02-20 17:20:22 +01:00
Jim Meyering
fd32ffb4da * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
Based on the bison 2007-02-19 change by Joel E. Denny.
2007-02-20 17:08:10 +01:00
Paul Eggert
c363fcb9f0 * NEWS: sort now uses a --compress-program option rather than
an environment variable.
* doc/coreutils.texi (sort invocation): Document this.
* src/sort.c (usage): Likewise.
(COMPRESS_PROGRAM_OPTION): New const.
(long_options, create_temp, main): Support new option.
* tests/misc/sort-compress: Test it.
2007-02-19 22:11:18 +01:00
Jim Meyering
e189deb855 * bootstrap: Fix typo s/dowloading/downloading/ in --help output. 2007-02-19 18:44:21 +01:00
Jim Meyering
aeb892e592 Add to .cvsignore and .gitignore files. 2007-02-18 22:40:52 +01:00
Jim Meyering
6819756293 Rely on gnulib-generated stdlib.h, not exit.h.
* src/system.h: Don't include exit.h, now that it's subsumed
by the gnulib-generated stdlib.h.
* lib/xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h
2007-02-18 22:34:37 +01:00
Jim Meyering
c95bb0c6f0 * tests/rm/fail-eacces: Skip this test when running as root.
Reported by Matthew Woehlke.
2007-02-18 17:40:06 +01:00
Jim Meyering
d07d81df27 * bootstrap: Use "._bootmp" as the temporary directory name,
not ".#bootmp".  The latter's "#" caused trouble with the new,
gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
2007-02-18 12:06:01 +01:00
Paul Eggert
516f42ab40 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
* src/dircolors.c: Include c-strcase.h.
(dc_parse_stream): Use c_strcasecmp rather than
strcasecmp to avoid unreliable results in locales like Turkish
where strcasecmp is incompatible with the C locale.
2007-02-15 08:16:30 +01:00
Jim Meyering
d163cd681a Also check for and print stderr output, in case a program fails.
* tests/misc/tty-eof: Occasionally (not reproducible), this
test would fail, with one or more programs exiting nonzero, e.g.,
tty-eof: sha224sum exited with status 1 (expected 0)
Now, maybe we'll get a clue, the next time that happens.
2007-02-13 22:27:27 +01:00
Jim Meyering
0d8ca457b3 * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script. 2007-02-12 20:09:12 +01:00
Jim Meyering
e152d05d82 * tests/misc/pwd-unreadable-parent: Skip the test if we're
definitely using the replacement.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
2007-02-12 01:20:20 +01:00
Jim Meyering
a09b047947 Remove excess leading spaces that would make help2man misbehave.
* src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
* src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
* src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
* src/date.c (usage): Use two spaces after each optional flag, not one.
Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
2007-02-10 22:30:18 +01:00
Jim Meyering
bbb61fa617 * Makefile.maint (longopt_re): Relax the regexp, making square
brackets optional, so it matches the newly reported violations, too.
2007-02-10 16:17:41 +01:00
Jim Meyering
0c2d21d3f2 * src/csplit.c (usage): Use two spaces (not one) to separate
each option string from its description, so help2man formats
the derived man page properly.  Reported by Thomas Huriaux in
<http://bugs.debian.org/410407>.
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.
2007-02-10 16:15:34 +01:00
Jim Meyering
d282370566 Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
* NEWS: Mention the bug fix.
* tests/misc/pwd-unreadable-parent: New file.
* tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
2007-02-03 20:02:48 +01:00
Paul Eggert
b28a8851ed * NEWS: Document fix for cp --preserve=mode.
* src/copy.c (copy_internal): Omit the group- or other-writeable
permissions when creating a directory, to avoid a race condition
if the special mode bits aren't right just after the directory is
created.
* src/cp.c (make_dir_parents_private): Likewise.
* tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
race fix in copy.c.
2007-02-03 18:45:46 +01:00
Paul Eggert
1c73876f5f * NEWS: Document fix for cp --parents.
* src/cp.c (make_dir_parents_private): Report the error sooner with
"cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
creating the directory, DEST/DIR.
* tests/cp/cp-parents: Test for the non-race-condition bug fixed
by the above change.
2007-02-03 18:12:11 +01:00
Jim Meyering
251f774621 * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0". 2007-02-02 08:57:47 +01:00
Jim Meyering
1d72903faf * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
consistent, so this can be applied with patch -p0.
Reported by Matthew Woehlke.

* Makefile.maint (patch-check): Use patch with its -p2 option,
since that makes this check slightly more strict.
2007-02-02 01:22:58 +01:00
Jim Meyering
6d8e33952a Merge branch 'master' of /cu 2007-02-01 18:03:59 +01:00
Jim Meyering
82276cbd2e * vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
now has only two columns).
2007-01-30 23:07:38 +01:00
Paul Eggert
c5d2da8ac8 * coreutils.texi: @item -> @itemx to fix some typos. 2007-01-30 22:56:48 +01:00
Paul Eggert
31bb8a431a * coreutils.texi (mkdir invocation): Say how to set the file
permission bits of a parent directory with mkdir -p.
2007-01-30 22:54:34 +01:00
Jim Meyering
c544a36826 Document new syntax: "chown +0:+287 file", "chgrp +99 file"
* coreutils.texi (Disambiguating names and IDs): New section.
(chown invocation, chgrp invocation): Mention the new syntax
with an xref to the new section.
2007-01-29 18:09:57 +01:00
Jim Meyering
bbe4be0c9a Regenerate .cvsignore and .gitignore files. 2007-01-29 15:38:50 +01:00
Jim Meyering
9f2adbf0be Merge branch 'master' of /cu 2007-01-29 15:32:39 +01:00
Jim Meyering
449a3751d1 Plug a leak in ls.
* src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
determine dev/inode or upon detecting a symlink loop.
2007-01-29 14:18:28 +01:00
Jim Meyering
e4eaba04dd * src/ls.c: Rename three global variables.
(cwd_file): Rename from 'files'.
(cwd_n_alloc): Rename from 'nfiles'.
(cwd_n_used): Rename from 'files_index'.
2007-01-29 14:06:45 +01:00
Jim Meyering
fc9b328ab4 Shave 8 bytes off the size of "struct fileinfo".
* src/ls.c (fileinfo): Put all members of type "bool" together.
2007-01-29 12:25:01 +01:00
Paul Eggert
c1f8d48387 Modify "ls" to sort its data faster, using the new gnulib mpsort
module rather than qsort.  This is particularly a win in
environments where strcoll is slow, since mpsort typically calls
strcoll less often than qsort does.
* bootstrap.conf (gnulib_modules): Add mpsort.
* src/ls.c: Include mpsort.h.
(sorted_file, sorted_file_alloc): New vars, for a new vector of
pointers to the file info, for speed.
(clear_files, extract_dirs_from_files, sort_files, print_current_files):
(print_many_per_line, print_horizontal, print_with_commas):
(calculate_columns): Set and use new vector.
(initialize_ordering_vector): New function.
2007-01-29 12:08:52 +01:00
Jim Meyering
e7420f9781 Regenerate .cvsignore and .gitignore files, and reflect recent removal
of string.h-related lib/*.h files
2007-01-27 00:09:28 +01:00
Paul Eggert
2b0483aa03 Adjust to today's change to gnulib, which added a module for
string.h to replace the little include files like strcase.h.
* src/dircolors.c: Don't include strcase.h.
* src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
2007-01-26 23:58:37 +01:00
Jim Meyering
8fb6d7a9b9 Merge branch 'master' of /cu 2007-01-26 21:24:30 +01:00
Jim Meyering
9140950afb * src/dd.c (advance_input_after_read_error): Change diagnostic to
say "invalid file offset" rather than "screwy file offset".
2007-01-26 16:37:37 +01:00
Jim Meyering
cee06314e1 Merge branch 'master' of /cu 2007-01-26 14:00:36 +01:00
Jim Meyering
ebc2235bd7 merge from trunk 2007-01-26 11:15:31 +01:00
Jim Meyering
cece28a8bc merge copyright line conflict 2007-01-26 11:13:44 +01:00
Jim Meyering
e0b3b059b2 * .x-sc_cast_of_argument_to_free: Remove this file.
* Makefile.am (EXTRA_DIST): Likewise.
2007-01-26 11:11:15 +01:00
Dan Hipschman
2d2a0c8311 * src/sort.c (create_temp): Remove superfluous access-X_OK
check.  find_in_path does this for us.
2007-01-25 21:56:32 +01:00
Jim Meyering
11b626c20f Remove usually-skipped test.
* tests/cp/open-perm-race: Remove this file.  It is subsumed
by parent-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
* tests/sort/Makefile.am: Regenerate.
2007-01-24 10:36:02 +01:00
Jim Meyering
a16f807d7e Pass "make distcheck" again.
* src/sort.c (usage): Split a diagnostic that had grown to be
longer than the C89 maximum of 509 bytes.
* .x-sc_cast_of_argument_to_free: New file.  Allow a cast in sort.c.
FIXME: this is just temporary, while we wait to remove the offending
access-calling code.
* Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
* Makefile.maint (sc_cast_of_argument_to_free): Use the
canonical, $$($(CVS_LIST_EXCEPT)).
* m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
2007-01-24 09:32:56 +01:00
Paul Eggert
a0b2bc8de7 * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
like it will be approved.  Also add --check=quiet, --check=silent
as long aliases, and --check=diagnose-first as an alias for -c.
* doc/coreutils.texi (sort invocation): Document this.
Also, mention that sort -c can take at most one file.
* src/sort.c: Implement this.
Include argmatch.h.
(usage): Document the change.
(CHECK_OPTION): New constant.
(long_options): --check now takes an optional argument, and is now
treated differently from 'c'.
(check_args, check_types): New constant arrays.
(check): New arg CHECKONLY, which suppresses diagnostic if -C.
(main): Parse the new options.
* tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
New tests for -C.
2007-01-24 09:06:57 +01:00
Jim Meyering
a0d74a99b7 Fix a typo.
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
2007-01-24 08:54:51 +01:00
Jim Meyering
124adb3a19 Don't depend on "which".
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
* tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
2007-01-24 00:34:54 +01:00
Dan Hipschman
054defae19 Test sort compression.
* tests/misc/Makefile.am: Add the test.
* tests/misc/sort-compress: New file containing the tests.
2007-01-24 00:27:01 +01:00
Jim Meyering
1f7d56fda5 * NEWS: sort temp file compression: tweak wording.
* src/sort.c (struct sortfile) [name]: Declare member to be const.
2007-01-24 00:22:45 +01:00
Dan Hipschman
f33168da95 * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice.  Describe parameters, too.

2007-01-21  James Youngman  <jay@gnu.org>

Centralize all the uses of sigprocmask().  Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise

2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>

Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* configure.ac: Add AC_FUNC_FORK.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
variable.
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly.  Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.
2007-01-24 00:00:21 +01:00
Jim Meyering
590a3f5b08 * tests/misc/pwd-long: Work properly even when run from the
wrong one of two or more bind-mounted sibling directories.
Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
2007-01-20 21:58:31 +01:00
Jim Meyering
94986c1d0a Merge branch 'master' of /cu 2007-01-20 16:33:20 +01:00
Paul Eggert
bdbd5d31f8 Standardize on list of signals when an app catches signals.
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise.  Also catch SIGQUIT.  More details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
2007-01-20 09:54:20 +01:00
Jim Meyering
3d63c453d5 [lib/ChangeLog]
* .cvsignore, .gitignore: Add sys, as well as more
bootstrap-inserted file names.
[m4/ChangeLog]
* .cvsignore, .gitignore: Add more bootstrap-inserted file names.
2007-01-19 23:28:03 +01:00
Dan Hipschman
e175f0d5b2 * src/sort.c (cleanup): Clear temphead at the end.
(exit_cleanup): New function.
(main): Don't invoke atexit until we're ready.
Invoke it with exit_cleanup, not with cleanup and close_stdout,
to avoid a race condition with cleanup and signal handling.  More
details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
2007-01-19 23:03:18 +01:00
Jim Meyering
fd77348fef * coreutils.texi (ls: General output formatting): Mention the
workarounds to accommodate the Apple Terminal bug.
2007-01-19 12:10:04 +01:00
Jim Meyering
03b1e07ae0 * src/c99-to-c89.diff: Adjust remove.c offsets. 2007-01-18 10:18:02 +01:00
Jim Meyering
0928c2414a Make "rm --interactive=never ..." never prompt.
* NEWS: Mention this.
* src/remove.h (enum rm_interactive): New ternary type.
(struct rm_options) [interactive]: Use it, here -- rather than bool.
* src/remove.c (prompt): Reflect type change.
* src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
* src/rm.c (main): Add a FIXME comment for '-d' option.
Adapt to type change of rm_options.interactive.

* tests/rm/i-never: New file.  Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add i-never.
2007-01-17 17:15:20 +01:00
Jim Meyering
d1ad73e0bf * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
emit foo.h, for each foo_.h.  This yields one false-positive, fts.h,
but that's ok, since fts_.h will eventually be renamed.
2007-01-15 11:31:51 +01:00
Jim Meyering
1e23a1785a * src/remove.c (remove_dir): Don't use errno in diagnostic.
Root-only test failure reported by Alex van Hout and Jon Grosshart in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.
2007-01-15 10:39:32 +01:00
Jim Meyering
54050ea91d * bootstrap.conf (avoided_gnulib_modules): Fix my typo:
s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
2007-01-15 10:32:09 +01:00
Jim Meyering
aa5a4fc172 * fchdir-stub.c: Remove file. No longer needed. 2007-01-14 17:18:51 +01:00
Bruno Haible
bb4112b407 Enable use of gnulib's new fchdir module.
* bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
since we use canonicalize.
(gnulib_modules): Add fchdir.
* m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
2007-01-14 17:15:49 +01:00
Jim Meyering
c12e44d891 * tests/cp/open-perm-race: Remove gdb-based test.
It would run only when compiled with -g, and besides is now
subsumed by file-perm-race.
* tests/cp/Makefile.am (TESTS): Remove open-perm-race.
2007-01-13 11:35:24 +01:00
Jim Meyering
9c88531fb0 Put CU_TEST_NAME in the environment for each test run by "make check".
* Transform all Makefile.am files so that when running "make check",
CU_TEST_NAME is set to the name of the test.  This is so that when I
run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
on the entire package it is more convenient to map a leak or error
found in a valgrind log file back to the offending test.
Use this command:
(echo tests/Makefile.am.in; find tests -name Makefile.am) \
 |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
   -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
2007-01-13 11:32:19 +01:00
Jim Meyering
9afcb30571 Regenerate .cvsignore and .gitignore files. 2007-01-13 11:22:01 +01:00
Jim Meyering
4e2fd4cca6 Avoid a leak in expr's implementation of the ":" (match) operator.
* src/expr.c (docolon): Free the regexp buffer using regfree, rather
than doing it manually, being careful to set fastmap to NULL first.
Free any re_regs.start and .end members, if necessary.
2007-01-11 19:31:27 +01:00
Jim Meyering
c6357f0cab * tests/misc/test-diag: Work also when libc's error function
reports the entire program name ("../../src/test"), rather than
just the final component.
2007-01-11 18:59:24 +01:00
Jim Meyering
fbcbba4b94 Merge branch 'master' of /cu 2007-01-11 14:50:09 +01:00
Jim Meyering
48545b5756 trivial merge 2007-01-11 14:49:19 +01:00
Jim Meyering
b5f1873022 Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
* src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
(change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
directory.  Non-directory entries lack fts_statp data when using
the FTS_NOSTAT option.
2007-01-10 22:00:44 +01:00
Jim Meyering
dad7d86d57 * tests/sample-test: Update copyright date to 2007.
* Makefile.maint (copyright-check): Also check the copyright date
in tests/sample-test.
2007-01-07 18:38:56 +01:00
Jim Meyering
bce110cdd5 * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
2007-01-06 10:42:17 +01:00
G.P. Halkes
37bcc27707 * src/fmt.c (copy_rest): Correct prefix handling.
Don't elide a line with the prefix followed by only white space.
(get_line): Move EOF-check to loop-termination condition.
* tests/fmt/basic (pfx-1): Adjust test to expect desired result.
(pfx-2): Remove test; its premise was contrary to the documentation.
2007-01-06 09:49:47 +01:00
Jim Meyering
ab58de37e6 Avoid a used-uninitialized bug for invalid input, i.e., when the size
of the input, not counting newlines, is 1 % 4.
* gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
It may be smaller when flushing.
2007-01-05 12:30:51 +01:00
Mike Frysinger
4082e3be7c * src/dircolors.hin: Add a TERM directive for cons25. 2007-01-05 09:52:10 +01:00
Jim Meyering
11bcfcc72a Use the release year, not the current year.
* src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
* src/Makefile.am (RELEASE_YEAR): Define it.
(.sh): Use it.
Thanks to a prod from Eric Blake.
2007-01-04 15:34:29 +01:00
Jim Meyering
aa6a5547b3 Ensure that "group --version" always prints the current year.
* src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
* src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
Suggestion from Eric Blake.
2007-01-04 14:55:42 +01:00
Jim Meyering
c8e51ae68a * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
case you don't have convenient access to glibc info documentation.
2007-01-04 12:08:36 +01:00
Jim Meyering
2ed0544df4 .cvsignore, .gitignore: Add fchownat.c and wctype-related files. 2007-01-04 12:01:48 +01:00
Jim Meyering
3b933f1e33 [ChangeLog]
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.

* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include <string.h>.
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
[doc/ChangeLog]
* coreutils.texi (base64 invocation): When decoding, newlines
are always accepted.
2007-01-04 11:52:52 +01:00
Jim Meyering
99d9e13b9c * gl/lib/base64.c: Copied from gnulib.
* gl/lib/base64.h: Likewise.
2007-01-04 11:36:54 +01:00
Evan Hunt
419aa62c46 [oops] Document what the ".0" in e.g., "-k 2,3.0" means, and...
* coreutils.texi (sort invocation): ... that it can be applied to the
field-end spec, but not the field-start one.  Patch from Evan Hunt.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-03 12:24:35 +01:00
Evan Hunt
482366105a Document what the ".0" in e.g., "-k 2,3.0" means, and...
* coreutils.texi (sort invocation): ... that it can be applied to the
field-end spec, but not the field-start one.  Patch from Evan Hunt.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-03 12:04:24 +01:00
Bruno Haible
f28e07f81d Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
* tests/chown/deref: Apply lang-default.
* tests/misc/split-a: Likewise.
* tests/mv/reply-no: Likewise.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-03 10:51:37 +01:00
Bruno Haible
8563b4c051 * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
Needed on MacOS X.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-03 10:46:25 +01:00
Paul Eggert
f0b5e513d9 Now, "ls -FRL" always follows symbolic links on Linux.
* NEWS: Mention this bug fix.
* src/ls.c (gobble_file): Fix bug reported by
Nobuyuki Tsuchimura in
http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
* tests/ls/follow-slink: Add a test for this case.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-02 07:27:22 +01:00
Jim Meyering
3b8560a637 * tests/rm/fail-eperm: Instead, simply transform the actual output diagnostic.
Test failure reported by Bob Proulx.
2007-01-01 10:56:01 +01:00
Jim Meyering
b5ef9617c4 * tests/rm/fail-eperm: Revert last change. The PATH=... setting
is not honored at least on HP-UX 11.23 systems.
2007-01-01 09:51:43 +01:00
Jim Meyering
747e7a8da8 * bootstrap (gnulib_extra_files): Remove announce-gen.
* bootstrap.conf (gnulib_modules): Add it here instead, now that
it's a module.
2006-12-30 22:16:35 +01:00
Jim Meyering
d2ec687c1c * tests/misc/base64: Factor a long, repetitive string. 2006-12-30 17:46:09 +01:00
Jim Meyering
457b4e69f5 * src/c99-to-c89.diff: Adjust remove.c offsets. 2006-12-30 16:19:26 +01:00
Jim Meyering
d08d66ebc6 Clean up after the change of 2006-12-28.
* src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP,
now that this function never modifies the pointer.  Adjust comments
and code accordingly.
(remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call,
now that AD_pop_and_chdir no longer does that.
2006-12-30 16:12:23 +01:00
Jim Meyering
5017d1b4e1 * tests/rm/fail-eperm: Avoid spurious differences (the error function
from latest glibc no longer prints the full program_name): so don't
invoke rm via ../../src/rm.  Instead, invoke it via "PATH=../../src rm".
2006-12-30 12:50:43 +01:00
Jim Meyering
841d9a7d5d * tests/mv/acl (skip): Skip this test also if the destination
directory, which is on a different file system, lacks ACL support.
2006-12-30 11:49:04 +01:00
Jim Meyering
67b9752cd1 * src/copy.c (copy_reg): Rewrite a comment that was rendered
inaccurate by the 2006-10-18 change.
2006-12-30 09:34:31 +01:00
Jim Meyering
88891aef7e When moving "up" the hierarchy, be careful to remove a just-emptied
directory before opening ".", to avoid trouble with file system
implementations that cache readdir results at opendir-time.
* src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter.
Don't update **DIRP.  Don't call fdopendir here.
(remove_dir): Call fdopendir here instead.
Report and patch from Mikulas Patocka:
<http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
2006-12-28 19:37:07 +01:00
Jim Meyering
bbcfef38a3 Remove 2006-12-24 entry (the corresponding change was never committed).
The underlying problem was fixed on 2006-12-26, by requiring a new-enough
version of autoconf.
2006-12-28 09:25:26 +01:00
Jim Meyering
2eea35fcf2 * src/tail.c (usage): Mention +N for --bytes and --lines.
Suggestion from Evan Hunt.
2006-12-27 16:00:15 +01:00
Jim Meyering
f20cd37e51 * configure.ac: Require autoconf-2.61 and automake-1.10.
Without the former (even with autoconf-2.60), "make distcheck"
would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
due to an inttypes.h generated with CFLAGS including -pedantic.
With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
2006-12-27 11:27:54 +01:00
Jim Meyering
4b9e987554 * Makefile.maint (VC-tag): Define, so as to gpg-sign each release
tag, using the release version number as the message.
(vc-dist): Use $(VC-tag), rather than "$(VC) tag".

2006-12-24  Jim Meyering  <jim@meyering.net>

* Makefile.maint (my-distcheck): Don't *configure* with
restrictive CFLAGS ('-Werror -ansi -pedantic -Wno-long-long'),
since it ends up provoking errors in generation of inttypes.h
on an Ubuntu edgy-based system.  That leads to compilation
failure due to e.g., imaxabs redefinition.
Instead, configure with default CFLAGS, and compile the
package with restrictive CFLAGS.
2006-12-26 16:42:33 +01:00
Paul Eggert
f24ff8f42b * NEWS: dd bs= operands now silently override later ibs= and obs=,
as POSIX requires.
* src/dd.c (scanargs): Implement it.
* tests/dd/misc (outbytes): Test it.
* doc/coreutils.texi (dd invocation): Specify that bs=N
overrides later ibs and obs, undoing part of the
previous change.  (The behavior was wrong.)
2006-12-22 10:09:37 +01:00
Jim Meyering
699188aa87 * coreutils.texi (dd invocation): Specify that bs=N overrides only any
_preceding_ ibs and obs settings.  Spotted by Andreas Schwab.
2006-12-21 11:13:48 +01:00
Jim Meyering
a828a78563 * Makefile.maint (patch-check): Fix shell quoting. 2006-12-21 11:05:16 +01:00
Jim Meyering
2d4cd37758 * coreutils.texi (dd invocation): Add to the description of cbs. 2006-12-21 10:24:51 +01:00
Jim Meyering
f0ee72aa01 * coreutils.texi (dd invocation): Improve the documentation
for bs, ibs, obs, and cbs.  Suggestion from Dan Jacobson.
Patch by Olivier Delhomme.
2006-12-21 10:18:58 +01:00
Jim Meyering
c8ef95eaed "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
* src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
Karl Berry reported that a cross-partition "mv /etc/issue ~"
failed with the um,... suboptimal diagnostic,
"mv: cannot remove `/etc/issue': Not a directory".
* tests/rm/Makefile.am (TESTS): Add fail-eacces.
* tests/rm/fail-eacces: New file.
* NEWS: Mention that both mv and rm are affected.
2006-12-21 08:58:11 +01:00
Jim Meyering
d69fc66d81 "cut -f 2- A B" no longer triggers a double-free bug
* src/cut.c (cut_fields): Set file-scoped global to NULL after
freeing it.  This avoids a double-free (and core dump on some systems)
for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
James Hunt in <http://bugzilla.redhat.com/220312>.
* NEWS: List this bug fix.
* THANKS: Mention him.
* tests/misc/cut: New file.
* tests/misc/Makefile.am (TESTS): Add cut.
2006-12-20 14:25:55 +01:00
Jim Meyering
4e48b4ce33 * tests/cp/open-perm-race: Correct the gdb-existence check.
Don't run either subsequent gdb command in a sub-shell.
Reported by Thomas Schwinge.
* THANKS: bring up to date.
2006-12-15 10:43:20 +01:00
Paul Eggert
6f005c8491 Make sure cp -p isn't too generous with file permissions.
* tests/cp/Makefile.am (TESTS): Add file-perm-race.
* tests/cp/file-perm-race: New file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-15 09:50:40 +01:00
Paul Eggert
6f3efa15eb Ensure cp -pR --parents isn't too generous with parent permissions.
* tests/cp/Makefile.am (TESTS): Add parent-perm-race.
* tests/cp/parent-perm-race: New file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-15 09:44:58 +01:00
Jim Meyering
33de42f2a8 * tests/chgrp/default-no-deref: Don't assume that files are created
with the primary group by default.  That's not true in a directory
with the set-GID bit set.
2006-12-14 21:07:49 +01:00
Jim Meyering
c97742932a Don't hang when there's no input tty.
* tests/cp/open-perm-race: Skip this test if there is no
controlling input `terminal'.
2006-12-14 19:32:10 +01:00
Jim Meyering
a6a1e73c0a Test for a hard-to-detect race fix, using gdb.
* tests/cp/open-perm-race: New file, to test for the
cp --preserve=ownership fix of 2006-12-06.
* tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
(TESTS): Add open-perm-race.
2006-12-14 17:17:31 +01:00
Jim Meyering
c3154b2947 chgrp, chown: Don't prohibit -RLh, aka -RL with --no-dereference.
* src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
* src/chown.c (main): Likewise.
* src/chown-core.c (change_file_owner): Add to a comment.
* tests/chown/preserve-root: Add tests.
* doc/coreutils.texi (Treating / specially): With --preserve-root,
chgrp and chown will not modify "/", even through a symlink.
2006-12-14 15:41:50 +01:00
Jim Meyering
24852bf5b5 * NEWS: --preserve-root now works with chgrp, chmod, and chown.
* src/chmod.c (process_file): Do honor the --preserve-root option.
* src/chown-core.c (change_file_owner): Likewise, but here, also
handle the case in which a traversal would go "through" a symlink
to root.  Reported by Matthew M. Boedicker
* tests/chown/preserve-root: Test for the above.
* tests/chown/Makefile.am (TESTS): Add preserve-root.
2006-12-14 11:14:25 +01:00
Jim Meyering
56007809c3 * coreutils.texi: Remove two doubled words. 2006-12-14 09:15:51 +01:00
Jim Meyering
629214eaf8 * NEWS: Mention the chmod fix induced by the recent change to gnulib's openat.m4. 2006-12-14 00:22:50 +01:00
Andreas Schwab
ae3f43d3eb Don't fail if mv/acl test succeeds.
* tests/mv/acl (skip): Check for acl support in the file system.
* tests/mv/Makefile.am (XFAIL_TESTS): Remove.
(TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-13 22:26:23 +01:00
Paul Eggert
ec95137cc3 Remove some arbitrary restrictions on size fields,
so that commands like "sort -k 18446744073709551616" no longer fail merely
because 18446744073709551616 doesn't fit in uintmax_t.  The trick is that
these fields can all be treated as effectively infinity;  their exact
values don't matter, since no internal buffer can be that long.
* src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX
if the code assumes this.  Silently truncate too-large values to SIZE_MAX,
as the remaining code will do the right thing in this case.
* src/sort.c (parse_field_count): Likewise.
* src/uniq.c (size_opt, main): Likewise.
* tests/join/Test.pm (bigfield): New test.
* tests/sort/Test.pm (bigfield): New test.
* tests/uniq/Test.pm (121): New test.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-13 22:03:54 +01:00
Jim Meyering
ae3ee95eb8 * tests/chgrp/default-no-deref: New test.
* tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
2006-12-13 13:28:17 +01:00
Jim Meyering
a6895a8da2 * jm-macros.m4: Remove AC_FUNC_SETVBUF_REVERSED, now that it's a no-op. 2006-12-12 14:41:30 +01:00
Jim Meyering
8d550c12b8 * src/system.h (SETVBUF): Remove definition, now that the
autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing.
* src/tee.c (tee_files): s/SETVBUF/setvbuf/.
* src/od.c (open_next_file): Likewise.
2006-12-12 14:34:23 +01:00
Jim Meyering
0ee9adb1fa * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
"source".  I.e. "GNU coreutils 6.7".
2006-12-09 19:20:56 +01:00
Jim Meyering
0473e718e6 * NEWS: With the change from "-pre" to "-dirty" suffix, also change
from NEXT_VER-pre to CUR_VER-dirty.  So, this is 6.7-dirty.
* configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
2006-12-09 15:57:06 +01:00
Jim Meyering
dab023dec1 * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
whenever uniq is expected to fail.  This should catch the other case
[test #112] in which uniq emits "cat: write error: Broken pipe" on
some systems.
2006-12-09 14:17:00 +01:00
Jim Meyering
939c480a79 Include bootstrap tool version info in the announcement form.
* Makefile.maint (gnulib_snapshot_date): Define.
(announcement): Use two new announce-gen options,
--bootstrap-tools and --gnulib-snapshot-date.
* Makefile.cfg (gnulib_dir): Set.
2006-12-08 10:28:05 +01:00
Jim Meyering
07af816554 Post-release version change.
* NEWS: Add a line for 6.8-dirty.
* configure.ac (AC_INIT): Set new version string.
2006-12-08 08:28:04 +01:00
Jim Meyering
6b49da0dc3 .prev-version: Record previous version: 6.7. 2006-12-08 00:19:29 +01:00
Jim Meyering
f044d2d51c Version 6.7.
* NEWS: Record release date.  Remove '-pre' suffix.
* configure.ac (AC_INIT): Remove version string suffix.
2006-12-08 00:03:00 +01:00
Jim Meyering
565b165115 * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
evoke diagnostics like this when COLUMNS=0 in the environment:
ls: ignoring invalid width in environment variable COLUMNS: 0
* tests/touch/no-rights: Likewise.
* tests/help-version: Likewise.
2006-12-07 10:11:40 +01:00
Jim Meyering
9f1b96313e Make the output of "make check" more reproducible.
* tests/uniq/Test.pm: Don't perform the pipe-reading version of test
118, since it emits "cat: write error: Broken pipe" on some systems.
2006-12-07 10:04:04 +01:00
Paul Eggert
fc92148eac cp -p now clears special bits if it fails to preserve owner or group
* NEWS: Document the cp -p fix for special bits.
* src/copy.c (set_owner): Now returns a three-way result, so
that the caller can clear the special bits.  All callers changed.
(copy_reg): Don't set the special bits if chown failed.
(copy_internal): Likewise.
* tests/cp/special-bits: Test this fix.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-07 08:10:35 +01:00
Paul Eggert
a4f7b723f0 * NEWS: Document the cp --preserve=ownership fix.
* m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
* src/copy.c (fchmod_or_lchmod): New function.
(copy_reg): New arg OMITTED_PERMISSIONS.  All uses changed.
Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
When creating a file, use O_EXCL, so we're more likely to detect
funny business by other processes.  At the end, if permissions
were omitted, chmod them back in.
(copy_internal): If the ownership might change, omit some permissions
at first, then restore them after chowning the file.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (cached_umask): New function.
* src/copy.h (cached_umask): New decl.
2006-12-06 20:44:08 +01:00
Jim Meyering
e7f7dcb9d1 Make the output of "make check" more reproducible.
* tests/misc/date-sec: Don't emit any diagnostic about sleeping.
2006-12-06 16:36:29 +01:00
Jim Meyering
545df07893 NEWS: the du bug affects coreutils-6.4, 6.5 and 6.6. 2006-12-06 13:18:43 +01:00
Paul Eggert
8406e92795 install.c: Preserve time stamps before changing owner or file mode bits,
for consistency with other coreutils programs.
2006-12-04 10:06:11 +01:00
Jim Meyering
1ea616697a * Makefile.am (libcoreutils_a_SOURCES): Remove xmemcoll.c and
xmemcoll.h.  Now, they're handled by the gnulib xmemcoll module.
2006-12-03 19:42:26 +01:00
Jim Meyering
5e585ffe84 * tests/misc/date-sec: Output a fixed string. 2006-12-03 16:01:41 +01:00
Jim Meyering
370370c8e4 Add "Reported by" 2006-12-03 11:32:31 +01:00
Jim Meyering
ba45154d8e * NEWS: du --one-file-system (-x) would skip subdirectories of any
directory listed as second or subsequent command line argument.
* tests/du/one-file-system: New file.  Test for today's fts.c fix.
* tests/du/Makefile.am (TESTS): Add one-file-system.
2006-12-03 11:17:35 +01:00
Jim Meyering
6e7e2709c8 * tests/du/basic: Generate 4KB file simply using printf, rather than
seq+head.  This avoids a spurious "Broken pipe" diagnostic from seq.
2006-12-02 22:04:13 +01:00
Jim Meyering
aa0fb1e032 * perm.texi (Mode Structure): Fix typo: s/setgid/setuid/.
Reported by Georg Neis as Debian bug 400778.
2006-11-28 23:03:08 +01:00
Jim Meyering
1ddf7faf11 * tests/mv/no-target-dir: Detect a buggy rename syscall. If found,
skip this test.  This happens at least on ia64 linux-2.4.19 w/ext3.
Reported by Matthew Woehlke.
2006-11-28 13:36:37 +01:00
Jim Meyering
db7092bed3 * tests/mv/dir2dir: Also accept EBUSY.
Reported by Matthew Woehlke.
2006-11-28 09:21:00 +01:00
Jim Meyering
97136cb93f * Makefile.maint (patch-check): Rewrite to diagnose failure.
* src/c99-to-c89.diff: Adjust shred.c offsets.
2006-11-27 14:38:35 +01:00
Paul Eggert
9b06af3367 Improve the check for departures from C89, and fix the departures
I found.
* Makefile.maint (my-distcheck): Also check for C89 compatibility
as best we can with GCC.
* src/stat.c (PRINTF_OPTION): Omit comma before } in enum
declaration; C89 doesn't allow this.
* src/dcgen: Don't generate string literals longer than
what C89 requires support for.
* src/cut.c (usage): Don't use string literals longer than
what C89 requires support for.
* src/date.c (usage): Likewise.
* src/dd.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/ls.c (usage): Likewise.
* src/od.c (usage): Likewise.
* src/readlink.c (usage): Likewise.
* src/seq.c (usage): Likewise.
* src/shred.c (usage): Likewise.
2006-11-27 11:27:46 +01:00
Mike Frysinger
a45772d52d recognize new archive, audio, image formats; give audio files a separate color
* src/dircolors.hin: Add comments for common .sh and .csh scripts.
Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive
suffixes.  Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob,
.qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats.
Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes.  Change
audio color to 00;36 to differentiate from image/video color.
2006-11-27 08:58:40 +01:00
Jim Meyering
a43ee65ee5 * Makefile.maint (patch-check): Compile patched sources with
CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
no violations remain.
2006-11-26 18:51:27 +01:00
Jim Meyering
549bbdf7b4 * src/c99-to-c89.diff: Remove 3 bogus hunks. 2006-11-26 18:49:55 +01:00
Jim Meyering
5e2f415d17 * src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
Update callers.
2006-11-26 18:47:54 +01:00
Jim Meyering
d6a37dfa3b * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c. 2006-11-26 18:42:56 +01:00
Jim Meyering
8ec7811e82 * src/rm.c (main): Remove unnecessary (assuming C99) braces. 2006-11-26 18:35:38 +01:00
Jim Meyering
08dcc35470 Reflect that these are Paul's changes. I've divided them into separate
deltas.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:41:00 +01:00
Paul Eggert
17a7d2c81b Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
while trying to retain the readability of C99 as much as possible.
* src/remove.c (close_preserve_errno): Remove.
(fd_to_subdirp): Rewrite to avoid the need for decl after statement.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:40:38 +01:00
Paul Eggert
a23c91026d * src/remove.c (rm): Move cycle_check_init call into callee...
Use an else clause in place of a "continue" statement.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:40:37 +01:00
Paul Eggert
1ce71652fc * src/remove.c (AD_ensure_initialized): New function.
after statement.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:40:16 +01:00
Paul Eggert
1b95d5ee81 * src/remove.c (AD_pop_and_chdir): Return prev_dir rather than storing through
a pointer argument.  All uses changed.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:39:53 +01:00
Paul Eggert
6b7c67ad88 * src/remove.c (cache_stat_init): Return its argument, for convenience.
Update the caller in remove_dir.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:39:27 +01:00
Paul Eggert
02e24f2593 * src/remove.c (rm_1): Remove decl of local, fd_cwd.
Replace each of two uses with literal AT_FDCWD.

Signed-off-by: Paul Eggert <eggert@cs.ucla.edu>
2006-11-26 17:38:09 +01:00
Jim Meyering
5891b7ce21 * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too. 2006-11-25 19:16:26 +01:00
Theodoros V. Kalamatianos
c8092e5db0 * tests/du/inacc-dest: Skip this test when running as root. 2006-11-24 22:08:33 +01:00
Jim Meyering
8cafe0070a Add announce-gen to build-aux/.*ignore files. 2006-11-23 16:31:18 +01:00
Jim Meyering
d0275e280e * announce-gen: Remove file. It's moving to gnulib.
* bootstrap: Pull it from gnulib/build-aux instead.
* Makefile.maint (announcement): Reflect move to ./build-aux.
2006-11-23 16:28:49 +01:00
Jim Meyering
37012effc9 * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
rather than a pipeline that would sometimes evoke a diagnostic
like "seq: write error: Broken pipe".
2006-11-23 09:09:53 +01:00
Jim Meyering
a409011bba * tests/help-version: Suppress dd transfer rate output. 2006-11-23 09:02:36 +01:00
Jim Meyering
a3ae3e8085 * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre. 2006-11-23 01:12:22 +01:00
Paul Eggert
3ccd02d5b9 * randread.c (__attribute__): Don't define if __attribute__ is already defined.
Otherwise, the code won't conform to C99, since
the macro arg is spelled differently by some include file, and the
compilation fails with pedantic GCC.
2006-11-23 01:06:42 +01:00
Jim Meyering
5272c6daa1 * announce-gen (print_news_deltas): Fix silly, but harmless typo:
change "(:?..." to "(?:..." in regexps.
2006-11-22 16:16:05 +01:00
Jim Meyering
e750c5cac8 Post-release version change.
* NEWS: Add a line for 6.7-pre.
* configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
2006-11-22 16:15:02 +01:00
Jim Meyering
92210636da .prev-version: Record previous version: 6.6. 2006-11-22 12:52:34 +01:00
Jim Meyering
46710dd82a Version 6.6.
* NEWS: Record release date.  Remove "-pre" suffix.
* configure.ac (AC_INIT): Remove "-pre" suffix from version string.
2006-11-22 12:40:57 +01:00
Jim Meyering
efab0d7989 * Makefile.maint (announcement): Don't use now-removed
--release-archive-directory=... option.
2006-11-22 12:38:16 +01:00
Jim Meyering
659e5f5edc * announce-gen: Remove unused --release-archive-directory option.
(print_news_deltas): Accept new adjective, "Noteworthy", in addition
to the old "Major".
Match version numbers in NEWS using tighter regular expressions.
(main): Require the --gpg-key-id=ID option.
2006-11-22 12:35:02 +01:00
Jim Meyering
b076de8551 * NEWS: Mention the three noteworthy changes, all fixed via gnulib. 2006-11-22 10:14:15 +01:00
Jim Meyering
7719e67e36 * .cvsignore, .gitignore: Add fstat.c. 2006-11-22 10:10:30 +01:00
Jim Meyering
d66091126a * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
skip the test rather than failing.  Reported by Michael Deutschmann.
2006-11-21 09:32:55 +01:00
Jim Meyering
41b5fe3246 * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
rather than just "exit N".
2006-11-21 09:03:27 +01:00
Jim Meyering
e9a8c140da Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
(all_t): Add t7.
2006-11-21 00:37:03 +01:00
Jim Meyering
279c41d79c Add a root-only test for today's lib/idcache.c fix.
* tests/ls/nameless-uid: New file.
* tests/ls/Makefile.am (TESTS): Add nameless-uid.
(TESTS_ENVIRONMENT): Add PERL to the list.
2006-11-20 11:31:05 +01:00
Jim Meyering
81ebd46046 * tests/tail-2/assert-2: Mark as a very-expensive test, because I
find the 7-second sleep annoyingly long.  Besides, this test is
probably far too specific and timing sensitive ever to trigger again.
* tests/tail-2/assert: Likewise.
2006-11-19 23:19:06 +01:00
Jim Meyering
318fb0502d Post-release version change.
* NEWS: Add a line for 6.6-pre.
* configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
2006-11-19 19:44:23 +01:00
Jim Meyering
ad2a81ce8b .prev-version: Record previous version: 6.5. 2006-11-19 14:10:48 +01:00
Jim Meyering
497a5cf465 Version 6.5.
* NEWS: Record release date.  Remove "-cvs" suffix.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-11-19 10:58:55 +01:00
Jim Meyering
1efc5bda6c "ln --backup f f" now produces a sensible diagnostic 2006-11-18 20:19:16 +01:00
Jim Meyering
0cafba44bb "ln --backup f f" produces a misleading diagnostic:
ln: creating hard link `f' => `f': No such file or directory
* src/ln.c (do_link): Give a better diagnostic in this unusual case.
(do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
* tests/ln/Makefile.am (TESTS): Add hard-backup.
* tests/ln/hard-backup: New test for the above.
2006-11-18 20:00:39 +01:00
Paul Eggert
1a0333565f * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it directly too.
* lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h.
* m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4.
* src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS):
Omit unnecessary parenthesization of args.
* src/od.c (EQUAL_BLOCKS): Likewise.
* src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
2006-11-16 19:51:23 +01:00
Jim Meyering
a73fdeb2ce * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
automake we're skipping this test), and give a diagnostic to tell
the user the same thing.  Reported by Mike Grayson.
2006-11-16 10:05:36 +01:00
Jim Meyering
751f6acf54 change log date to be today's 2006-11-16 09:58:49 +01:00
Ralf Wildenhues
8b139ff78c Arrange to install manpages only for tools that are installed.
* man/Makefile.am (dist_man_MANS): Replace all optional manpages
with `$(MAN)', computed at configure time; also, list them ...
(optional_mans): ... in this new variable.
(max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
2006-11-16 09:57:34 +01:00
Jim Meyering
b6b438c45d * src/csplit.c (load_buffer): Plug an inconsequential leak. 2006-11-16 09:16:08 +01:00
Jim Meyering
fc9b802e3d Help valgrind see that there is no leak in dd.c.
* src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
so we need not free them at all.  This is easier than freeing
both buffers at each of the early "return"s.
2006-11-16 09:15:47 +01:00
Jim Meyering
e189a79efd * .x-po-check: Exclude gl/ files. Otherwise, po-check would
complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
2006-11-15 10:37:02 +01:00
Jim Meyering
56206ccb80 * gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
remove the now-unnecessary use of AC_LIBSOURCES.
2006-11-14 14:09:34 +01:00
Jim Meyering
3ef2f939f7 Adapt to new version of gnulib-tool.
* gl/modules/root-dev-ino: New file.
* lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
* gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
* m4/root-dev-ino.m4: Move this file ...
* gl/m4/root-dev-ino.m4: ... to here.
* bootstrap.conf (gnulib_modules): Add root-dev-ino.
2006-11-14 14:02:18 +01:00
Jim Meyering
1b00a69ff2 * readlink-stub.c, lstat-stub.c: Remove now-unused files. 2006-11-14 09:38:32 +01:00
Jim Meyering
7932d2e2d4 * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
From Paul Eggert.
2006-11-13 19:15:43 +01:00
Jim Meyering
2061f04847 Plug another technically-unimportant leak in sort.
* src/sort.c (main): Don't allocate memory for each new key here.
(insertkey): Allocate memory for each key here, instead.
(key_init): Rename from new_key.  Don't allocate.
2006-11-13 15:19:22 +01:00
Jim Meyering
d5d00c7f9f * src/sort.c (main): Plug a tiny memory leak.
Move declaration of local "minus" down to be nearer point of use.
2006-11-13 15:06:15 +01:00
Jim Meyering
84268dae4e More automatically-added ignorables. 2006-11-12 22:45:14 +01:00
Jim Meyering
78a1d22aa0 * tests/du/Makefile.am (TESTS): Add inacc-dest. 2006-11-12 19:58:58 +01:00
Jim Meyering
597bfeb851 * NEWS: Mention this bug fix. 2006-11-12 19:13:32 +01:00
Jim Meyering
c24e93d926 du would exit early, when encountering an inaccessible directory
Reported by Mike Frysinger, in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
* tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
* tests/chgrp/no-x: Remove the "fts_read failed: ..."
diagnostic from the expected output when using native fdopendir.
* tests/chmod/no-x: Likewise.
* tests/du/no-x: Likewise.
2006-11-12 18:42:24 +01:00
Jim Meyering
75be540f7d * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
for xalloc.h itself.
2006-11-12 18:41:01 +01:00
Jim Meyering
28c7ef509e Avoid false-positive when testing via valgrind.
* tests/mv/atomic: Grep strace output for a more specific pattern
than just "unlink", since that got a false positive when testing
under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
2006-11-12 08:22:46 +01:00
Jim Meyering
7c96936a04 update .cvsignore/.gitignore files 2006-10-30 09:10:56 +01:00
Jim Meyering
e24ce7c58d * Makefile.maint (patch-check): Make it easier to regenerate
the src/c99-to-c89.diff file.  E.g., I do this:
make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
2006-10-28 18:23:30 +02:00
Jim Meyering
876e46bce7 * src/c99-to-c89.diff: Update to reflect new offsets in rm.c. 2006-10-28 18:21:13 +02:00
Jim Meyering
a0db0def2d * coreutils.texi (wc invocation): When giving the order in which
the various "counts" are listed, also mention "maximum line length".
Prompted by a report from Vincent LeFevre.
2006-10-28 18:19:05 +02:00
Jim Meyering
0766fb8b54 * src/system.h (ftello): Add a compile-time check for the highly
unlikely condition of off_t narrower than long int, rather than
handling it at run time.  Based on a patch from Paul Eggert.
2006-10-26 15:16:41 +02:00
Jim Meyering
b40b5b6917 Avoid a shell bug in Tru64 4.0 sh's handling of double-quoted strings.
[patch by Paul Eggert]

* tests/chmod/c-option: When double-quoting part of a word, prefer
to double-quote the whole word.  This is a bit easier to read (at
least for me), and in some cases it avoids a shell bug with Tru64
4.0 sh reported by Nelson H. F. Beebe.  For example, instead of
"$abs_srcdir"/../setgid-check we now write
"$abs_srcdir/../setgid-check".

* tests/cp/cp-parents: Likewise.
* tests/du/inaccessible-cwd: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/install/basic-1: Likewise.
* tests/install/trap: Likewise.
* tests/misc/close-stdout: Likewise.
* tests/mkdir/concurrent-1: Likewise.
* tests/mkdir/p-1: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/readlink/can-e: Likewise.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/unread3: Likewise.
* tests/touch/no-create-missing: Likewise.

* lib/.cvsignore: Add uinttostr.c.
2006-10-26 11:03:30 +02:00
Jim Meyering
95954ad583 Portability to Tru64 V4.0.
* src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
Define inline replacement function.
This (along with a yesterday's fix for autoconf's
_AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.
2006-10-25 11:47:06 +02:00
Jim Meyering
e81a82b74f * src/cat.c (infile): Add "const" to declaration.
* src/csplit.c (prefix): Likewise.
* src/printf.c (cfcc_msg): Likewise.
* src/tail.c (valid_file_spec): Likewise.
* src/cut.c (cut_file): Likewise, for a parameter.
* src/expr.c (str_value): Likewise.
* src/fold.c (fold_file): Likewise.
* src/pr.c (init_header): Likewise.
* src/dircolors.c (dc_parse_stream): Likewise, for a local.
* src/tr.c (make_printable_str): Likewise.
* src/nl.c (body_type, header_type, footer_type, current_type):
(separator_str, build_type_arg, nl_file): Likewise, for many.
* src/paste.c (main): Don't assign a read-only string to 'optarg'.
* src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2006-10-25 01:05:30 +02:00
Jim Meyering
3e9cc76189 * tests/sample-test: Update copyright year list to include only
the current year, since this is what I'll want in any new test.
2006-10-25 00:16:13 +02:00
Jim Meyering
693311a5c3 * src/c99-to-c89.diff: Update to reflect new offsets. 2006-10-25 00:14:51 +02:00
Jim Meyering
5e42576c01 new feature: rm accepts new option: --one-file-system
Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
* src/remove.h (struct rm_options) [one_file_system]: New member.
* src/rm.c (rm_option_init): Initialize it.
(usage): Document the option.
* src/mv.c (rm_option_init): Likewise.
* src/remove.c (remove_dir): With --one-file-system and --recursive,
for each directory command line argument, do not affect a file system
different from that of the starting directory.  And give a diagnostic.
* src/rm.c (ONE_FILE_SYSTEM): New enum.
(main): Handle new option.
* tests/rm/one-file-system: Test the above.
* tests/rm/Makefile.am (TESTS): Add one-file-system.
* tests/Makefile.am (check-root): Add the rm/one-file-system
test to the list.
(EXTRA_DIST): Add other-fs-tmpdir.

* tests/mv/setup: Removed.  Renamed to...
* tests/other-fs-tmpdir: ...this new file.
* tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
* tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
* tests/mv/backup-is-src: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/to-symlink: Likewise.
* tests/mv/into-self-2: Likewise.

[doc/ChangeLog]
* coreutils.texi (rm invocation): Describe --one-file-system.
2006-10-25 00:01:33 +02:00
Jim Meyering
ba6b1acefd Don't let a failure in one test stop "make -k".
* tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
(check-root): Depend on them, rather than executing the five
commands in a single rule.  Reported by Greg Schafer.
2006-10-24 08:46:25 +02:00
Jim Meyering
a3c4e0b94c * Makefile.maint (alpha beta major): Use a better log message.
Suggested by Bob Proulx.
2006-10-23 18:51:29 +02:00
Jim Meyering
7e4eef7e40 * tests/misc/pwd-long: Whoops. Don't exec the perl script. Otherwise, the sh-trap-based
clean-up code isn't run.
2006-10-23 12:22:15 +02:00
Jim Meyering
a002111341 * tests/misc/pwd-long: Undo last change, since it made Perl invoke
pwd via a shell.  Instead, ensure that the absolute name of the
pwd binary consists solely of reasonable characters.
2006-10-23 11:52:48 +02:00
Jim Meyering
0fdbf2e8c7 * NEWS: Add a line for 6.5-cvs.
* configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
2006-10-23 07:59:04 +02:00
Jim Meyering
9b17e1d7d4 . 2006-10-22 23:55:14 +02:00
Jim Meyering
7054512f14 Remove -cvs suffix here, too. 2006-10-22 23:41:05 +02:00
Jim Meyering
479648040d add snprintf-related files to .gitignore 2006-10-22 23:39:45 +02:00
Jim Meyering
0c0121ed20 Version 6.4.
* NEWS: Record the 6.4 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-10-22 22:21:26 +02:00
Jim Meyering
33d52dbc43 * Makefile.maint: Complete the adaptation to function with a working
directory that is using git (rather than cvs) for version control.
2006-10-22 22:16:37 +02:00
Jim Meyering
9b34202141 * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
* tests/cp/cp-parents: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
2006-10-22 22:12:13 +02:00
Jim Meyering
2457af43cf * tests/sample-test: Quote variables containing absolute build
tree paths.  In the cleanup trap, make sure `cd' succeeds before
`chmod'ing and `rm'ing the temporary files.
* tests/chgrp/basic: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chgrp/no-x: Likewise.
* tests/chgrp/posix-H: Likewise.
* tests/chgrp/recurse: Likewise.
* tests/chmod/c-option: Likewise.
* tests/chmod/equal-x: Likewise.
* tests/chmod/equals: Likewise.
* tests/chmod/inaccessible: Likewise.
* tests/chmod/no-x: Likewise.
* tests/chmod/octal: Likewise.
* tests/chmod/setgid: Likewise.
* tests/chmod/umask-x: Likewise.
* tests/chmod/usage: Likewise.
* tests/chown/basic: Likewise.
* tests/chown/deref: Likewise.
* tests/chown/separator: Likewise.
* tests/cp/acl: Likewise.
* tests/cp/backup-1: Likewise.
* tests/cp/backup-dir: Likewise.
* tests/cp/backup-is-src: Likewise.
* tests/cp/cp-HL: Likewise.
* tests/cp/cp-deref: Likewise.
* tests/cp/cp-i: Likewise.
* tests/cp/cp-mv-backup: Likewise.
* tests/cp/cp-parents: Likewise.
* tests/cp/deref-slink: Likewise.
* tests/cp/dir-rm-dest: Likewise.
* tests/cp/dir-slash: Likewise.
* tests/cp/dir-vs-file: Likewise.
* tests/cp/fail-perm: Likewise.
* tests/cp/into-self: Likewise.
* tests/cp/link: Likewise.
* tests/cp/link-no-deref: Likewise.
* tests/cp/link-preserve: Likewise.
* tests/cp/no-deref-link1: Likewise.
* tests/cp/no-deref-link2: Likewise.
* tests/cp/no-deref-link3: Likewise.
* tests/cp/perm: Likewise.
* tests/cp/preserve-2: Likewise.
* tests/cp/r-vs-symlink: Likewise.
* tests/cp/same-file: Likewise.
* tests/cp/slink-2-slink: Likewise.
* tests/cp/sparse: Likewise.
* tests/cp/special-bits: Likewise.
* tests/cp/src-base-dot: Likewise.
* tests/cp/symlink-slash: Likewise.
* tests/dd/not-rewound: Likewise.
* tests/dd/skip-seek2: Likewise.
* tests/dd/unblock-sync: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/basic: Likewise.
* tests/du/deref: Likewise.
* tests/du/deref-args: Likewise.
* tests/du/exclude: Likewise.
* tests/du/fd-leak: Likewise.
* tests/du/hard-link: Likewise.
* tests/du/inaccessible-cwd: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/no-deref: Likewise.
* tests/du/no-x: Likewise.
* tests/du/restore-wd: Likewise.
* tests/du/slash: Likewise.
* tests/du/slink: Likewise.
* tests/du/trailing-slash: Likewise.
* tests/du/two-args: Likewise.
* tests/fmt/long-line: Likewise.
* tests/install/basic-1: Likewise.
* tests/install/create-leading: Likewise.
* tests/install/d-slashdot: Likewise.
* tests/install/trap: Likewise.
* tests/ln/misc: Likewise.
* tests/ln/target-1: Likewise.
* tests/ls/color-dtype-dir: Likewise.
* tests/ls/dangle: Likewise.
* tests/ls/dired: Likewise.
* tests/ls/file-type: Likewise.
* tests/ls/follow-slink: Likewise.
* tests/ls/infloop: Likewise.
* tests/ls/inode: Likewise.
* tests/ls/m-option: Likewise.
* tests/ls/no-arg: Likewise.
* tests/ls/recursive: Likewise.
* tests/ls/rt-1: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/ls/stat-failed: Likewise.
* tests/ls/stat-vs-dirent: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/close-stdout: Likewise.
* tests/misc/csplit: Likewise.
* tests/misc/date-sec: Likewise.
* tests/misc/false-status: Likewise.
* tests/misc/head-c: Likewise.
* tests/misc/head-pos: Likewise.
* tests/misc/mknod: Likewise.
* tests/misc/nl: Likewise.
* tests/misc/nohup: Likewise.
* tests/misc/pathchk1: Likewise.
* tests/misc/printf: Likewise.
* tests/misc/printf-hex: Likewise.
* tests/misc/pwd-long: Likewise.
* tests/misc/shuf: Likewise.
* tests/misc/sort-rand: Likewise.
* tests/misc/split-a: Likewise.
* tests/misc/split-fail: Likewise.
* tests/misc/split-l: Likewise.
* tests/misc/stat-fmt: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/wc-files0: Likewise.
* tests/mkdir/concurrent-1: Likewise.
* tests/mkdir/p-1: Likewise.
* tests/mkdir/p-2: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/mkdir/p-slashdot: Likewise.
* tests/mkdir/p-thru-slink: Likewise.
* tests/mkdir/p-v: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/mkdir/t-slash: Likewise.
* tests/mv/acl: Likewise.
* tests/mv/atomic: Likewise.
* tests/mv/backup-dir: Likewise.
* tests/mv/childproof: Likewise.
* tests/mv/diag: Likewise.
* tests/mv/dir-file: Likewise.
* tests/mv/dir2dir: Likewise.
* tests/mv/dup-source: Likewise.
* tests/mv/hard-2: Likewise.
* tests/mv/hard-3: Likewise.
* tests/mv/hard-4: Likewise.
* tests/mv/hard-link-1: Likewise.
* tests/mv/hard-verbose: Likewise.
* tests/mv/i-2: Likewise.
* tests/mv/i-3: Likewise.
* tests/mv/i-4: Likewise.
* tests/mv/i-5: Likewise.
* tests/mv/i-link-no: Likewise.
* tests/mv/into-self-4: Likewise.
* tests/mv/leak-fd: Likewise.
* tests/mv/mv-special-1: Likewise.
* tests/mv/no-target-dir: Likewise.
* tests/mv/part-fail: Likewise.
* tests/mv/part-hardlink: Likewise.
* tests/mv/part-rename: Likewise.
* tests/mv/part-symlink: Likewise.
* tests/mv/partition-perm: Likewise.
* tests/mv/perm-1: Likewise.
* tests/mv/reply-no: Likewise.
* tests/mv/trailing-slash: Likewise.
* tests/mv/update: Likewise.
* tests/od/od-N: Likewise.
* tests/od/x8: Likewise.
* tests/readlink/can-e: Likewise.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/readlink/rl-1: Likewise.
* tests/rm/cycle: Likewise.
* tests/rm/dangling-symlink: Likewise.
* tests/rm/deep-1: Likewise.
* tests/rm/dir-no-w: Likewise.
* tests/rm/dir-nonrecur: Likewise.
* tests/rm/dot-rel: Likewise.
* tests/rm/empty-inacc: Likewise.
* tests/rm/f-1: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/rm/hash: Likewise.
* tests/rm/i-1: Likewise.
* tests/rm/i-no-r: Likewise.
* tests/rm/ignorable: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/interactive-always: Likewise.
* tests/rm/interactive-once: Likewise.
* tests/rm/ir-1: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/no-give-up: Likewise.
* tests/rm/r-1: Likewise.
* tests/rm/r-2: Likewise.
* tests/rm/r-3: Likewise.
* tests/rm/r-4: Likewise.
* tests/rm/readdir-bug: Likewise.
* tests/rm/rm1: Likewise.
* tests/rm/rm2: Likewise.
* tests/rm/rm3: Likewise.
* tests/rm/rm4: Likewise.
* tests/rm/rm5: Likewise.
* tests/rm/sunos-1: Likewise.
* tests/rm/unread2: Likewise.
* tests/rm/unread3: Likewise.
* tests/rmdir/fail-perm: Likewise.
* tests/rmdir/t-slash: Likewise.
* tests/shred/exact: Likewise.
* tests/shred/remove: Likewise.
* tests/sum/sysv: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/assert: Likewise.
* tests/tail-2/assert-2: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/fflush: Likewise.
* tests/tail-2/infloop-1: Likewise.
* tests/tail-2/proc-ksyms: Likewise.
* tests/tail-2/start-middle: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/tee/basic: Likewise.
* tests/tee/dash: Likewise.
* tests/touch/fail-diag: Likewise.
* tests/touch/no-create-missing: Likewise.
* tests/touch/not-owner: Likewise.
* tests/touch/obsolescent: Likewise.
* tests/touch/read-only: Likewise.
* tests/touch/relative: Likewise.
2006-10-22 19:37:31 +02:00
Jim Meyering
f5417daca0 ignore po/*.po; sort .gitignore files 2006-10-22 19:00:38 +02:00
Jim Meyering
b1289b8716 * NEWS: (cp --backup fix): Fix a typo. 2006-10-22 18:59:58 +02:00
Jim Meyering
dcf5b47708 * .gitignore: Remove some references to files in subdirectories.
* build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
* m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
2006-10-21 19:50:47 +00:00
Jim Meyering
46775398f2 * src/copy.c (copy_internal): Add a comment saying why we prefer
mknod over mkfifo.
2006-10-21 07:16:19 +00:00
Jim Meyering
a75684d6ea Enable an fts optimization (call lstat only for directories,
on some file system types) also with the --preserve-root option
of chown or chgrp.
* src/chown-core.c (change_file_owner): Compare fts_statp-based
dev/ino against root dev/ino only for directories.
(chown_files): Don't let the root_dev_ino setting influence whether
we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
2006-10-20 23:01:59 +00:00
Jim Meyering
86719b3cd8 * src/od.c (usage): Change description of default to use "-w16",
not the now-invalid "-w 16" syntax.  From Dan Jacobson.
2006-10-20 15:31:11 +00:00
Jim Meyering
8d8af1248d * bootstrap: Add names to each .gitignore file (if it exists)
as well as to .cvsignore.
2006-10-20 10:08:05 +00:00
Jim Meyering
64e75cf0ed . 2006-10-19 11:54:43 +00:00
Jim Meyering
e116c805bf * POTFILES.in: Also include lib/regcomp.c, since it too uses gettext. 2006-10-19 08:54:01 +00:00
Jim Meyering
76a7aea9b6 * Makefile.maint (po-check): This rule didn't detect the new use
of "gettext" (as opposed to the use of "_" everywhere else) in
lib/xstrtol.h.  Adjust the grep regexp so that now it does.
2006-10-19 08:51:27 +00:00
Jim Meyering
14f131ea57 typo 2006-10-19 08:49:30 +00:00
Paul Eggert
177913f5b8 * POTFILES.in: Add lib/xstrtol.h. 2006-10-19 07:53:42 +00:00
Paul Eggert
86823158eb * src/copy.c (copy_reg): Rewrite slightly to avoid duplicte code
when opening dst_name.
(copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
(SYSCALL) to test for failure in a system call.
2006-10-19 05:22:54 +00:00
Paul Eggert
81afea0110 * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
a fifo.  This preserves the special mode bits on Solaris 10, which
is compatible with what Solaris 10 cp -R does.
2006-10-18 22:33:06 +00:00
Paul Eggert
7bc17873e5 * src/copy.c (copy_internal): Remove redundant and confusing local
variable src_type.
2006-10-18 21:02:27 +00:00
Paul Eggert
11cf1d39f2 * src/copy.c (copy_internal): Don't pass mkdir a mode greater than
7777.  This matches historical 'cp' behavior and avoids some
(though not all) implementation-defined behavior of mkdir.
* src/cp.c (make_dir_parents_private): Likewise.
* src/copy.c (copy_internal): Don't pass 'open' a mode greater
than 777.  This is required by POSIX.  It doesn't make any difference
in actual behavior on any host that I know of.
2006-10-18 20:56:38 +00:00
Jim Meyering
f594f1fb38 *** empty log message *** 2006-10-17 20:12:05 +00:00
Jim Meyering
a186e9eda6 * src/dd.c (usage): Use two spaces (not one) to separate the
"fdatasync" option string from its description, so help2man formats
the derived man page properly.  Reported by Samuel Thibault
in <http://bugs.debian.org/393649>.
2006-10-17 13:51:47 +00:00
Jim Meyering
d1ea87316f *** empty log message *** 2006-10-17 13:48:27 +00:00
Jim Meyering
8029cc8b5a * .x-sc_trailing_blank: Remove names of files that are no longer
version-controlled.
2006-10-16 20:20:03 +00:00
Paul Eggert
7a0f8b0487 * src/groups.sh (version): Reword message to match the other programs.
Problem reported by Eric Blake.
2006-10-16 16:53:22 +00:00
Paul Eggert
dd8398a3c6 [m4/ChangeLog]
* sha512.m4 (gl_SHA512): Add u64.h to AC_LIBSOURCES.
[lib/ChangeLog]
Port sha512sum to hosts where uintmax_t is only 32 bits, e.g.,
HP/Tandom NonStop OSS circa 2005 has 32-bit uintmax_t, 64-bit intmax_t.
* u64.h: New file.
* sha512.c (SWAP, sha512_init_ctx, sha384_init_ctx, sha512_read_ctx):
(sha384_read_ctx, sha512_conclude_ctx, sha512_process_bytes):
(sha512_round_constants, F2, F1, sha512_process_block):
(S0, S1, SS0, SS1, M, R):
Rewrite to use u64.h instead of assuming uint64_t.
* sha512.h: Include u64.h rather than stdint.h.
(rol64): Remove; moved to u64.h and renamed to u64rol.
2006-10-15 06:17:45 +00:00
Jim Meyering
443d509578 * Makefile.maint (headers_with_interesting_macro_defs): Define.
(.re-defmac, sc_always_defined_macros): New rules.
2006-10-14 12:17:24 +00:00
Jim Meyering
e0b2cb892a *** empty log message *** 2006-10-14 12:15:13 +00:00
Jim Meyering
ebcf61da0f * tests/cp/Makefile.am (TESTS): Add backup-dir. 2006-10-14 12:14:53 +00:00
Jim Meyering
1491ae9ceb * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
Instead, include "exit.h".  This hereby retires the work-around for
"Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
2006-10-14 12:12:44 +00:00
Jim Meyering
f3fbb64189 * src/cksum.c (uint_fast32_t): Don't define.
Instead, include <stdint.h>.
2006-10-14 12:04:31 +00:00
Jim Meyering
32cfc1ffec clean up 2006-10-14 12:03:50 +00:00
Jim Meyering
46693ba15b * src/pinky.c: Don't include stat-macros.h; system.h already does it. 2006-10-14 12:02:14 +00:00
Jim Meyering
269263a5f7 * src/pinky.c (S_IWGRP): Don't define.
Instead, include "stat-macros.h".
2006-10-14 10:38:54 +00:00
Jim Meyering
34b35b1a3e [ChangeLog]
* Makefile.cfg: Remove cruft that's now handled via bootstrap.
* Makefile.maint: Likewise, remove these targets/rules/variables:
(local_updates, update, cvs-update, wget_files, get-targets): Remove.
(cvs_files, wget-update, automake_repo): Likewise.
Move the comment about cvsu to build-aux/vc-list-files,
where cvsu is actually used.
[build-aux/ChangeLog]
* vc-list-files: Add a comment about cvsu.
2006-10-14 09:51:58 +00:00
Jim Meyering
e2c177710a * Makefile.maint (cvs-update): Use $(CVS), not "cvs". 2006-10-14 09:39:34 +00:00
Jim Meyering
8a2e111207 * vc-list-files: Don't filter git-ls-files output through cut. 2006-10-14 09:31:27 +00:00
Jim Meyering
095c1c83eb Work also when the working directory (with e.g. coreutils sources)
is version controlled with git, rather than CVS.
* bootstrap (CVS_only_file): Test for the existence of README-cvs,
rather than CVS.
In messages and comments, say e.g., "checked-out sources",
rather than "CVS sources".
(version_controlled_file): New function.  Work for git as well as
for CVS.  Don't use grep's -q option.
(slurp): Call it here, in place of CVS-specific code.
2006-10-14 08:51:27 +00:00
Jim Meyering
0dc7f78986 * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
to dir1/dir2~.
* src/copy.c (copy_internal): Although we do create a backup of each
destination directory when in move mode, don't do that when copying.
Reported by Peter Breitenlohner, in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
* tests/cp/backup-dir: New file.  Test for the above.
2006-10-14 05:20:27 +00:00
Jim Meyering
779168820b *** empty log message *** 2006-10-14 05:06:38 +00:00
Jim Meyering
965232b5b9 More chown/chgrp dereferencing-related fixes.
* src/chown-core.c (change_file_owner): Don't use fts_statp if
we're dereferencing symlinks.
Reverse conjuncts, so that we use dereference file_stats
(aka ent->fts_statp) only *after* we've confirmed that
chopt->affect_symlink_referent is true.  Otherwise, we might
use ent->fts_statp uninitialized.
Don't turn on FTS_NOSTAT when dereferencing symlinks.
* tests/chown/deref: Update the expected diagnostic, now that
this test case (trying to use "chown --dereference ..." on a
dangling symlink) takes a different code path.
2006-10-13 21:11:53 +00:00
Paul Eggert
5dea5d07cd Sync from Bison, as follows:
2006-10-01  Paul Eggert  <eggert@cs.ucla.edu>

Fix problems with translating English-language diagnostics.
* bootstrap: Fix bug introduced in recent bootstrap changes, with
respect to bison-runtime pot generation.  The YY_ stuff
wasn't being captured.
2006-10-13 19:07:21 +00:00
Jim Meyering
f2c088fa10 * NEWS: Mention the above. 2006-10-13 19:05:07 +00:00
Jim Meyering
dc9790379c * src/chown-core.c (change_file_owner): Use fstatat, not stat,
now that we're using fts_open with FTS_CWDFD.
* tests/chgrp/posix-H: Add --preserve-root to an invocation of
chgrp, to exercise the above fix.
2006-10-13 18:51:08 +00:00
Jim Meyering
8552234cb5 * src/du-tests: Clean up a little, though it's still not portable. 2006-10-13 15:25:37 +00:00
Jim Meyering
b985c478d6 * .vg-suppressions: Add 3 more for debian unstable. 2006-10-13 14:40:34 +00:00
Jim Meyering
1471e1e61f * tests/ls/Test.pm: Remove long-unused file.
Suggestions from Bruno Haible.
2006-10-13 14:16:39 +00:00
Jim Meyering
8dda1ae431 * Makefile.am (EXTRA_DIST): Add bootstrap.conf.
Suggestion from Bruno Haible.
2006-10-13 14:13:24 +00:00
Jim Meyering
c0b262550c * Makefile.am (libcoreutils_a_LIBADD): Append $(LIBOBJS),
to accommodate the latest version of gnulib-tool.
(libcoreutils_a_DEPENDENCIES): Likewise.
From Bruno Haible.
2006-10-12 21:13:24 +00:00
Jim Meyering
bad80a7223 * Makefile.am (THANKS-to-translators): Add missing $(srcdir).
(MAINTAINERCLEANFILES): Add .kludge-stamp.
* man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
instead of $(man_MANS).

2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2006-10-12 21:10:43 +00:00
Jim Meyering
9f70d6021b * configure.ac: Avoid compiler warnings about default return
type in function definitions and unused variables in tests.
* src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
if this is #defined.
2006-10-12 20:39:33 +00:00
Jim Meyering
5f60ffcfcf [ChangeLog]
* configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
Call gl_INIT directly, rather than through the above.
[m4/ChangeLog]
* jm-macros.m4 (coreutils_MACROS): Rename from gl_MACROS, now that
most of the gnulib macros have migrated into gnulib.
Don't call gl_INIT here (now it's called from configure.ac, directly).
2006-10-12 20:37:02 +00:00
Paul Eggert
90224c6639 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
variable was sometimes used without being initialized.  This
messed up the installation of the INSTALL file in some cases.
2006-10-11 23:03:55 +00:00
Jim Meyering
8202f4d6d5 *** empty log message *** 2006-10-11 05:46:25 +00:00
Jim Meyering
e3e4f829a1 * src/ls.c (usage): Correct description of -s, --size.
It works even without -l.  Suggestion from Karl Berry.
2006-10-11 05:44:41 +00:00
Paul Eggert
e245a66054 * src/ls.c (quote_name): Use initializer rather than memset to
initialize an object to zero.  This is easier to read and is less
likely to introduce an runtime error due to a mixup.  It causes
gcc -W to issue a warning, but you can work around this by
appending -Wno-missing-field-initializers.
* src/pathchk.c (portable_chars_only): Likewise.
* src/shred.c (main): Likewise.
* src/stty.c (main): Likewise.
* src/tr.c (card_of_complement): Likewise.
* src/wc.c (wc): Likewise.
2006-10-10 22:57:07 +00:00
Paul Eggert
489ff7f0cd * src/sort.c (usage): Mention again that sort fields are origin 1. 2006-10-09 23:26:33 +00:00
Paul Eggert
2983bf7c85 * NEWS: Fix typo: iso-8602 -> iso-8601. Problem reported by
Bob Proulx.
2006-10-09 20:38:56 +00:00
Paul Eggert
34d0ffbce4 * bootstrap (usage, main program, symlink_to_gnulib): Add option
--copy.  Inspired by a suggestion from Bruno Haible.
2006-10-09 20:33:38 +00:00
Jim Meyering
6089facdc3 Avoid a compiler warning.
* src/pathchk.c (portable_chars_only): Initialize variable of type
mbstate_t via memset, rather than via '{0}'.  Patch from Bruno Haible.
2006-10-09 11:56:40 +00:00
Jim Meyering
181428d653 * jm-macros.m4 (gl_MACROS): Remove use of AC_CONFIG_LIBOBJ_DIR(lib).
It is no longer needed, and was causing dependencies to appear
in lib/lib/.deps, which provoked a "make distcheck" failure.
2006-10-07 15:53:03 +00:00
Paul Eggert
4b86e52050 Give credit to Lars Wendler. 2006-10-07 07:12:12 +00:00
Paul Eggert
dc52b433ef * src/install.c (make_ancestor): New arg COMPONENT.
* src/mkdir.c (make_ancestor): Likewise.
* tests/install/basic-1: Check for install -Dv bug.
2006-10-07 07:08:29 +00:00
Paul Eggert
4767fc607e Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
wrong file name in some cases.
* src/install.c (struct install_options): New type.
(install_file_in_file_parents, main):
Use it instead of struct cp_options.
(process_dir): Remember the full name.
(announce_mkdir, make_ancestor): Use the full name in announcements.
* src/mkdir.c (struct mkdir_options): Add full_name member.
(make_ancestor): Use the full name in announcements.
(process_dir): Remember the full name.
* tests/mkdir/Makefile.am (TESTS): Add p-v.
* tests/mkdir/p-v: New file, to test this bug.
2006-10-06 20:44:31 +00:00
Jim Meyering
0fc6edb714 Avoid a compiler warning: const'ify and remove a cast.
* randread.c (struct randread_source) [handler]: Make parameter "const".
[handler_arg]: Add "const" attribute.
(randread_error): Make parameter "const".
(simple_new, randread_set_handler, randread_set_handler_arg): Likewise.
(randread_new): Remove now-unnecessary cast.
* randread.h: Adjust prototypes.
2006-10-06 14:37:48 +00:00
Jim Meyering
c620aeeb90 * src/c99-to-c89.diff: Update to reflect new offsets. 2006-10-06 14:24:09 +00:00
Paul Eggert
2a8efc2647 * src/chgrp.c: Don't include lchown.h; no longer needed.
* src/chown.c: Likewise.
2006-10-05 22:40:55 +00:00
Paul Eggert
08984eef49 * tests/ls/stat-dtype: Use a dynamic test to decide whether the
current file system has useful d_type info.
2006-10-05 22:10:08 +00:00
Paul Eggert
1fa3b50140 * src/dd.c (flags): noatime and nofollow now depend on
HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
(usage): Output info about noatime and nofollow only if
they are known to work.
* src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
than O_NOFOLLOW, when testing whether it's possible to avoid a
race condition reliably.
2006-10-05 21:39:12 +00:00
Jim Meyering
d78ad5cacc * tests/install/basic-1: Skip the latter part of this test if the
just-built dd binary is not readable.  Otherwise, this test would fail
when binaries were created as root.  Reported by Bauke Jan Douma in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
2006-10-05 08:43:24 +00:00
Paul Eggert
c5bccf11cc * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
MiB, since XFS hosts can legitimately have large values of
st_blksize.  Problem reported by Tony Ernst in
<http://savannah.gnu.org/bugs/?17903>.
2006-10-03 22:25:51 +00:00
Jim Meyering
1d4ac49f9d * NEWS: Update here, too. 2006-10-03 22:07:36 +00:00
Jim Meyering
a1da4a039d * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
Paul Eggert pointed out that the specified file may exist,
in spite of such an errno value.
* tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
* tests/rm/ignore-name-too-long: Remove file.
2006-10-03 22:06:31 +00:00
Jim Meyering
184dcf2caf * tests/rm/fail-eperm: Report failure also if rm is terminated by
a signal.
2006-10-03 13:57:26 +00:00
Jim Meyering
41011fa81d * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
and one in shred.c -- that were added before coreutils-6.3.
Reported by Michael Deutschmann.
2006-10-03 13:57:04 +00:00
Jim Meyering
2f7025ad2a * src/c99-to-c89.diff: Update to reflect new offsets. 2006-10-03 13:40:36 +00:00
Jim Meyering
9ac369c2bd * src/remove.c (remove_entry): With -f, exit successfully in spite
of a missing file under some very unusual conditions (with errno
being any of ENOENT, ENOTDIR, ENAMETOOLONG).
2006-10-03 13:32:55 +00:00
Jim Meyering
da9541f18e With --force (-f), rm no longer fails for ENOTDIR.
* src/remove.c (ignorable_missing): New function.
Use it everywhere, rather than open-coding the test.
Andreas Schwab reported the ENOTDIR problem.
(ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
* NEWS: Mention the bug fix.
* tests/rm/ignorable: New file.  Test for the ENOTDIR case.
* tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
* tests/rm/Makefile.am (TESTS): Add the new file names.
2006-10-03 13:13:09 +00:00
Jim Meyering
d2e7358a9b * NEWS: Add a line for 6.4-cvs.
* configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
2006-10-02 11:47:48 +00:00
Jim Meyering
d8086bc220 * bootstrap: Undo last change to this file, since now gnulib-tool
sticks with the automake default in generating dependencies.
2006-10-02 11:47:35 +00:00
Jim Meyering
2244cc1456 . 2006-09-30 17:37:25 +00:00
Jim Meyering
10688306fa Version 6.3.
* NEWS: Record the 6.3 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.

* NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
2006-09-30 07:43:21 +00:00
Jim Meyering
af8862ae29 * src/c99-to-c89.diff: Update offsets. 2006-09-30 07:37:07 +00:00
Paul Eggert
37986655cf * .cvsignore: Add openat-proc.c. 2006-09-30 00:42:06 +00:00
Paul Eggert
f7ecea33e4 * tests/rm/readdir-bug: Don't use $(...) in a shell script,
as it doesn't work with Solaris /bin/sh.
2006-09-30 00:19:29 +00:00
Jim Meyering
e245139e46 * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
the pinky segfault.
2006-09-29 21:37:18 +00:00
Jim Meyering
2e328b0196 * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
use .1 as the increment.  Actual output varies too much.
[eq-wid-3]: New, commented out test.
2006-09-29 16:52:59 +00:00
Jim Meyering
a38becce97 * src/shuf.c (read_input): Fix an off-by-one error that
would cause an infloop for piped input of 8KB or more.
* NEWS: Mention the fix.
* tests/misc/shuf: Test for the above fix.
2006-09-29 16:52:48 +00:00
Jim Meyering
31c77a2fde [ChangeLog]
Since any system may be affected by the Darwin readdir bug,
perform the extra rewinddir unconditionally.  The performance
impact of rewinding a directory is negligible.
* src/remove.c (NEED_REWIND): Define to use
CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
[m4/ChangeLog]
* readdir.m4: Remove file once again.
* jm-macros.m4: Remove reference to gl_FUNC_READDIR.
2006-09-29 15:58:04 +00:00
Jim Meyering
af46184a80 * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
increment translates to a slightly larger value.
This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
The final expected value wasn't being printed.
2006-09-29 11:30:48 +00:00
Jim Meyering
a4d470409f Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
and NFS, whereby rm would not remove all files in a directory.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
(NEED_REWIND): New macro, so that we incur the cost of the work-around
rewinddir only on afflicted systems.
* NEWS: Clarify and correct.
* tests/rm/readdir-bug: New file.  Test for the above fix.
* tests/rm/Makefile.am (TESTS): Add it.
Prompted by testing and analysis from Bruno Haible:
http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
2006-09-29 09:54:24 +00:00
Jim Meyering
344c446776 fix typo: s/dignostic/diagnostic/ 2006-09-28 23:08:20 +00:00
Paul Eggert
f2d5658c08 * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
suggested for Debian stable, which uses Perl 5.8.4.
2006-09-28 22:07:42 +00:00
Jim Meyering
0bc935e209 * readdir.m4: Increment serial number. 2006-09-28 21:03:58 +00:00
Jim Meyering
b15b6fa192 * jm-macros.m4: Require the new macro.
* readdir.m4 (gl_FUNC_READDIR): Rename from GL_FUNC_READDIR.
2006-09-28 21:03:15 +00:00
Jim Meyering
665b228730 * readdir.m4: Revivify this file.
We need it to work around a bug on Darwin 0.7.x.
2006-09-28 21:00:30 +00:00
Jim Meyering
d37c3b8c6d Automatically generated dependencies are important even
when all of the sources in a directory come from gnulib.
* bootstrap (gnulib_tool): Remove the "no-dependencies" automake
option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2006-09-28 18:33:19 +00:00
Jim Meyering
ec3554cd95 * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
Ensure that IFS is set properly and unset PATH.
Sanitize inputs.
Work properly even when the name of the selected file starts with "-".
Invoke rm via "../../src/rm", and adjust expected output.
Prompted by a patch from Tim Waugh.
2006-09-28 13:31:57 +00:00
Jim Meyering
c2de7816d8 * README-cvs: Add Bison to the list of required packages. 2006-09-28 07:10:53 +00:00
Jim Meyering
0747af4b18 * src/c99-to-c89.diff: Update offsets. 2006-09-26 22:57:51 +00:00
Jim Meyering
a86a56f7d1 * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
it from removing a directory containing 188 or more entries.
* src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
Reported by Matthew Woehlke.
2006-09-26 20:42:43 +00:00
Paul Eggert
b7c315cdda [ChangeLog]
* NEWS: "groups user" no longer outputs "user :"; you need at least
two users.  "groups" now processes options like --help more compatibly.
* src/groups.sh: Implement the option-processing change.
Handle user and group names with special characters more robustly.
Report write errors instead of exiting silently with status 1.
[doc/ChangeLog]
* coreutils.texi (groups invocation): "groups" no longer prefixes
the output with "user :" unless more than one user is specified.
2006-09-26 19:11:25 +00:00
Jim Meyering
412a3ca0b0 * README: Warn not to run autoreconf manually. Use bootstrap instead. 2006-09-26 13:03:03 +00:00
Jim Meyering
bbab62fd27 * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
Rewrite to avoid using temporary, $status.
2006-09-26 09:46:35 +00:00
Jim Meyering
5f65d05616 * NEWS: Mention the bug fix.
* src/groups.sh: Don't hide a write failure.
Reported by Iain Calder <ic56@rogers.com>.
2006-09-26 09:28:17 +00:00
Jim Meyering
509febe18b *** empty log message *** 2006-09-26 09:18:20 +00:00
Paul Eggert
3d524d9ab2 * .cvsignore: Add fchmodat.c. 2006-09-26 05:21:55 +00:00
Jim Meyering
1cd04b34dd * fchmodat.c: Remove file. gnulib's copy is identical. 2006-09-25 16:58:53 +00:00
Jim Meyering
d3c6206631 * src/chown.c (usage): Clarify --dereference description.
* src/chgrp.c (usage): Likewise.  Suggestion from Jamie McClelland.
2006-09-25 06:28:34 +00:00
Jim Meyering
f951057414 *** empty log message *** 2006-09-25 06:22:35 +00:00
Jim Meyering
e05de760c2 * NEWS: Mention these fixes.
* src/copy.c (copy_reg): With --verbose (-v), print
"removed `file_name'" just after unlinking a file.
(copy_internal): Likewise, in three more places.
Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
2006-09-24 19:28:25 +00:00
Jim Meyering
de88ea4c5d . 2006-09-24 19:27:02 +00:00
Jim Meyering
af5967eae2 * tests/mv/hard-verbose: New file. Test for the above fix.
* tests/mv/Makefile.am (TESTS): Add hard-verbose.
2006-09-24 16:55:13 +00:00
Jim Meyering
6649f01059 * tests/help-version (sync_args): Don't call sync, since it spins up
disks that I've deliberately caused to spin down (but not unmounted).
2006-09-24 16:46:41 +00:00
Jim Meyering
200aa48e15 * NEWS: Mention the improvement to sort. 2006-09-24 11:44:16 +00:00
Jim Meyering
867251d725 * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
as well as existing.
2006-09-24 07:29:44 +00:00
Jim Meyering
b4963a7f70 * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
since that predated addition of d_type support.
2006-09-24 07:27:00 +00:00
Jim Meyering
453c215003 * Makefile.am (EXTRA_DIST): Sort file names.
Add bootstrap and gl/modules/getloadavg.diff
2006-09-23 17:00:29 +00:00
Jim Meyering
328efced8b remove trailing blanks 2006-09-23 17:00:08 +00:00
Jim Meyering
7c8dece8c6 * gl/modules/getloadavg.diff: New file. Work around the way the latest
version of the getloadavg module interacts with our bootstrap script.
* bootstrap (gnulib_tool_options): Add "--local-dir gl".
2006-09-23 16:51:53 +00:00
Paul Eggert
5ffeefb1ab * bootstrap: Add support for --force.
(usage): New function.  Describe usage less tersely.
(CVS_only_file): New var.
2006-09-20 21:28:26 +00:00
Paul Eggert
2a01141018 * NEWS: Document fix for cp -i and mv -i.
* src/copy.c (copy_internal): With -i, prompt even if the source
is a directory and the destination is not.  This is required by
POSIX and gives the user a chance to bail out before failing.
* tests/cp/Makefile.am (TESTS): Add cp-i.
* tests/cp/cp-i: New file.
* tests/mv/Makefile.am (TESTS): Add i-5.
* tests/mv/i-5: New file.
2006-09-20 17:32:14 +00:00
Jim Meyering
fae30e1af9 * NEWS: Mention the chmod bug fix. 2006-09-20 13:30:55 +00:00
Jim Meyering
2c83d42320 *** empty log message *** 2006-09-20 12:41:20 +00:00
Jim Meyering
396a52f790 * tests/chmod/inaccessible: New test.
* tests/chmod/Makefile.am (TESTS): Add inaccessible.
2006-09-20 12:38:22 +00:00
Jim Meyering
05ce3b2986 Fix the 2006-09-18 bug differently.
* src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
tell fts_read to stat the file again, in case it has become
accessible since the initial fts_open call.
* src/chown-core.c (change_file_owner): Likewise.
2006-09-20 11:50:46 +00:00
Jim Meyering
1671b056a5 * src/chmod.c: Revert last change. There is a better way.
* src/chown-core.c: Likewise.
2006-09-20 11:26:18 +00:00
Paul Eggert
856443a97d * coreutils.texi (Disk usage): Clarify intro. Problem reported by Van Ly. 2006-09-19 22:39:38 +00:00
Paul Eggert
7889cfbbc7 * src/ln.c (target_directory_operand): Rewrite to avoid porting
problem on Tandem reported by Matthew Woehlke in
<https://savannah.gnu.org/bugs/?17172>.
2006-09-19 22:11:38 +00:00
Paul Eggert
90616d3a8f (cp invocation): Clarify cp -i a bit more. 2006-09-19 21:54:01 +00:00
Paul Eggert
f544d8dd1a * coreutils.texi (cp invocation): Say that -i and -f are
independent.  Clarify -i's behavior.
2006-09-19 16:49:06 +00:00
Paul Eggert
0e3b87195a Fix bug where chmod, chown, and chgrp did not process operands
left-to-right in some cases.
* src/chmod.c (wd_errno): New var.
(chmod_file): New function, with most of the contents of the
old prcess_file function.
(process_files): Use it.  This gives file names to fts one
at a time, so that they are processed left-to-right as POSIX
requires.
* src/chown-core.c (wd_errno, chown_files): Likewise.
(chown_file): New function.
* tests/install/basic-1: Redo test so as to not workaround
the chmod bug, thereby testing for it.
2006-09-18 22:09:49 +00:00
Paul Eggert
bebf83d0fd * src/shuf.c (main): Quote the entire range when reporting an
invalid one, rather than just the part that contained the error.
2006-09-18 20:38:54 +00:00
Paul Eggert
46dd4b1a8e * tests/stty/row-col-1: Rewrite to avoid temporary file that is
sometimes left behind if the test is skipped or interrupted.
2006-09-18 20:34:50 +00:00
Paul Eggert
058f319e6d * bootstrap (symlink_to_gnulib): New function.
(cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
to copies-of-gnulib.
(cp_mark_as_generated, slurp, gnulib_files):
Avoid making a copy if it's the same as the old version.
(gnulib_files): Add support for this variable (used by Bison).
2006-09-18 20:20:03 +00:00
Paul Eggert
87353aebd8 * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
indicating flaw in kernel.  Reword to say that the flaw isn't
serious for coreutils, since the flaw does affect ls -i.
2006-09-18 16:34:27 +00:00
Paul Eggert
5a73ad8c63 Fix bug in test case exposed by building on
Solaris 8 in a setgid directory.  The test case incorrectly
assumed that 'symlink' would be in group $g1.
2006-09-18 16:11:00 +00:00
Jim Meyering
c9c0dc7bc6 * NEWS: Add a line for 6.3-cvs.
* configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
2006-09-18 13:01:09 +00:00
Jim Meyering
9c57927ad1 . 2006-09-18 08:09:54 +00:00
Jim Meyering
8cd9d29cfe duh 2006-09-18 07:51:48 +00:00
Jim Meyering
97f9240eaa *** empty log message *** 2006-09-18 07:51:33 +00:00
Jim Meyering
500fdd0af9 *** empty log message *** 2006-09-18 07:51:07 +00:00
Jim Meyering
7da3ac75c2 Version 6.2.
* NEWS: Record the 6.2 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-09-18 05:58:55 +00:00
Jim Meyering
db2e7255ab * tests/chgrp/basic: On an OpenBSD system, rather than failing
due to a known problem, merely warn about it.
Rewrite to avoid testing output of chgrp --verbose and chgrp -c.
Instead, use stat to test file system for desired results, directly.
* tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet.
2006-09-17 20:58:34 +00:00
Jim Meyering
1c904f14ea * tests/envvar-check: Add more variable names to the list of those
that can affect these programs and tests: _POSIX2_VERSION, COLUMNS,
QUOTING_STYLE, TABSIZE, TERM, TMPDIR.
2006-09-17 20:29:05 +00:00
Jim Meyering
1fd966436a . 2006-09-17 20:15:52 +00:00
Paul Eggert
b67faf329c * NEWS: Document that mkdir -p and install -d now fork on occasion.
* bootstrap.conf (gnulib_modules): Add savewd.
* src/install.c: Include savewd.h.
(process_dir): New function.
(main, install_file_in_file_parents): Use it, along with the new
savewd module, to avoid some race conditions.
* src/mkdir.c: Include savewd.h.
(struct mkdir_options): New members make_ancestor_function, mode,
mode_bits.
(make_ancestor): Return 1 if the resulting directory is not readable.
(process_dir): New function.
(main): Use it, along with new savewd module, to avoid some
race conditions.  Fill in new slots of struct mkdir_options, so
that callees get the values.
* tests/install/basic-1: Test for coreutils 5.97 bug that was
fixed in coreutils 6.0, and which should still be fixed with
this change.
* tests/mkdir/p-3: Likewise.
2006-09-16 20:03:56 +00:00
Jim Meyering
adbad7626c * Makefile.maint (sc_require_config_h, sc_prohibit_assert_without_use):
Discard stdout from the new use of grep.
2006-09-16 08:44:18 +00:00
Jim Meyering
f944211020 * bootstrap.conf (gnulib_modules): Add rename-dest-slash.
The 2006-09-08 changes made it so "mv dir new-name/" would
fail on NetBSD 1.6.  This makes it work once again.
2006-09-15 14:11:39 +00:00
Jim Meyering
32d83cf587 * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n.
Instead, since it's a little fragile, assert the condition.
(target_directory_operand): Update comment to reflect latest change.
2006-09-14 10:06:42 +00:00
Paul Eggert
33f1b50fca (print_user): Rewrite to avoid warning from GCC 4.1.1 with -Wall. 2006-09-12 23:32:16 +00:00
Jim Meyering
e1fb2a80bb * tests/mv/atomic: Check for specific strace output, rather than
simply nonempty.  RHEL AS 4 would fail this test due to strace
generating "[ Process PID=14434 runs in 32 bit mode. ]".
Reported by Nelson Beebe.
2006-09-12 09:33:40 +00:00
Jim Meyering
fb15bc880a * src/c99-to-c89.diff: Add another set of curly braces. 2006-09-11 13:56:15 +00:00
Jim Meyering
75b99e8f20 * src/remove.c (remove_dir): Move new cache_stat_init call onto
it's own line.
(rm_1): Move declaration of "st" and new cache_stat_init call
"down" to nearer where they're used.
2006-09-11 13:22:04 +00:00
Paul Eggert
d28b0d4de8 (eval6): Fix buffer overrun, or bad performance, if
substr's last operand is very large.  Performance problem reported
by Sebastian Kreft.
2006-09-11 04:56:43 +00:00
Jim Meyering
6f2530cf3a * Makefile.maint (sc_prohibit_assert_without_use): Likewise. 2006-09-09 16:18:57 +00:00
Jim Meyering
77d7a11b2f * Makefile.maint (sc_require_config_h): Skip this test if there are no version-
controlled .c files.
2006-09-09 15:58:36 +00:00
Jim Meyering
5feb482bc3 . 2006-09-09 15:32:03 +00:00
Jim Meyering
1e7e9cd16e restore leading "@" 2006-09-09 14:59:37 +00:00
Jim Meyering
cc29b366aa * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there
are no .m4 files.
2006-09-09 14:59:11 +00:00
Jim Meyering
262296271d * bootstrap: Export CVS_RSH separate from its assignment, to work
even with Solaris 10's /bin/sh.  Suggestion from Mark D. Baushke.
2006-09-08 19:28:46 +00:00
Paul Eggert
5c81574ed5 tail now ignores the -f option if POSIXLY_CORRECT is set,
no file operand is given, and standard input is any FIFO.
2006-09-08 17:19:51 +00:00
Jim Meyering
d7619b5fe8 mv and "cp -r" no longer fail when invoked with two arguments
where the first one names a directory and the second name ends in
a slash and doesn't exist.  E.g., "mv dir B/", for nonexistent B,
now succeeds, once more. This reverts part of the 2004-06-27
change for 5.3.0.
* NEWS: Say the above.
* src/mv.c (target_directory_operand): Don't require (here)
that the target operand "look like" a directory.  This change
pushes the test down to the rename syscall level, where a
"mv dir existing-non-dir/" will mistakenly succeed on older systems
that ignore trailing slashes in the rename destination argument.
* src/cp.c (target_directory_operand): Likewise, but for cp.
* tests/mv/trailing-slash: Exercise the above fixes.
* tests/cp/trailing-slash: New file.
* tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
2006-09-08 17:08:53 +00:00
Jim Meyering
fc1e25cfa5 * bootstrap: Use the previously unused variable, $src,
to avoid repeating "$GNULIB_SRCDIR/$file".
2006-09-08 08:59:31 +00:00
Jim Meyering
926e64e021 * bootstrap (cp_mark_as_generated): Don't use "local", to
accommodate ancient "/bin/sh".  Suggested by Ralf Wildenhues.
Rename now-global "$src" and "$dst" to have cp_ prefix.
Safer, and avoids confusion.
2006-09-08 08:57:45 +00:00
Jim Meyering
c4e65d56c1 * bootstrap: Fix last-minute typo. 2006-09-08 08:01:17 +00:00
Jim Meyering
80799ead41 * bootstrap (cp_mark_as_generated): Don't add C-style comments for .l or .y files. 2006-09-08 07:57:21 +00:00
Jim Meyering
af2c5a4ab0 * bootstrap (cp_mark_as_generated): New function.
(slurp): Use it to prepend editor hints and a warning that
the file we're copying is generated.
Suggestion from Bruce Korb.
2006-09-08 06:52:24 +00:00
Jim Meyering
a3ebb3f3d1 * bootstrap: Revert last change. There are less disruptive ways
to mark these generated files as read-only.
2006-09-07 21:00:58 +00:00
Jim Meyering
0212b962b4 * src/c99-to-c89.diff: Update to have proper offsets. 2006-09-07 09:21:00 +00:00
Jim Meyering
36422ec95c Ensure that some gnulib-tool-generated files are read-only.
* bootstrap (slurp): Put the body of this function in a sub-shell,
with "umask a-w" so that all new files are read-only.  Remove each
file before we write to it, in case it's read-only.
Make po/Makevars and runtime-po/Makevars read-only, too.
2006-09-06 22:00:15 +00:00
Jim Meyering
ef2071bc67 * tests/cp/acl: Skip this test when cp lacks ACL support.
* tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER).
2006-09-05 11:50:56 +00:00
Jim Meyering
fe99a4f8c8 * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new
context from change of 2006-09-02.
2006-09-05 11:12:06 +00:00
Jim Meyering
2809bfb8f7 (Infrastructure changes): make wording more accurate 2006-09-04 07:50:16 +00:00
Jim Meyering
ce5b2a6ec4 * README-cvs: Fix typo in update command. 2006-09-04 07:44:56 +00:00
Jim Meyering
5e451b260f * NEWS: Tweak the wording in the new change description so that
no one can think this change causes e.g., `rm -fr foo../' to fail.
2006-09-03 20:16:38 +00:00
Jim Meyering
fbb234c2a7 Use $CONFIG_HEADER, rather than hard-coding it.
* tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER.
2006-09-03 07:22:08 +00:00
Jim Meyering
31ca1f9aec * tests/rm/inaccessible: Adjust for movement of config.h to lib/. 2006-09-03 07:18:52 +00:00
Paul Eggert
ae325b5b97 rm now rejects attempts to remove /, ./, and ../. 2006-09-03 02:56:51 +00:00
Paul Eggert
aff5a4f2ab (Treating / specially): --preserve-root is
now the default for rm.
(rm invocation): Likewise.  Also, document that you can't
remove `.' or `..'.  Use the POSIX term "root directory"
rather than the more-ambiguous "file system root".
2006-09-03 02:56:34 +00:00
Paul Eggert
0b5f3463b3 New file. 2006-09-03 02:55:32 +00:00
Paul Eggert
b438e7548e (TESTS): Add r-4. 2006-09-03 02:55:20 +00:00
Paul Eggert
e5fc4f24aa Don't include dirname.h, since system.h does it now.
(cache_fstatat, cache_stat_init): New functions.
(cache_statted, cache_stat_ok): New functions.
(write_protected_non_symlink): Remove struct stat ** buf_p arg,
which is no longer needed with the new functions.  All callers
changed.
(prompt, is_dir_lstat, remove_entry, remove_dir):
New struct stat * arg.  All callers changed.
(write_protected_non_symlink, prompt, is_dir_lstat, remove_entry):
(remove_cwd_entries, remove_dir, rm_1):
Use and maintain the file status cache.
(prompt, remove_entry): Omit the first "directory" in the diagnostic
"Cannot remove directory `foo': is a directory".  This causes "rm"
to pass a test case that it would otherwise fail now that it
"knows" more about its argument.  I think the diagnostic is better
without the first "directory" anyway.
(prompt): Remove the no-longer-needed IS_DIR arg; all callers changed.
(rm_1): Reject attempts to remove /, ./, or ../.
2006-09-03 02:54:51 +00:00
Paul Eggert
fcf498b1b4 Fix comment. 2006-09-03 02:54:16 +00:00
Paul Eggert
89ffaa1990 Don't include dirname.h, since system.h does it now.
(usage, main): --preserve-root is now the default.
2006-09-03 02:53:58 +00:00
Paul Eggert
963d29f916 Include "dirname.h", since dot_or_dotdot needs it
now.
(dot_or_dotdot): Succeed even if "." or ".." is followed by a
slash.
2006-09-03 02:53:37 +00:00
Paul Eggert
d8049d7478 Don't include dirname.h, since system.h does it now. 2006-09-03 02:53:16 +00:00
Paul Eggert
b539762854 rm now rejects attempts to remove /, ./, and ../. 2006-09-03 02:50:41 +00:00
Paul Eggert
670a4672c9 Fix typo in previous change; an unsigned int wasn't converted to
uintmax_t at the right time.  Problem reported by Bruno.
2006-09-01 22:07:18 +00:00
Paul Eggert
8251826ef0 Update to match current gnulib. 2006-09-01 19:44:43 +00:00
Paul Eggert
93c30a24c4 * m4/jm-macros.m4 (gl_MACROS): Call cu_PREREQ_STAT_PROG rather
than AC_REQUIREing, so that sys/mount.h isn't tested for after
the test result.  I'm not sure why this fix is needed, but it
works.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Revamp to reflect better
what stat.c actually needs.
* src/stat.c: Include <stddef.h>
(alignof): New macro.
(HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL):
Remove.
(STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro.
(FSID_VAL): Remove.
(print_statfs): If f_fsid isn't an integer, grab its words one
at a time in little-endian order.  This is a bit easier to configure
and should avoid a compilation failure on MacOS reported by Bruno
Haible.
2006-09-01 19:40:46 +00:00
Paul Eggert
ddb97ab3b1 * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
work around a Mac OS X porting problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
(print_statfs): Use them.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Check for __val versus val
components of fsid.  Omit some checks that stat.c doesn't care about.
2006-08-29 21:53:29 +00:00
Paul Eggert
bc7aa2329c * bootstrap.conf (gnulib_modules): Add isapipe.
* src/tail.c: Include isapipe.h.
(IS_PIPE_LIKE_FILE_TYPE): Remove.
(IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
tailable, since this seems to be portable.
(main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
2006-08-29 20:50:21 +00:00
Paul Eggert
1b6b9ac6ee * src/system.h (LOCALEDIR): Remove, since configmake.h now defines
it for us.
2006-08-29 14:26:52 +00:00
Paul Eggert
1b8c1afd70 (main): Don't test whether macros like
S_ISLNK are defined, since they're always defined now.
2006-08-29 00:32:33 +00:00
Paul Eggert
25aebae77d * src/copy.c (copy_internal): Don't test whether macros like
S_ISLNK are defined, since they're always defined now.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/ls.c (get_link_name, make_link_name): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/who.c (S_IWGRP): Likewise.
2006-08-28 23:29:38 +00:00
Paul Eggert
023c88aaa0 Adjust to recent gnulib changes for the gnulib module.
* bootstrap.conf (gnulib_modules): Add fcntl.
* src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove.  Other code
is already assuming these macros are defined.
(O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK):
(O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT):
Remove; the fcntl module now handles these.
2006-08-28 23:05:13 +00:00
Paul Eggert
a66840f18d Adjust to recent gnulib changes for the inttypes module.
* bootstrap.conf (gnulib_modules): Remove stdint; add inttypes.
(excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4.
* src/system.h: Don't bother to include <stdint.h>, since we can
now assume inttypes.h does the equivalent of including stdint.h.
2006-08-28 20:51:56 +00:00
Jim Meyering
ba663fc190 Use http://, not https:// for savannah.gnu.org bug URLs. 2006-08-27 19:59:15 +00:00
Jim Meyering
e7573e15d9 * NEWS: Mention this. 2006-08-27 19:46:26 +00:00
Jim Meyering
520a954d7e * src/copy.c (copy_internal): Don't make a backup if the last
component of the source name is "." or "..".
Reported by Andreas Schwab in https://savannah.gnu.org/bugs/?17540.
* tests/cp/src-base-dot: New file.  Test for the above fix.
* tests/cp/Makefile.am (TESTS): Add src-base-dot.
2006-08-27 19:41:04 +00:00
Jim Meyering
0744662509 * src/system.h (DOT_OR_DOTDOT): Remove macro. Rewrite as a...
(dot_or_dotdot): ...new static inline function.
* src/remove.c (rm_1): Reflect this renaming.
* src/ls.c (basename_is_dot_or_dotdot): Likewise.
2006-08-27 19:34:28 +00:00
Jim Meyering
0a94897cfe Two of those comments apply only when "moving" (not when copying).
Correct them.
2006-08-27 16:29:11 +00:00
Jim Meyering
7f535c46a6 * src/copy.c (copy_internal): Add comments. 2006-08-27 16:20:52 +00:00
Paul Eggert
ddf6238830 (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib,
since Automake supplies them for us.  It always did -I$(srcdir),
and with the recent change to AC_CONFIG_HEADERS in configure.ac it
is now also doing -I../lib.
2006-08-27 06:03:02 +00:00
Paul Eggert
bc94006bd5 Fix typo in previous bootstrap change; WGET_COMMAND is needed by sh. 2006-08-27 03:35:09 +00:00
Paul Eggert
be5edb4b0c .cvsignore: Add config-h.m4. 2006-08-27 03:34:42 +00:00
Jim Meyering
e9bf9a6ecc This test was failing in some environments.
* tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`"
to set LS_COLORS in the environment.
* tests/envvar-check: Instead, ensure that LS_COLORS is not set.
Reported by Bob Proulx.
2006-08-26 18:44:52 +00:00
Paul Eggert
2ace7e1eee * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
Fail if the first "echo" fails.  Suppress diagnostics from "ls po/*.po"
since there might not be any .po files.
(WGET_COMMAND): Set to empty if wget doesn't
seem to be available.  Don't export; shouldn't be needed.
2006-08-26 18:33:08 +00:00
Jim Meyering
fd52fdf603 * tests/mv/Makefile.am (TESTS): Add backup-dir. 2006-08-26 17:13:49 +00:00
Jim Meyering
96940eb05b * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed. 2006-08-26 16:21:15 +00:00
Jim Meyering
c8e02f478f s/c98/c89/ in file name. 2006-08-26 16:20:59 +00:00
Jim Meyering
7bd66e88ca * Makefile.am (EXTRA_DIST): Remove these files here, too:
.x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use,
.x-sc_two_space_separator_in_usage.
2006-08-26 16:18:04 +00:00
Jim Meyering
146af5fb13 Fix "mv --verbose --backup" so its output includes the
" (backup: foo.~1~)" suffix also when backing up a directory.
* NEWS: Report this bug fix.
* src/copy.c (emit_verbose): New function, factored out of...
(copy_internal): ...here.  Use the new function.
* tests/mv/backup-dir: Test for the above fix.
2006-08-26 15:53:24 +00:00
Paul Eggert
8f8f1d0188 Include <config.h> unconditionally, since we now assume config.h exists. 2006-08-26 06:55:57 +00:00
Jim Meyering
967e0c11ea "ls --color" would highlight other-writable and sticky directories
no differently than regular directories on a file system with
dirent.d_type support.
* NEWS: Say the above.
* src/ls.c (gobble_file): With --color, also stat the file when
we know it is a directory.
Derived from an anonymous one-line fix and bug report:
<https://savannah.gnu.org/bugs/?15043>.
* tests/ls/color-dtype-dir: New file.  Test for the above fix.
* tests/ls/Makefile.am (TESTS): Add color-dtype-dir.
2006-08-26 06:46:17 +00:00
Paul Eggert
0d41cd8f29 * .cvsignore: Remove stamp-h1. Add coreutils-*, to ignore
tarballs.
* bootstrap.conf: Add configmake, verify.
* lib/.cvsignore: Add configmake.h, stamp-h1.
* src/.cvsignore: Remove localedir.h.
* src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove;
subsumed by configmake.
* src/system.h: Include configmake.h rather than localedir.h
(LOCALEDIR): New macro.
2006-08-25 23:30:57 +00:00
Paul Eggert
1a5c74f01a Fix typo in previous checkin; a "&" went missing. 2006-08-25 23:12:01 +00:00
Paul Eggert
db3f6c256b Rewrite to avoid some unnecessary casts, macros, literals.
(DEFAULT_PASSES, VERBOSE_UPDATE): Now constants, not macros.
(SECTOR_SIZE, SECTOR_MASK): New constants.
(fillpattern, dopass, do_wipefd, main): Remove unnecessary casts,
and use the SECTOR_* constants when applicable.  Check for size <
0 rather than size == -1, since negative-size files are a sign of
trouble anyway.

(dopass): Assume a continuable error if EIO even if the current
position is not a multiple of 512.
2006-08-25 23:08:58 +00:00
Jim Meyering
03a5310540 * src/stat.c (print_statfs): Fix typo: remove extra "sizeof". 2006-08-24 21:47:37 +00:00
Paul Eggert
69fdccfb29 * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define. This
macro was being used without being defined.
(SB_F_NAMEMAX): Remove cast.
(f_fsid) [BeOS]: Likewise.
(OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning.
All uses changed.
(out_string, out_int, out_uint, out_uint_o, out_uint_x): New
functions.
(xstrcat): Remove.  All uses changed to use the above functions.
(print_statfs, print_stat): 2nd arg is now the prefix len, not the
buffer len.  All uses changed.  Output '?', not '*', for unknown
data or errors.  Do not assume signed values can be interchanged
with unsigned when printing.
(print_statfs): For %i, print the fsid as a single int, not as a
pair.
(print_it): Quote invalid format better.
(STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]:
(f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]:
(STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
2006-08-23 23:40:21 +00:00
Paul Eggert
882c0d8d35 * NEWS: printf supports the I flag.
* src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
2006-08-23 23:38:27 +00:00
Paul Eggert
5f61923564 (SA_RESTART): Fallback define. 2006-08-23 19:19:01 +00:00
Paul Eggert
f5017cb0f6 * src/system.h (EDQUOT): Define if not already defined. 2006-08-23 19:14:25 +00:00
Paul Eggert
7b1ba27c95 * .cvsignore: Remove config.h, config.hin, as they are now
in lib.
* configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin
to lib.
* lib/.cvsignore: Add config.h, config.hin.
* lib/Makefile.am (AM_CPPFLAGS): Remove; we no longer need '-I..'.
* src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed.
2006-08-23 18:37:27 +00:00
Paul Eggert
2f1ed196eb No need to define gl_LOCK. 2006-08-23 18:09:40 +00:00
Paul Eggert
81a3cd6df6 * bootstrap (slurp): Also put in a dummy definition for
gl_LOCK_EARLY, introduced recently into gnulib.
2006-08-23 18:06:48 +00:00
Paul Eggert
d75da2a555 Add gnupload. 2006-08-23 17:08:09 +00:00
Jim Meyering
2594cd456d * NEWS: Mention the sweeping infrastructure changes. 2006-08-23 09:17:14 +00:00
Paul Eggert
0b38c6af07 * bootstrap.conf (gnulib_modules): Add gnupload.
* Makefile.maint (emit_upload_commands): gnupload is now
in build-aux.
* gnupload: Remove from CVS, since it's now a gnulib module.
2006-08-22 19:36:22 +00:00
Paul Eggert
0d35f28695 * bootstrap (bootstrap_conf_cleanup): Remove.
(excluded_files): New var.
* bootstrap.conf: Likewise.
* bootstrap (slurp): Exclude files early if they're in the
excluded_files list.  That way, their names don't get put into
.cvsignore.
2006-08-22 19:19:57 +00:00
Paul Eggert
711f81145e Add aclocal.m4, config.hin, configure to .cvsignore. 2006-08-22 18:59:02 +00:00
Paul Eggert
6d124bf98a * aclocal.m4, config.hin, configure:
Remove from CVS, since ./bootstrap generates them automatically.
* .cvsignore: Add INSTALL, Makefile.in, *.cache, *.lineno, *.log.
Remove more-specific entries.  This catches files like configure.lineno.
* man/.cvsignore: Add Makefile.in.
* src/.cvsignore: Add Makefile.in.
Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.

For .cvsignore file under the tests directory:
Add Makefile.in.  Sort entries if necessary.  Remove *.I, *.E,
*.X, *.O, *-tests, build-script, mk-script if they're never
created in this directory.

* build-aux/.cvsignore: New file.
* doc/.cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf,
coreutils.ps, coreutils.tps.  Remove coreutils.cm (dunno what it
is, but the makefile doesn't mention it).  Remove coreutils.info
as it is subsumed by coreutils.info*.
* lib/.cvsignore: Add Makefile.in, getdate.tab.h.
Remove stat.c, sysexit.h.
* m4/.cvsignore: Remove Makefile, dev-ino.m4, glibc2.m4, intdiv0.m4,
inttypes-h.m4, inttypes-pri.m4, jm-glibc-io.m4, lcmessage.m4,
lock.m4, printf-posix.m4, same-inode.m4, size_max.m4,
uintmax_t.m4, ulonglong.m4, visibility.m4, xsize.m4.  Many of
these are put in automatically by ../bootstrap, but that's a
bootstrap bug that I plan to fix shortly.
* po/.cvsignore: More ../bootstrap-related fixes, plus remove old
cruft.  Add *.po, LINGUAS, Makevars.  Remove *.cat, *.msg,
cat-id-dbl.c, messages.mo, stamp-cat-id.
2006-08-22 18:50:24 +00:00
Paul Eggert
cafb7947b5 BeOS portability.
* src/uptime.c: Include OS.h if it exists.
(print_uptime): On BeOS, use the get_system_info function (actually a
macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
(uptime): Call read_utmp only if utmp.h or utmpx.h exists.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Test also for utmp.h, utmpx.h,
OS.h. Don't require to have utmp.h or utmpx.h. Enable boottime
support if <OS.h> is found.
2006-08-22 17:42:21 +00:00
Jim Meyering
0797e95b8a * .cvsignore: Add files that are now generated by ../bootstrap. 2006-08-22 11:01:23 +00:00
Jim Meyering
112606d80f [ChangeLog]
* .cvsignore: Add ABOUT-NLS.
[lib/ChangeLog]
* .cvsignore: Add files that are now generated by ../bootstrap.
[m4/ChangeLog]
* .cvsignore: Add files that are now generated by ../bootstrap.
[po/ChangeLog]
* .cvsignore: Add files that are now generated by ../bootstrap.
2006-08-22 10:44:40 +00:00
Jim Meyering
cf7d6fe7bf Move the check-AUTHORS rule to be run as part of "make distcheck",
rather than "make check".
* src/Makefile.am (check): Don't depend on check-AUTHORS; it would
cause "make check" to fail on systems unable to build all binaries.
* Makefile.maint (check-AUTHORS): New rule.
(local-checks-available): Add it here.
Reported by Bruno Haible.  Needed for BeOS.
2006-08-22 10:13:37 +00:00
Paul Eggert
86e1642541 (LDADD): Restore this line; it is still needed for
t-fpending on platforms without __fpending.
2006-08-22 07:00:51 +00:00
Paul Eggert
56795d3ea4 Remove df -mP. 2006-08-22 04:00:01 +00:00
Paul Eggert
e2e9b7d2ee (print_header, show_dev): Use a column width that
depends on the block size of -P is specified and not autoscaling.
2006-08-22 03:59:14 +00:00
Paul Eggert
3413a41528 Remove argmatch.m4 from CVS, since ../bootstrap generates it automatically. 2006-08-21 22:09:48 +00:00
Jim Meyering
1d6853a7bc * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic
when the shell variable, SHELL, is not set.
Trigger the failure with "(unset SHELL; make check TESTS=simple)".
Reported by Sven Joachim in <http://bugs.debian.org/355368>.
2006-08-21 17:28:09 +00:00
Jim Meyering
76407d035c * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined
in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT.
Otherwise, on a system with 4-byte longs, "od -t u8" fails with this:
od: invalid type string `u8';
this system doesn't provide a 8-byte integral type
FIXME: add a test for this, but skip it when sizeof uintmax < 8.
2006-08-21 13:54:04 +00:00
Jim Meyering
71e3d8bbf6 Done: convert to use gnulib-tool 2006-08-21 08:11:55 +00:00
Paul Eggert
05e03fc656 Add a bootstrap procedure, so that the CVS version contains fewer
files and we bootstrap the rest from gnulib, gettext, etc.
* README-cvs: New file.
* bootstrap: New file.
* bootstrap.conf: New file.
* .x-sc_trailing_blank: Remove config-log, .gdb-history.  Add .po.
* configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
of gnulib-tool.
(gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
(gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
(gl_EARLY): Add.
(gl_MACROS): Call just after gl_EARLY, just for clarity.
* src/c99-to-c98.diff: Remove patch to ls.c; no longer needed.
* src/kill.c (strtoimax): Remove decl.
* src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
* src/wc.c: Likewise.
* src/ls.c (sort_files): Rewrite to avoid need for C99-style
declaration, so that we don't need to patch this file.
* src/printf.c (strtoimax, strtoumax): Remove decls.
* src/su.c: Include getpass.h.
(getpass): remove.
* src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
Include inttypes.h unconditionally; remove decls it handles.
* lib/Makefile.am: include gnulib.mk, so that we can remove most of
this file.
(AM_CPPFLAGS): Don't mention -I$(srcdir), since that's now done
for us.
(noinst_LIBRARIES, LDDADD, DEFS): Remove.
(libcoreutils_a_SOURCES): Trim down greatly, just to the files
that aren't in gnulib.
Remove defns gnulib does for us.
* m4/check-decl.m4 (gl_CHECK_DECLS):
Don't include stdio.h, string.h, stdlib.h, unistd.h, sys/time.h,
time.h.  Use AC_CHECK_DECLS_ONCE for free, getenv, geteuid, getlogin,
getuid, lseek, malloc, memchr, realloc.  Don't check for getutent,
memrchr, nanosleep, stpcpy, strndup, strnlen, strstr, strtoul,
strtoull.
(_gl_DECL_HEADERS): Remove; all uses removed.
* m4/jm-macros.m4 (gl_MACROS): Move AC_PREREQ into configure.ac
for the benefit of gnulib-tool.  Call gl_INIT.
Do not call or require macros that gnulib will handle for us.
Don't check for fchmod, hasmntopt, isascii, lchown, listmntent,
mempcpy, realpath, wcrtomb, tzset.
(gl_CHECK_ALL_HEADERS): Don't check for sys/statvfs.h, sys/vfs.h,
sys/mount.h.
(gl_CHECK_ALL_TYPES): Require AC_TYPE_UNSIGNED_LONG_LONG_INT.
Don't check for struct stat.st_blksize.
Don't require AC_STRUCT_ST_DM_MODE, gt_TYPE_SSIZE_T,
gl_AC_TYPE_UINT32_T, gl_AC_TYPE_UINTMAX_T, gl_AC_TYPE_UINTPTR_T,
gl_AC_TYPE_UNSIGNED_LONG_LONG.
* m4/prereq.m4 (gl_PREREQ): Require gl_FUNC_XFTS, gl_ROOT_DEV_INO.
Don't require macros that gnulib does for us.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Don't check for
sys/sysmacros.h.  Don't check for statvfs.  Use AC_CHECK_HEADERS_ONCE
for netinet/in.h, nfs/nfs_clnt.h, nfs/vfs.h.
Don't require gl_AC_TYPE_LONG_LONG, gt_HEADER_INTTYPES_H.
2006-08-21 07:30:45 +00:00
Paul Eggert
0f7a044109 Remove from CVS, since the bootstrap script generates them automatically. 2006-08-21 07:26:38 +00:00
Jim Meyering
11fd62b008 add -cvs suffix 2006-08-20 15:53:11 +00:00
Paul Eggert
b57f08306e the patch from 2006-08-18 broke on cygwin. 2006-08-20 15:17:27 +00:00
Jim Meyering
1227e8c08b * NEWS: Add a line for 6.2-cvs.
* configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix.
2006-08-20 14:23:38 +00:00
Jim Meyering
e74a18b16d . 2006-08-19 21:03:14 +00:00
Jim Meyering
73496017cc . 2006-08-19 20:49:45 +00:00
Jim Meyering
befcbddff1 * tests/Makefile.am (EXTRA_DIST): Add sparse-file. 2006-08-19 20:34:57 +00:00
Jim Meyering
e71ebc5213 . 2006-08-19 20:34:31 +00:00
Jim Meyering
c65dbcbc14 . 2006-08-19 20:17:21 +00:00
Jim Meyering
0785c007d1 remove trailing blanks, again 2006-08-19 19:36:44 +00:00
Jim Meyering
929910e100 remove -cvs suffix, too 2006-08-19 19:35:28 +00:00
Jim Meyering
03ffc923e9 . 2006-08-19 19:34:16 +00:00
Paul Eggert
0cb751080f Import from Translation Project, with obvious corrections for plural forms. 2006-08-19 19:00:41 +00:00
Jim Meyering
7b88d1ba67 * Version 6.1.
* NEWS: Record the 6.1 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-08-19 18:33:50 +00:00
Jim Meyering
77c8f5b5c2 Avoid test failure when `make check' is run through debuild.
* tests/help-version: Ensure that $SHELL is set to some value
and exported.  Patch from Sven Joachim.  For details, see
<http://bugs.debian.org/355368>.
2006-08-19 18:30:04 +00:00
Jim Meyering
6a15128cef *** empty log message *** 2006-08-19 17:37:28 +00:00
Jim Meyering
674311d6d7 * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix. 2006-08-19 17:19:12 +00:00
Jim Meyering
0bcaab0b0d Change FIXME comment to fwd ref. 2006-08-19 17:17:49 +00:00
Jim Meyering
5dd3168eed Capitalize the P in Pre-C99. 2006-08-19 16:52:41 +00:00
Jim Meyering
a075864c29 * README: Describe potential "pre-C99 build failure", and work-around. 2006-08-19 16:23:17 +00:00
Jim Meyering
9b3bb934bc Some of my 2006-07-03 changes to tests/*/Makefile.am were being
backed out due to updates provoked by the copyright changes.
* tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that
it propagates to the derived Makefile.am files.
($(srcdir)/Makefile.am): Mark generated .am files as read-only,
so we don't mistakenly edit them again.
* tests/cut/Makefile.am: Regenerate.
* tests/head/Makefile.am: Likewise.
* tests/join/Makefile.am: Likewise.
* tests/pr/Makefile.am: Likewise.
* tests/sort/Makefile.am: Likewise.
* tests/tac/Makefile.am: Likewise.
* tests/tail/Makefile.am: Likewise.
* tests/test/Makefile.am: Likewise.
* tests/tr/Makefile.am: Likewise.
* tests/uniq/Makefile.am: Likewise.
* tests/wc/Makefile.am: Likewise.
2006-08-19 16:02:11 +00:00
Jim Meyering
b35bd50ce6 * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even
when the file's apparent size is not a multiple of its block size.
* src/copy.c (copy_reg): Don't write a NUL before calling ftruncate.
For some file sizes, writing that single byte would unnecessarily
waste a few file blocks.  That write may have been necessary in the
early days of Linux, but now, removing it should be safe.
Based on a patch by Alan Curry: <http://bugs.debian.org/370792>
* tests/cp/sparse: New test for the above.
* tests/cp/Makefile.am (TESTS): Add sparse.

* tests/sparse-file: New file, essence factored out of...
* tests/du/8gb: ... here.  Use the new script.
2006-08-19 14:01:29 +00:00
Paul Eggert
5f57935678 Add support for NetBSD 3.0.
* src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field
f_fstypename.
(STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs'
has a field f_fstypename.
This undoes the 2006-08-15 to src/stat.c.
* lib/mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
(ME_DUMMY): Treat "kernfs" as a dummy.
(read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Also check for
sys/statvfs.h. When getmntinfo was found, check its declaration and
set either MOUNTED_GETMNTINFO or MOUNTED_GETMNTINFO2 depending on it.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Test also for f_fstypename
in struct statvfs.
2006-08-18 18:36:04 +00:00
Paul Eggert
47c8512a6f * src/system.h (select_plural): Reduce by 1000000, not 1000, since
the CVS gettext manual now suggests 1000000.
2006-08-18 18:12:47 +00:00
Jim Meyering
16901dd5fb * gethrxtime.m4 (gl_PREREQ_GETHRXTIME): Also check for CLOCK_REALTIME,
since gethrxtime may revert to using clock_gettime via gettime.c.
Gabor Z. Papp reported that gethrxtime-using programs failed to
link due to unresolved clock_gettime on a linux-2.4.x system.
2006-08-18 09:04:12 +00:00
Jim Meyering
1ff9be72d4 back out last patch 2006-08-18 08:24:46 +00:00
Jim Meyering
f0703928e4 * gethrxtime.m4 (gl_PREREQ_GETHRXTIME): Reverse sense of test for
CLOCK_MONOTONIC.  Otherwise, linking a gethrxtime-using program
with $(LIB_GETHRXTIME) could fail due to unresolved clock_gettime.
Reported by Gabor Z. Papp.
2006-08-18 07:34:06 +00:00
Jim Meyering
22d4295325 * Makefile.am (EXTRA_DIST): Reflect doclicense.texi->fdl.texi renaming. 2006-08-17 20:55:32 +00:00
Paul Eggert
5129debc41 Remove; no longer needed. 2006-08-17 20:09:22 +00:00
Paul Eggert
218fa5c61b Add/fix copyright notices and adjust to latest GNU FDL. 2006-08-17 19:58:17 +00:00
Jim Meyering
23f176cae6 ls -CF would misalign columns in some cases.
* src/ls.c (get_type_indicator): New function.  extracted from...
(print_type_indicator): ...here.  Use it.
(length_of_file_name_and_frills): Use it here, too, rather than
assuming stat.st_mode is valid.
Reported by Andreas Schwab, here:
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7774>
FIXME: add a test for this: FYI, I did ls -CF /proc and visually
inspected the result.
2006-08-17 15:46:56 +00:00
Jim Meyering
1b3ac49f0e * src/copy.c (copy_internal, same_file_ok): Adjust comments not
to mention the now-removed cp_options.xstat member.
2006-08-17 15:34:59 +00:00
Jim Meyering
2c84e99ee4 regenerate 2006-08-17 11:49:08 +00:00
Jim Meyering
ef1c94bcd6 (AC_INIT): Bump to 6.1 and add "-cvs" suffix. 2006-08-17 11:47:53 +00:00
Jim Meyering
9aa695174d * Makefile.maint (patch-check): Adapt to work now that the patch
modifies more than one file in src/.
2006-08-17 10:03:05 +00:00
Jim Meyering
a771318b59 With this patch, permit building with Solaris cc on Solaris 7.
* src/c99-to-c89.diff: Add diffs to convert more c99-isms.
This integrates patches from Bruno Haible.
2006-08-17 09:50:24 +00:00
Paul Eggert
9842bf8278 * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
Skip this test if "chmod g+s d" silently does nothing.
2006-08-16 21:58:48 +00:00
Jim Meyering
0142be6908 * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
* tests/cp/acl: Instead, skip the test if either setfacl
or getfacl fails.
2006-08-16 21:53:56 +00:00
Paul Eggert
60d8c89529 Skip this test suite if we can't set up files
properly for the setuid-etc test.
2006-08-16 21:46:36 +00:00
Paul Eggert
aacbc75155 * tests/lang-default (LC_ALL): Set to "C", so we get
English-language diagnostics.  Unset the other variables.
2006-08-16 20:11:42 +00:00
Paul Eggert
b96f5ea492 Fix bugs when printing plurals of numbers that are not
unsigned long int values.
* src/system.h (select_plural): New function.
* src/md5sum.c (digest_check): Use select_plural to avoid bug.
* src/uptime.c (print_uptime): Likewise.
* src/dd.c (print_stats): Likewise.  Also, don't use ngettext to
print a floating point number, as reducing to 0 or 1 doesn't work
for some languages.  Instead, just use "s" for seconds since it
doesn't need a plural form.
2006-08-16 19:36:46 +00:00
Paul Eggert
f048f049e7 (memcoll): Set errno = 0 in the shortcut case, too. 2006-08-16 17:24:35 +00:00
Jim Meyering
061a90d68a * fts.c (fts_children): Remove obsolete "// FIXME ..." comment.
Reported by Bruno Haible.
2006-08-16 13:45:27 +00:00
Jim Meyering
72d1188040 Explain why gzip --help's stderr output matters. 2006-08-16 12:55:18 +00:00
Jim Meyering
1e77e830cc 2006-08-16 Bruno Haible <bruno@clisp.org>
* Makefile.maint (gzip_rsyncable): Throw away stderr output of "gzip --help".
2006-08-16 12:37:34 +00:00
Jim Meyering
a8914bd966 2006-08-16 Andreas Schwab <schwab@suse.de>
* tests/cp/acl: Don't use non-portable == operator for test.
2006-08-16 10:00:07 +00:00
Jim Meyering
734afd5f62 *** empty log message *** 2006-08-16 09:55:48 +00:00
Jim Meyering
481113d551 * tests/ls/stat-dtype: Use stat to test file system type, rather
than df -T, in case /etc/mtab lies.  Reported by Michael Stone.
2006-08-16 09:44:55 +00:00
Jim Meyering
4ce3538865 add URL for HU-translation problem report 2006-08-16 06:06:23 +00:00
Jim Meyering
93d6fb1488 *** empty log message *** 2006-08-16 06:05:20 +00:00
Paul Eggert
9e2b97bf35 * NEWS: Mention that df exits with nonzero status if it generates
no output.  This change was in 6.0 but inadvertently unmentioned.
* doc/coreutils.texi (df invocation): df exits nonzero if it outpus
nothing.
* src/df.c (file_systems_processed): Renamed from n_valid_args, and now
a boolean.
(show_dev): Don't set it until we actually output something.
Print the header if this is the first output.
(main): Don't print a header, as that is now show_dev's job.
* tests/misc/Makefile.am (TESTS): Add df.
* tests/misc/df: New file.
2006-08-15 23:41:24 +00:00
Paul Eggert
5ce0b45a43 (USE_STATVFS): Define to 0 if f_type is needed, but
statvfs.f_type not present.
2006-08-15 23:23:28 +00:00
Paul Eggert
7b0f6f1559 * src/dd.c (print_stats): Don't substitute "1" for number, as this
causes confusion for the Hungarian translators.  Problem reported
by Egmont Koblinger.
2006-08-15 20:50:22 +00:00
Jim Meyering
2ee444b5fe [./]
* .x-sc_require_config_h: Add lib/at-func.c.
[lib/]
* at-func.c: New file, with the logic of all emulated at-functions.
* openat-priv.h: Include <errno.h> and define ENOSYS,
in support of the EXPECTED_ERRNO macro.
* openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
Instead, define the appropriate symbols and include "at-func.c".
* mkdirat.c (mkdirat): Likewise.
* fchmodat.c (fchmodat): Likewise.
(ENOSYS): Remove definition.
* openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
Don't include "unistd--.h" -- it wasn't ever used.
[m4/]
* openat.m4 (gl_FUNC_OPENAT): Add at-func.c via AC_LIBSOURCES.
2006-08-15 19:17:30 +00:00
Jim Meyering
d8139747b1 * NEWS: Add a line for 6.1-cvs.
* configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix.
2006-08-15 17:00:00 +00:00
Jim Meyering
0ae904e03d . 2006-08-15 12:30:26 +00:00
Jim Meyering
2df18658dc * Makefile.maint (alpha beta major): Fix syntax error. 2006-08-15 12:13:04 +00:00
Jim Meyering
22ce855eb6 *** empty log message *** 2006-08-15 12:06:10 +00:00
Jim Meyering
e5b0d0aa85 . 2006-08-15 12:05:34 +00:00
Jim Meyering
3b3a4c3b20 Don't mention "stable" on Version line. 2006-08-15 11:26:17 +00:00
Jim Meyering
a23eb4a58c tweak syntax of "Version ..." line. 2006-08-15 11:25:13 +00:00
Jim Meyering
987f3b383a * TODO: Add an item (convert to use gnulib-tool), add to the plan
for id-vs-getgrouplist, and remove a few completed items.
2006-08-15 11:23:44 +00:00
Jim Meyering
3a246cc314 * Version 6.0 [unstable].
* NEWS: Record the 6.0 release date.
* configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2006-08-15 11:12:07 +00:00
Jim Meyering
a0fcf62767 commit, for the record. May never be used. 2006-08-15 11:08:03 +00:00
Jim Meyering
5ad9cd982c do not set $path
Use --leak-check=full, not --quiet.
Emit "--" after $vg.
2006-08-15 11:05:50 +00:00
Jim Meyering
1289d06809 update from gnulib 2006-08-15 09:14:36 +00:00
Paul Eggert
1a00d99c2f (memcoll): Optimize for the common case where the
arguments are bytewise equal.
2006-08-14 16:20:49 +00:00
Jim Meyering
418a7c8c43 * src/shred.c (usage): Don't indent the second line of an item.
Otherwise, help2man would misformat the output.
Reported by Adam Buchbinder in <https://launchpad.net/bugs/48917>.
2006-08-13 21:21:52 +00:00
Paul Eggert
3244e9a493 * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
2006-08-11 20:28:42 +00:00
Paul Eggert
80886a8db3 (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros. 2006-08-11 18:40:41 +00:00
Paul Eggert
ba79117e35 (re_string_skip_chars): Don't assume WEOF fits in wchar_t. 2006-08-11 18:29:06 +00:00
Paul Eggert
0154d1876b Fix typo in previous checkin: len -> lenbuf. 2006-08-11 17:47:40 +00:00
Paul Eggert
78bc0d8366 (snprintf): memcpy LEN bytes, not SIZE - 1, when
LEN is smaller than SIZE.  Suggested by Bruno Haible.
Also, help the compiler to keep LEN in a register.
2006-08-11 17:41:11 +00:00
Jim Meyering
9236b6befc * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the
failure that this test checks for (stat/dirent inode mismatch at
a mount point), so continue to give a diagnostic about the failure,
but don't actually count it as a failure.
2006-08-11 08:40:11 +00:00
Paul Eggert
cfbf64e087 Undo latest change; I was confused about gettext versus gcc. 2006-08-10 22:53:24 +00:00
Paul Eggert
16d5b9133a Undo latest change; I was confused about xgettext versus gcc. 2006-08-10 22:52:57 +00:00
Paul Eggert
c84d9ff0d1 Adjust some files for gettext 0.15. 2006-08-10 22:51:06 +00:00
Paul Eggert
9d302e0729 Import from gettext 0.15. 2006-08-10 22:50:40 +00:00
Paul Eggert
fa2b1fe3bc (XGETTEXT_OPTIONS): Add pass-c-format flags for
_ and N_, so that we get format checking even when --enable-nls.
Add c-format flags for error, error_at_line, asprintf, vasprintf,
asnprintf, vasnprintf, wrapf.
(USE_MSGCTXT): New macro.
2006-08-10 22:50:17 +00:00
Paul Eggert
ead8494d04 (my-distcheck): Don't bother with --disable-nls,
as it shouldn't be needed with gettext 0.15.
2006-08-10 22:49:50 +00:00
Paul Eggert
023d6ad752 (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15. 2006-08-10 22:49:26 +00:00
Paul Eggert
8397326569 Import from gettext 0.15 2006-08-10 22:49:06 +00:00
Paul Eggert
f073139b52 (struct control): Remove fastmap member.
(extract_regexp): Allocate fastmap separately, since otherwise
it might move due to a realloc.
2006-08-10 20:53:32 +00:00
Paul Eggert
4a16cc52e0 Import regex changes from libc via gnulib. 2006-08-10 20:49:28 +00:00
Paul Eggert
037836e29f Update cycle-check from gnulib. 2006-08-10 19:26:39 +00:00
Paul Eggert
2869cbffcf Accommodate new getaddrinfo implementation in gnulib.
(gl_PREREQ): Require gl_FUNC_SNPRINTF, gl_GETADDRINFO,
gl_HEADER_ARPA_INET, gl_HEADER_NETINET_IN, gl_HEADER_SYS_SOCKET,
gl_INET_NTOP, gl_TYPE_SOCKEN_T.
2006-08-10 19:10:52 +00:00
Paul Eggert
9afbf11b76 Accommodate new getaddrinfo implementation in gnulib.
(libcoreutils_a_SOURCES): Add inet_ntop.h, snprintf.h.
(MOSTLYCLEANDIRS): New macro.
(BUILT_SOURCES): Add $(ARPA_INET_H), $(SYS_SOCKET_H), $(NETINET_IN_H).
(arpa/inet.h, netinet/in.h, sys/socket.h): New rules.
(MOSTLYCLEANFILES): Add arpa/inet.h, arpa/inet.h-t, netinet/in.h,
netinet/in.h-t, sys/socket.h, sys/socket.h-t.
(EXTRA_DIST): Add socket_.h.
2006-08-10 19:10:26 +00:00
Paul Eggert
ffafcd2998 Import from gnulib, to support new getaddrinfo implementation of gnulib. 2006-08-10 19:09:33 +00:00
Paul Eggert
01dddfef2a Add snprintf.h, socket_.h. 2006-08-10 19:08:58 +00:00
Jim Meyering
db7ffe5582 * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s
reports "Linux".  This avoids a failure on Solaris 10's tmpfs.
Redirect both stdout and stderr of df invocations.
2006-08-10 09:22:33 +00:00
Jim Meyering
6d1d2c0068 * src/dircolors.hin: Add a TERM directive for each of the following:
ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin,
rxvt-cygwin-native, screen.linux, xterm-256color.
Sort the TERM directives.
From Mike Frysinger.
2006-08-10 08:50:37 +00:00
Jim Meyering
407ff38d94 add a comment 2006-08-10 08:25:03 +00:00
Paul Eggert
ade68b234a Regenerate. 2006-08-09 23:46:10 +00:00
Paul Eggert
8c0eb21023 Regenerate. 2006-08-09 23:44:56 +00:00
Paul Eggert
decc2e1f87 Sync from gnulib. 2006-08-09 23:44:30 +00:00
Paul Eggert
93f90065f3 Sync from gnulib. 2006-08-09 23:42:26 +00:00
Paul Eggert
d24265f965 Warn about oflag=append without conv=notrunc. 2006-08-09 21:16:28 +00:00
Paul Eggert
433a1eac7f Add mlterm, rxvt-unicode; this fixes Debian bug 317503. 2006-08-09 20:56:15 +00:00
Paul Eggert
acaeed035b Regenerate. 2006-08-09 20:24:38 +00:00
Paul Eggert
4e9733c2e1 Regenerate. 2006-08-09 20:23:36 +00:00
Paul Eggert
4cf3358407 Add shuf. 2006-08-09 20:23:07 +00:00
Paul Eggert
15c54c0b83 * LINGUAS: Add ro, sr, uk, wa.
* ro.po, sr.po, uk,po, wa.po: New files.
Regenerate other translations.
2006-08-09 20:11:12 +00:00
Paul Eggert
87bfb896c6 Remove the po-update procedure; it doesn't
work with the new repository on http://www.iro.umontreal.ca/.
For now I guess we'll have to fix things by hand.
(do-po-update, po-update): Remove.  All references removed.
2006-08-09 20:06:14 +00:00
Paul Eggert
4ab47a295f Fix too-long line in 2006-08-08 checkin, and an encoding error
in 2006-07-19 checkin.
2006-08-09 20:05:18 +00:00
Paul Eggert
adcb60e9d8 (my-distcheck): Compile with -Wpointer-arith
to detect this sort of problem automatically in the future.
2006-08-09 18:08:06 +00:00
Paul Eggert
b1a2656bdb (next_line): New function.
(read_input): Use it, to avoid relying on GCC-specific behavior
with void * arithmetic.
2006-08-09 18:07:43 +00:00
Jim Meyering
a5e7cc0811 Add a compile-time check to ensure that filetype
and filetype_letter have the same number of elements.
2006-08-09 09:45:17 +00:00
Jim Meyering
ff7f318ae1 Remove use of --seed=S. 2006-08-09 08:24:37 +00:00
Jim Meyering
aa4f6c56c7 Include <config.h>. 2006-08-09 08:13:36 +00:00
Jim Meyering
a402cb33ba Add lib/randread.c, lib/xmemxfrm.c, and src/shuf.c. 2006-08-09 08:12:27 +00:00
Paul Eggert
5e56a8e861 Fix typo in latest changelog entry: restrict.m4 wasn't logged right. 2006-08-08 22:41:15 +00:00
Paul Eggert
dc64059426 Add shuf, better random number generation, and fix sort -R in
funny locales.
2006-08-08 22:28:00 +00:00
Paul Eggert
cd321e4660 Remove, since we no longer need gl_RESTRICT. 2006-08-08 22:26:44 +00:00
Paul Eggert
7c4b2e2a5c Remove; its contents are now in ../lib/rand-isaac.c. 2006-08-08 22:23:11 +00:00
Paul Eggert
73742c2566 New file, introduced for shuf, sort -R, and/or shred. 2006-08-08 22:22:47 +00:00
Paul Eggert
f2f8ea1001 (TESTS): Add shuf. 2006-08-08 22:20:59 +00:00
Paul Eggert
f8abf03c3f Use new random-number interface rather than rand-isaac.c.
Don't include rand-isaac.c; include randint.h and randread.h instead.
(RANDOM_SOURCE_OPTION): New enum.
(long_opts, usage, main): New option --random-source.
Include md5.h, randread.h, xmemxfrm.h.
(longopts, usage, main): Remove undocumented --seed option;
it's now replaced by --random-source.
(rand_state, get_hash): Remove.
(randread_source): New static var.
(random_state, cmp_hashes, compare_random): New functions; they guarantee
no collisions in the random hash function.
(keycompare): Use compare_random for -R; don't fall back on comparing
via memcoll, since compare_random does the right thing.
2006-08-08 22:20:12 +00:00
Paul Eggert
65533e1b09 Use new random-number interface rather than rand-isaac.c.
Don't include rand-isaac.c; include randint.h and randread.h instead.
(RANDOM_SOURCE_OPTION): New enum.
(long_opts, usage, main): New option --random-source.
(struct irand_state, irand_init, irand32, irand_mod): Remove.
All callers changed to use randint interface.
(fillrand): Remove.  All callers changed to use randread interface.
(dopass): Remove dependency on ISAAC buffer size.
(genpattern): Don't wipe the random state here.
(randint_source): New static var.
(clear_random_data): New function.
(main): Allocate random source, and arrange to wipe it on exit.
2006-08-08 22:19:39 +00:00
Paul Eggert
129e7756b9 (bin_PROGRAMS): Add shuf.
(EXTRA_DIST): Remove rand-isaac.c.
(shuf_LDADD): New macro.
2006-08-08 22:19:03 +00:00
Paul Eggert
8cfbf68782 (dist_man_MANS): Add shuf.1.
(shuf.1): New dependency.
2006-08-08 22:18:39 +00:00
Paul Eggert
c678c40671 Add shuf.1. 2006-08-08 22:18:20 +00:00
Paul Eggert
36ed13bc2f (gl_TIME_R): Use AC_C_RESTRICT, not
gl_C_RESTRICT, since we assume recent Autoconf.
2006-08-08 22:17:56 +00:00
Paul Eggert
14f6099f6e (gl_PREREQ_REGEX): Use AC_C_RESTRICT, not gl_C_RESTRICT, since we
assume recent Autoconf.
2006-08-08 22:17:20 +00:00
Paul Eggert
2409478e37 (gl_PREREQ): Require gl_MEMXFRM, gl_RANDINT, gl_RANDPERM,
gl_RANDREAD.
2006-08-08 22:16:51 +00:00
Paul Eggert
a7537e5f07 (gl_PREREQ_GETADDRINFO): Use AC_C_RESTRICT, not
gl_C_RESTRICT, since we assume recent Autoconf.
2006-08-08 22:16:18 +00:00
Paul Eggert
7e5863463c (libcoreutils_a_SOURCES): Add xmemxfrm.c, xmemxfrm.h. 2006-08-08 22:12:21 +00:00
Paul Eggert
0d98074403 (shuf invocation, Random sources): New sections.
(Operating on sorted files): Add shuf.
(sort invocation, shred invocation): New option --random-source.
(sort invocation): Fix typo: -R -> -r.
2006-08-08 22:11:49 +00:00
Paul Eggert
f0992c673c Add shuf. 2006-08-08 22:11:18 +00:00
Paul Eggert
6767712f7e Add shuf. Mention new --random-source option for shred and sort.
Move "sort +1 -2" notice to the appropriate section, and clarify its
role with respect to POSIXLY_CORRECT.
2006-08-08 22:10:39 +00:00
Paul Eggert
d578d8a8be Add shuf. 2006-08-08 22:10:05 +00:00
Paul Eggert
528fe6e504 (set_author): Preserve the st_author field via the
file descriptor dest_desc.
2006-07-29 17:13:28 +00:00
Paul Eggert
aa24517b5f chmod 0755 DIR and chmod 755 DIR are now equivalent. 2006-07-28 07:28:56 +00:00
Paul Eggert
6eb119a91e chmod now preserves setuid and setgid bits on directories
if you use a numeric mode with them clear, e.g., "chmod 755 DIR".
2006-07-28 07:27:56 +00:00
Paul Eggert
e7583d05d3 Clear setuid and setuid bits on directory, in case the build
directory has them set and they're inherited.
2006-07-28 07:27:20 +00:00
Paul Eggert
1e7c68d3fc Use symbolic mode so that we clear
setgid bit more reliably on directories.
2006-07-28 07:26:39 +00:00
Paul Eggert
aaa8e4f378 Remove obsolete comment about masks. 2006-07-28 07:26:06 +00:00
Paul Eggert
fa78395b2a (mode_compile): Numeric modes now affect setuid and
setgid on directories only if they set these bits.
2006-07-28 07:25:44 +00:00
Paul Eggert
b8bbece57a (Changing Special Mode Bits): Clarify u+s versus
a+s versus +s, and likewise for g+s.
(Numeric Modes): Bring back example of 0055 == 55.  4755 no
longer clears setgid bit on directories.
(Directory Setuid and Setgid): Numeric modes now affect setuid
and setgid on directories only if they set these bits.  This
is so that leading 0 has no effect on numeric modes.
2006-07-28 07:21:03 +00:00
Paul Eggert
82e0ce4d8b (install invocation, mkdir invocation):
Add cross-references to Directory Setuid and Setgid.
(install-invocation): The default mode is no longer equivalent to 755.
2006-07-28 07:20:28 +00:00
Jim Meyering
667f225c08 * src/chgrp.c (usage): Use correct grammar in description of the --reference option
* src/chown.c (usage): Likewise.
2006-07-27 09:11:08 +00:00
Jim Meyering
256d18e81b * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]:
Correctly access SRC_SB's element ST_AUTHOR.
2006-07-26 14:43:00 +00:00
Jim Meyering
2f418ef97d * tests/ls/stat-failed: Adapt to match new expected output.
From Paul Eggert.
2006-07-26 14:35:19 +00:00
Jim Meyering
d2c6ae7fbc * src/ls.c (print_color_indicator): Test for S_IFREG first, rather
than having the code test for all of the other types first.
Hoist the set-uid/gid-testing code "up" into this new block.
Classify any other type of file (e.g., S_TYPEISSHM, etc.) as
C_ORPHAN, not as C_FILE.

* doc/coreutils.texi (What information is listed): Mention that missing
pieces of information are marked with "?".  From Paul Eggert.
2006-07-26 14:06:57 +00:00
Jim Meyering
2465b478fd Checking in a change from Paul.
2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>

* src/ls.c (DT_INIT): Remove.  All uses removed.
(enum filetype): Use an ordinary enum rather than trying to keep
the values in sync with DT_FIFO etc.  That way, we don't have
to make special assumptions about them.  All uses changed.
(whiteout): New constant member of enum filetype.
(filetype_letter): New constant, for use with enum filetype.
(FILETYPE_INDICATORS): New initializer list.
(print_dir): Add case for DT_WHT.
(gobble_file): If stat fails, don't discard information from
readdir; instead, preserve it so it can be printed.
(print_long_format): Fall back on readdir result if stat info
is not available.  Use "?" to denote each unknown mode char,
instead of an overall "?", since we now know some of the mode
typically.
(print_type_indicator): Now that MODE isn't necessarily
useful, guard all uses.
Now that two blocks in the type-checking tree can set "type = C_FILE",
move the suffix-handling code out and down.
2006-07-26 13:47:41 +00:00
Jim Meyering
efb40f6b0f Prepare for the above change.
* src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
and adjust uses.  From a patch by Paul Eggert.
2006-07-26 13:33:07 +00:00
Jim Meyering
03d872537a * src/ls.c: Correct indentation/formatting in a few places. 2006-07-26 09:52:43 +00:00
Paul Eggert
b7f9a7ed05 Clarify the "chmod 0500" news, and correct the vague
statements about compatibility with BSD.
2006-07-25 18:38:58 +00:00
Paul Eggert
97e1e9019d Use "chmod 0500" rather than "chmod 500". 2006-07-25 18:38:25 +00:00
Paul Eggert
5637c1634f (Directory Setuid and Setgid): Explain that this is a
GNU extension, and that other systems behave differently here.
2006-07-25 18:37:55 +00:00
Jim Meyering
0b34021d6d * src/ls.c (gobble_file): When handling a stat-failed entry,
print the entry name not the absolute_name -- to be consistent
with the usual case.
* tests/ls/stat-failed: Update accordingly.
2006-07-25 16:35:59 +00:00
Jim Meyering
995cbf7830 * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
of "cannot access " to diagnostic.
2006-07-25 15:40:02 +00:00
Jim Meyering
2a287ee69b *** empty log message *** 2006-07-25 15:36:07 +00:00
Jim Meyering
fd991bcc57 * src/dircolors.hin: Mention that ORPHAN refers not just to dangling symlinks. 2006-07-25 15:34:58 +00:00
Jim Meyering
ef79e4ea3b * src/dircolors.hin: Mention that ORPHAN refers not just to dangling symlinks. 2006-07-25 15:33:57 +00:00
Jim Meyering
c04a374bb0 Get --dired offsets right when handling stat-failed entries.
* src/ls.c (print_long_format): Be careful to increment P by the
appropriate amount, even when inode_number_width and nlink_width
are zero.
* tests/ls/stat-failed: Test for the above.
2006-07-25 15:30:27 +00:00
Jim Meyering
5a06d062c7 * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
have_acl member.  That would happen for a directory with both a
non-stat'able entry and one with an ACL.
2006-07-25 15:25:37 +00:00
Jim Meyering
3a208b1404 * src/ls.c (gobble_file): Make it so failure to stat a
non-command-line file provokes an exit status of 1, not 0.
Say "cannot access" rather than "cannot stat".
* tests/ls/stat-failed: New file/test, for the above.
* tests/ls/Makefile.am (TESTS): Add stat-failed.
2006-07-25 15:23:59 +00:00
Jim Meyering
a321dfb09d * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. 2006-07-25 15:13:56 +00:00
Jim Meyering
1827b515aa * src/ls.c [enum filetype] (command_line): Remove member. Not needed.
Replace all occurrences of "type == command_line" with the
equivalent, "command_line_arg".
2006-07-25 15:12:26 +00:00
Jim Meyering
ccb1883fcd * src/ls.c: Apply the stat-failed parts of Red Hat's
coreutils-selinux.patch.  From Ulrich Drepper.
This makes it so files not mentioned on the command line (e.g.,
names read from a directory that *is* mentioned on the command
line) for which stat fails are still listed.  With --color,
such files are colored just like ORPHANs (aka dangling symlinks).
2006-07-25 15:09:56 +00:00
Jim Meyering
427a636ae3 . 2006-07-25 14:34:39 +00:00
Jim Meyering
0ff7cb7f69 vc-list-files: Handle git repositories, too. 2006-07-25 14:10:12 +00:00
Jim Meyering
627f9b7fb1 * src/df.c (n_valid_args): Declare global to be static. 2006-07-25 14:06:21 +00:00
Jim Meyering
f2641bb9f7 Skip this test on reiserfs, since that file system lacks d_type support. 2006-07-24 14:02:35 +00:00
Paul Eggert
7192610528 Update to reflect recent changes to coreutils.texi. 2006-07-23 01:27:27 +00:00
Paul Eggert
bdcc26e24b (Mode Structure, Symbolic Modes, Numeric Modes): Be more careful
about distinguishing file mode bits from permissions bits,
and about execute versus search permission.  The FreeBSD command
is chflags, not chrflags.
2006-07-23 01:26:56 +00:00
Paul Eggert
a29aa4faa6 (Mode Structure): The restricted deletion flag
restricts only unprivileged users.
2006-07-22 23:42:19 +00:00
Paul Eggert
e27208b635 (What information is listed): Clarify that the restricted deletion
flag is another name for the sticky bit.
2006-07-22 23:41:43 +00:00
Paul Eggert
e718c61a7c Split closeout into close-stream and closeout. 2006-07-22 22:28:53 +00:00
Paul Eggert
554d94c647 (close_stdout): Use new function close_stream. 2006-07-22 22:27:17 +00:00
Paul Eggert
2df2295d68 Initial revision. 2006-07-22 22:26:04 +00:00
Paul Eggert
0971f7f44a (gl_PREREQ): Require gl_CLOSE_STREAM. 2006-07-22 22:23:43 +00:00
Jim Meyering
c6a13a3354 * src/su.c (usage): Correct typo in --help output: s/commmand/command/
Reported by Tim Waugh.
Also remove the comment duplicating much of --help output.
2006-07-21 13:32:40 +00:00
Jim Meyering
680bd6f6dd *** empty log message *** 2006-07-21 09:14:43 +00:00
Jim Meyering
a1eae84aed (FILE_TYPE_INDICATOR_OPTION): Reposition this new name so the list remains alphabetized. 2006-07-21 09:14:39 +00:00
Jim Meyering
2c5f6e6e2c mention yesterday's other ls bugfix 2006-07-21 08:58:00 +00:00
Jim Meyering
eb12ed1aa7 *** empty log message *** 2006-07-21 08:57:47 +00:00
Jim Meyering
9e0a095be6 Fix another bug: ls --indicator-style=file-type would call
stat for a symlink, even though it wasn't always needed.
In some cases, that unnecessary stat would cause ls to fail.
* src/ls.c (gobble_file): Don't treat symlinks specially (in
requiring a stat syscall).  Remove the offending exclusion.
* NEWS: Mention the fix.
* tests/ls/stat-dtype: New file/test, for the above fix.
Also exercises the new df feature, below.
2006-07-21 08:49:24 +00:00
Jim Meyering
2060c55141 * src/df.c (main): Fail and don't print the headers if no
file system is processed.  This makes it easy to test whether
a specified directory is on a file system of a given type or types.
Otherwise, applications would have had to parse df's output.
E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
2006-07-20 15:42:26 +00:00
Jim Meyering
6ad7eac04f *** empty log message *** 2006-07-20 10:31:48 +00:00
Jim Meyering
492f011795 (file-type): New test:
For 5.97 and earlier, --file-type acted like --indicator-style=slash.
2006-07-20 10:30:42 +00:00
Jim Meyering
3ddfde6897 Fix a bug: ls --file-type worked like --indicator-style=slash,
rather than like --indicator-style=file-type.

(FILE_TYPE_INDICATOR_OPTION): New enum member.
(long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
not to 'p'.
(decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
2006-07-20 10:20:23 +00:00
Jim Meyering
aa91e4fe34 *** empty log message *** 2006-07-20 08:34:22 +00:00
Jim Meyering
6e41860c41 [ME_REMOTE]: Filter out cifs.
Reported by Toralf Frster in <http://bugs.gentoo.org/141012>.
2006-07-20 08:34:15 +00:00
Jim Meyering
6e31234fbb *** empty log message *** 2006-07-20 08:33:19 +00:00
Jim Meyering
84d2889e40 *** empty log message *** 2006-07-20 07:57:10 +00:00
Jim Meyering
db42e50e5e (ME_REMOTE): Compare strchr's result to NULL, not 0, for better readability. 2006-07-20 07:57:06 +00:00
Jim Meyering
7d97c337a7 * src/ls.c (print_dir): Give a better diagnostic for failed opendir. 2006-07-19 10:36:02 +00:00
Jim Meyering
30e6fc491f *** empty log message *** 2006-07-19 09:56:03 +00:00
Jim Meyering
865bf3e4ff (EXTRA_DIST): Add build-aux/vc-list-files. 2006-07-19 09:54:53 +00:00
Jim Meyering
603da96fbd *** empty log message *** 2006-07-19 09:54:32 +00:00
Jim Meyering
6f91fb9595 Command line args correspond to an "include" list, not an exclude list. 2006-07-19 09:54:28 +00:00
Jim Meyering
76d82ec5cc tweak spacing to align backslashes 2006-07-19 08:43:27 +00:00
Paul Eggert
f8e8d8dd69 In comment: bits bits -> bits. 2006-07-17 05:56:28 +00:00
Paul Eggert
a58ac00556 Regenerate. 2006-07-17 03:52:18 +00:00
Paul Eggert
16f64d42ba Regenerate. 2006-07-17 03:51:25 +00:00
Paul Eggert
6d62ac46ce Fix typo in previous checkin; some file names were wrong. 2006-07-17 03:35:18 +00:00
Paul Eggert
628c7baa85 chmod, install, and mkdir now leave setgid and setuid bits
of directories alone unless you specify them explicitly.
install and mkdir now implement X correctly.
install now creates parent directories with mode 755, without
changing their owner or group.
2006-07-17 03:13:14 +00:00
Paul Eggert
d847e28b37 Add a test for the X bug. 2006-07-17 03:12:44 +00:00
Paul Eggert
01014bb951 Remove re_protect case that no longer applies.
GNU chmod now behaves like other versions of chmod.
2006-07-17 03:12:22 +00:00
Paul Eggert
4d9d2da4a8 Do the setgid test instead of bailing. 2006-07-17 03:11:51 +00:00
Paul Eggert
577faf65e3 (main): Adjust to new mode_adjust API. 2006-07-17 03:11:01 +00:00
Paul Eggert
1d396d7008 (main): Adjust to new mode_adjust API. 2006-07-17 03:10:29 +00:00
Paul Eggert
76b12f0005 (struct mkdir_options): New struct.
(announce_mkdir, make_ancestor): New functions.
(main): Use them.  Adjust to mode_adjust API change.  Stick with
umask 0.  Use make_dir_parents for all the work.
2006-07-17 03:10:10 +00:00
Paul Eggert
83978a5654 Include mkancesdirs.h.
(announce_mkdir, make_ancestor): New functions.
(DEFAULT_MODE): New macro, specifying initial value of 'mode'.
(mode): Use it.
(dir_mode, dir_mode_bits): New vars.
(main): Set dir modes separately from nondir, so that the X
op of -m works correctly.
(main): Remove cwd_errno cruft, since make_dir_parents no longer
affects cwd.  Adjust to new make_dir_parents API.
(install_file_in_file_parents): 2nd arg is now char *, not char
const *.  Use mkancesdirs instead of rolling our own code.
(change_attributes): Don't worry about AFS, since that kludge
should not be needed any more.
2006-07-17 03:09:49 +00:00
Paul Eggert
8401b6ae54 (process_file): Adjust to mode_adjust API change. 2006-07-17 03:09:26 +00:00
Paul Eggert
c09c4070ff (gl_PREREQ): Require gl_MKANCESDIRS. 2006-07-17 03:09:09 +00:00
Paul Eggert
6060142d89 (gl_MKDIR_PARENTS): Mention dirchownmod.c, dirchownmod.h.
Don't require AC_FUNC_ALLOCA, gl_AFS, gl_CHDIR_SAFER; no longer needed.
Require gl_FUNC_LCHOWN, since dirchownmod.c needs it.
2006-07-17 03:08:42 +00:00
Paul Eggert
1d5f7fa081 Remove; no longer needed. 2006-07-17 03:08:18 +00:00
Paul Eggert
b2bc8fd0fd (gl_MACROS): Remove gl_AFS. 2006-07-17 03:08:04 +00:00
Paul Eggert
86e8a6b15e (mode_adjust): New API. 2006-07-17 03:07:41 +00:00
Paul Eggert
44ba013923 (octal_to_mode): New function.
(struct mode_change): New member mentioned.
(make_node_op_equals): New arg mentioned.  All callers changed.
(mode_compile): Keep track of which mode bits the user has explicitly
mentioned.
(mode_adjust): New arg DIR, so that we implement the X op correctly.
New arg PMODE_BITS, to keep track of which mode bits the user
mentioned; it treats S_ISUID and S_ISGID speciall.
All callers changed.
2006-07-17 03:07:23 +00:00
Paul Eggert
9a1ed6fbf9 Adjust to new make_dir_parents API. 2006-07-17 03:07:04 +00:00
Paul Eggert
a60cc14aed Don't include alloca.h, stdio.h, sys/types.h,
unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
(make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
callers changed.  Revamp internals significantly, by not
attempting to create directories that are temporarily more
permissive than the final results.  Do not attempt to use
save_cwd/restore_cwd; it isn't worth it for mkdir and install.
This removes some race conditions, fixes some bugs, and simplifies
things.  Use new dirchownmod function to do owner and mode changes.
2006-07-17 03:06:48 +00:00
Paul Eggert
e9b48653e2 (Mode Structure): Modernize the explanation of the
setuid and setgid bits on directories.
(Changing Special Mode Bits): Mention that a implies both u and g
for s.  Cross reference to new node.
(Numeric Modes): Don't claim that 0055 is the same as 55; this isn't
true any more.  Mention new node.
4755 is now like u=rwxs,go=rx,g-s, not like u=rwxs,go=rx.
(Directory Setuid and Setgid): New node.
2006-07-17 03:06:25 +00:00
Paul Eggert
3a10b32994 Change GNU to @acronym{GNU} in a few places.
Use "set-user-ID" and "set-group-ID" a bit more consistently.
Use "appropriate privileges" rather than "super-user" a bit
more consistently.
(install invocation): Parent directories are now 755 without uid
or gid changing.  The default mode is now 0755, not 755.
(mkdir invocation): Rewrite the top-level usage description, since
I couldn't easily follow the old one.  It's now 3 lines not 8.
For -m, describe file permission bits versus other bits, and note
that mkdir is atomic if you don't mention special bits.
(chmod invocation): Mention what chmod does to setgid and setuid bits.
2006-07-17 03:06:03 +00:00
Paul Eggert
f25ddb12c6 Initial version. 2006-07-17 03:05:23 +00:00
Paul Eggert
999eeed90f chmod, install, and mkdir now leave setgid and setuid bits
of directories alone unless you specify them explicitly.
install and mkdir now implement X correctly.
install now creates parent directories with mode 755, without
changing their owner or group.
2006-07-17 03:02:45 +00:00
Jim Meyering
c5b6394401 * userspec.c (parse_with_separator): Say "invalid spec" rather than
the sometimes erroneous "cannot get the login group of a numeric UID"
for a spec like "not-a-username:" or "1:".  Reported by
suckfish@ihug.co.nz in https://bugzilla.redhat.com/bugzilla/199027.
2006-07-16 07:13:07 +00:00
Paul Eggert
77c9d9a009 (do_decode): Output to parameter OUT, not to stdout. 2006-07-14 17:54:54 +00:00
Jim Meyering
a283f2df1a * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
rather than open-coding it.  Now supports mercurial, too.
* .hgignore: New file.
* Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
all generated files, including ones like configure and po/*.po
that are currently version-controlled in cvs.
* build-aux/vc-list-files: New file.
2006-07-14 14:42:27 +00:00
Jim Meyering
01e7d49a3b * Makefile.am (EXTRA_DIST): Add a few more .??* files.
They've been in CVS, just haven't been distributed before this.
Distribute ChangeLog-2005, too.
(MAINTAINERCLEANFILES): Add THANKS-to-translators.
2006-07-14 14:27:38 +00:00
Paul Eggert
d6697c60c3 Assume <dirent.h> exists, since gnulib assumes this now as well. 2006-07-11 17:22:15 +00:00
Paul Eggert
2b6236d156 Sync from gnulib. 2006-07-11 17:19:48 +00:00
Paul Eggert
888ee9b8d9 (gl_STDINT_H): Like yesterday's change to
absolute-header.m4.  Also, set ABSOLUTE_STDINT_H to a string
"no/such/file/stdint.h" when there is no such file, so that
the resulting C code can be parsed by dodgy compilers.
Problems reported by Bob Proulx.
2006-07-11 03:29:56 +00:00
Paul Eggert
6e1e9cd9b4 (gl_ABSOLUTE_HEADER): Use "" rather than <>
around the absolute name, to work around a problem with the HP-UX
11.23 native C compiler, reported by Bob Proulx.
2006-07-10 04:37:33 +00:00
Jim Meyering
86f86c121b *** empty log message *** 2006-07-09 17:49:28 +00:00
Jim Meyering
6eb562ad35 (TESTS): Add dir2dir. 2006-07-09 17:49:24 +00:00
Jim Meyering
04463c3a6f *** empty log message *** 2006-07-09 17:48:13 +00:00
Jim Meyering
159f930158 Adjust so failing with ENOTEMPTY is ok, too.
That happens with Linux/tmpfs.
2006-07-09 17:48:08 +00:00
Paul Eggert
914c8674a5 Regenerate. 2006-07-09 17:20:26 +00:00
Paul Eggert
f354f3be02 Adjust to recent updates from gnulib. 2006-07-09 17:09:48 +00:00
Paul Eggert
197b96d069 Adjust to today's renaming changes in system.h. 2006-07-09 17:08:55 +00:00
Paul Eggert
b3e1ad7a5d (print_it): Don't assume char is unsigned. 2006-07-09 17:07:12 +00:00
Paul Eggert
b35b31b0f8 (print_esc): Don't assume char is unsigned. 2006-07-09 17:06:35 +00:00
Paul Eggert
20c336e6d2 (create_fullname): Don't assume char is unsigned. 2006-07-09 17:06:06 +00:00
Paul Eggert
2b001e3490 (is_blank): Remove; no longer needed. All uses
replaced by isblank (to_uchar (...)).
2006-07-09 17:05:33 +00:00
Paul Eggert
c7a6c4014f (unexpand): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
2006-07-09 17:05:13 +00:00
Paul Eggert
8c572b86f6 (is_char_class_member): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
2006-07-09 17:04:48 +00:00
Paul Eggert
613b3f819c (initialize_regex, fix_output_parameters): Don't assume that isprint
etc. return booleans (needed for pre-C99 hosts).
(SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
(copy_unescaped_string): Don't assume char is unsigned.
2006-07-09 17:04:06 +00:00
Paul Eggert
925076c5d6 (check_punctuation): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
2006-07-09 17:03:20 +00:00
Paul Eggert
55755b03cd (expand): Don't assume that isprint etc. return
booleans (needed for pre-C99 hosts).
2006-07-09 17:02:53 +00:00
Paul Eggert
1ee1c4d4a3 (inittables): Use toupper rather than
islower followed by toupper; it's simpler and typically
faster now that we assume at least C89 semantics.  Similarly
for tolower.
2006-07-09 17:02:17 +00:00
Paul Eggert
7c3fd7cbec (apply_translations): Use toupper rather than
islower followed by toupper; it's simpler and typically
faster now that we assume at least C89 semantics.  Similarly
for tolower.
2006-07-09 17:01:38 +00:00
Paul Eggert
d740f05066 (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
convenience on GNU systems.  All uses changed.  Don't bother
looking for any dirent.h substitute other than ndir.h.
(D_INO): Remove unnecessary parentheses.
(IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
(ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
(ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove.  All uses changed
to ctype.h equivalents.
(isblank): Renamed from ISBLANK.  Check for HAVE_DECL_ISBLANK too.
All uses changed.
2006-07-09 17:01:13 +00:00
Paul Eggert
fbb436b3f8 Update from gnulib. 2006-07-09 16:59:35 +00:00
Paul Eggert
cb052e4f6c Update from gnulib. 2006-07-09 16:59:05 +00:00
Paul Eggert
28edf6a75e (stdint.h): FULL_PATH_STDINT_H -> ABSOLUTE_STDINT_H,
to accommodate update from gnulib.
2006-07-09 16:57:35 +00:00
Paul Eggert
533793f35c Update from gnulib. 2006-07-09 16:57:00 +00:00
Jim Meyering
ba6a5af063 remove doubled "in" 2006-07-09 09:49:10 +00:00
Jim Meyering
62f3c3097c fix typo: remove doubled "each" 2006-07-09 09:47:20 +00:00
Jim Meyering
75f0b1e2da New file, test for 2006-07-05 fix in copy.c. 2006-07-08 21:52:24 +00:00
Jim Meyering
7d65513654 * regex.m4 (gl_REGEX): Remove one of two adjacent "the"s in a comment. 2006-07-08 12:08:59 +00:00
Jim Meyering
00318b60c9 * link-follow.m4: Remove one of two adjacent "whether"s in a comment. 2006-07-08 11:28:05 +00:00
Jim Meyering
7ea443fa86 Remove one of two adjacent "your"s in a comment. 2006-07-08 11:27:07 +00:00
Jim Meyering
a3752970c9 Remove one of two adjacent "can"s in a comment. 2006-07-08 11:25:18 +00:00
Jim Meyering
ecdb09854e (getndelim2): Remove doubled "after" in comment. 2006-07-08 09:58:13 +00:00
Jim Meyering
2d9ebdc8ae * tests/Coreutils.pm: Remove one of two adjacent "then"s in a comment. 2006-07-08 07:37:16 +00:00
Jim Meyering
d80c390842 * Makefile.maint (sc_the_the): New rule. 2006-07-08 06:08:34 +00:00
Jim Meyering
6b535b03bb * src/dd.c (skip): Remove one of two adjacent "the"s in a comment. 2006-07-08 06:04:18 +00:00
Jim Meyering
24ec8f28bb * coreutils.texi (Squeezing): Separate doubled "the", so typo-checkers
don't complain.
2006-07-08 06:03:50 +00:00
Jim Meyering
a56e9c5a4d * Makefile.am (check-texinfo): Enforce the zeros vs. zeroes consistency. 2006-07-08 05:31:59 +00:00
Jim Meyering
38fbc11f7b * coreutils.texi: Fix some typos. Use `zeros' consistently (both
`zeros' and `zeroes' are correct).
2006-07-08 05:28:39 +00:00
Jim Meyering
1ac491f062 * NEWS: Mention that mv can now remove an empty destination directory,
and give an example.  Prompted by a report from Florent Bayle.
2006-07-07 06:38:36 +00:00
Jim Meyering
b544360dab * src/ls.c (usage): Correct the description of -G: it is useful
only in a long listing.  Reported by Martin Pool in
<https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
2006-07-05 10:17:24 +00:00
Jim Meyering
2a7f886e47 * man/chmod.x: Correct the description of the sticky bit. Reported
by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
2006-07-05 10:03:55 +00:00
Jim Meyering
36a288e41a * src/copy.c (copy_internal): Don't work around old NFS clients like
SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
a banal failure as a recursive move-into-self failure.
Reported by Florent Bayle in <http://bugs.debian.org/376749>.
2006-07-05 09:08:42 +00:00
Jim Meyering
7669f3998d . 2006-07-05 06:57:09 +00:00
Jim Meyering
21f0c888a2 Regenerate, to remove fuzz. 2006-07-05 06:57:00 +00:00
Jim Meyering
addbdadf16 Really add wcwidth.h. 2006-07-04 07:28:57 +00:00
Jim Meyering
2880a90019 *** empty log message *** 2006-07-04 07:28:45 +00:00
Jim Meyering
ba761d685f *** empty log message *** 2006-07-04 07:23:10 +00:00
Jim Meyering
ab4ed7f7f1 Really add wcwidth.m4. 2006-07-04 07:17:34 +00:00
Paul Eggert
6a97405672 Sync from gnulib. 2006-07-04 05:39:07 +00:00
Paul Eggert
8e19f6282b Sync from gnulib. Also:
(gt_FUNC_SETENV): Undo private change that added an
AC_LIBSOURCES line here, since Bruno didn't buy it back.  Instead,
update ../lib/Makefile.am to mention the files explicitly.
2006-07-04 05:38:32 +00:00
Paul Eggert
d380605f01 (gl_PREREQ): Require gl_FUNC_WCWIDTH, to accommodate
sync from gnulib.
2006-07-04 05:37:58 +00:00
Paul Eggert
71e6c80352 (libcoreutils_a_SOURCES): Add setenv.h, wcwidth.h,
to accommodate sync from gnulib.
2006-07-04 05:37:11 +00:00
Paul Eggert
948ca71450 Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
MacOS X 10.4.6.  Don't mention <sys/int_types.h>.
2006-07-04 04:50:34 +00:00
Jim Meyering
a9cf203e2d Plug another unusual leak.
(AD_mark_helper): Free malloc'd filename if hash_insert says
that string is already in the hash table.
2006-07-03 17:38:20 +00:00
Jim Meyering
1a29d221b8 * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
macro is used before the first cycle_check call.
2006-07-03 15:20:23 +00:00
Jim Meyering
a47c5ca291 The dev/inode of the topmost directory in each hierarchy were not
being recorded.
* src/remove.c (remove_cwd_entries): Don't call cycle_check here.
(AD_push): Call it from here instead.
2006-07-03 15:10:35 +00:00
Jim Meyering
2741ffb8b4 Fix two small leaks.
* src/remove.c (AD_stack_clear): New function.
(rm_1): Use it.
(AD_pop_and_chdir): Free *prev_dir just before longjmp.
2006-07-03 13:14:01 +00:00
Jim Meyering
ae87c86b4a * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
Add $VG_PATH_PREFIX as a prefix to $PATH
2006-07-03 12:55:25 +00:00
Jim Meyering
d67693ced9 . 2006-07-03 09:10:36 +00:00
Jim Meyering
20592da66e * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
* tests/Makefile.am (evar-check): Remove rule.
(EXTRA_DIST): Remove .env-warn.
* tests/.env-warn: Remove file.  No longer used.
Suggestion from Eric Blake.
2006-07-03 08:37:50 +00:00
Jim Meyering
c4a674722c *** empty log message *** 2006-07-03 07:42:30 +00:00
Jim Meyering
f483ac253e (gl_FUNC_FTRUNCATE): Adjust diagnostic to recommend
./configure SKIP_FTRUNCATE_CHECK=yes, rather than env ... ./configure.
Suggestion from Ralf Wildenhues.
2006-07-03 07:42:27 +00:00
Paul Eggert
001f33d478 (intmax_t, uintmax_t): Prefer long to long long if
both are 64 bits.
2006-07-02 09:15:08 +00:00
Paul Eggert
2789dcc1b9 (gl_STDINT_H): Use more-mnemonic identifiers for
test cases, so that config.log is a bit easier to follow.
2006-07-02 09:14:28 +00:00
Jim Meyering
85e93ac1bf *** empty log message *** 2006-07-02 08:29:30 +00:00
Jim Meyering
b1f0257390 New file, from gnulib. Required by stdint.m4. 2006-07-02 08:29:26 +00:00
Paul Eggert
58df3afc50 Include <stdint.h> unconditionally, since we
now assume the stdint module.
2006-07-02 07:09:25 +00:00
Paul Eggert
047839ffb4 Sync stdint module from gnulib. 2006-07-02 07:08:50 +00:00
Paul Eggert
31acf81fa0 With no operand, 'tail -f' now silently ignores the '-f'
only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
2006-07-01 23:53:05 +00:00
Paul Eggert
2d33a9301b (f-pipe-1): Renamed from f-1.
(test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
2006-07-01 23:50:46 +00:00
Paul Eggert
7b49a25b50 (main): With no operand, 'tail -f' now silently ignores the '-f'
only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
2006-07-01 23:50:15 +00:00
Paul Eggert
0830b1b82a (tail invocation): With no operand, 'tail -f' now
silently ignores the '-f' only if standard input is a FIFO or pipe
and POSIXLY_CORRECT is set.
2006-07-01 23:49:46 +00:00
Jim Meyering
aa9b173531 * src/ln.c (do_link): Use new, shorter URL, for ag-review link. 2006-07-01 07:04:52 +00:00
Jim Meyering
530a8d72cc Add ^lib/xstrtold\.c$, so make distcheck passes once again. 2006-07-01 06:50:30 +00:00
Jim Meyering
8939a957c7 *** empty log message *** 2006-07-01 06:44:22 +00:00
Paul Eggert
69f1a97138 seq defaults to a minimal fixed point format that does not lose
information if seq's operands are all fixed point decimal numbers.
You no longer need the `-f%.f' in `seq -f%.f 1048575 1024 1050623',
for example, since the default format now has the same effect.

seq now lets you use %a, %A, %E, %F, and %G formats.

seq now uses long double internally rather than double.
2006-07-01 00:11:23 +00:00
Paul Eggert
248c092226 (seq invocation): seq now uses long double
internally rather than double.  It now defaults to a minimal fixed
point format if possible.  It lets you use %a, %A, %E, %F, %G.
Don't assume printf doesn't work for numbers that fit in 64 but
not 32 bits; typically they work these days.  Improve discussion
of large integers and update the rounding-error numbers.
2006-07-01 00:10:21 +00:00
Paul Eggert
3964d508e2 (XSTRTOD, DOUBLE): New macros, so that we can support
both double and long double versions.
(XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
2006-07-01 00:09:56 +00:00
Paul Eggert
42ae65127f (xstrtold): New decl. 2006-07-01 00:09:22 +00:00
Paul Eggert
507aaa0037 (gl_C_STRTOLD): Add c-strtod.c to LIBSOURCES.
Require gl_USE_SYSTEM_EXTENSIONS, not gl_C_STRTOD, since we don't
want to require the building of c-strtod.o.
2006-07-01 00:08:56 +00:00
Paul Eggert
6b2cf24aac (cu_LIB_CHECK): Remuve SEQ_LIBM, since seq no longer
needs -lm directly.
2006-07-01 00:08:31 +00:00
Paul Eggert
0f39955197 (gl_PREREQ): Require gl_C_STRTOD and gl_XSTRTOLD. 2006-07-01 00:08:05 +00:00
Paul Eggert
1d30cbe7df (gl_XSTRTOLD): New macro. 2006-07-01 00:07:48 +00:00
Paul Eggert
37fe2d4d3e (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB). 2006-07-01 00:07:26 +00:00
Paul Eggert
6c5f11fbfe Don't include <math.h> or <xstrtol.h>; no longer needed.
(isfinite) [!defined isfinite]: New macro.
(separator, terminator): Now points to const.
(first, step, last): Remove.
(usage): Update to match new behavior.
(struct operand, operand): New type.
(scan_arg): Renamed from scan_double_arg, since we no longer use double.
All uses changed.
Compute and return a value of type operand, not double.
(long_double_format): Renamed from valid_format, and now returns a
new format with an "L" added if needed, if the original format was
valid.  Allow %a, %A, %E, %F, and %G formats.
(print_numbers): Take numeric values as args rather than from globals.
Print long double, not double.
(get_width_format): Remove.
(get_default_format): New function.
(main): Implement new way of calculating default format.
Don't worry about locale's representation of the decimal point, since
the arguments are always processed in the C locale.
2006-07-01 00:07:06 +00:00
Paul Eggert
75a229e3a3 (neg-2): Adjust to new default format.
(eq-wid-1, eq-wid-2): Resurrect these tests, since the new
implementation should do the right thing.
2006-07-01 00:06:35 +00:00
Paul Eggert
74d539a32f Initial revision. 2006-07-01 00:06:11 +00:00
Jim Meyering
28b3cf0a5c * tests/stty/basic-1: Work around an intermittent test failure
on HP-UX 11.11.  Report and analysis from Bob Proulx.
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
2006-06-30 10:31:42 +00:00
Jim Meyering
2e63aaa8a9 From Derek R. Price:
* lib/strftime.c: Assume strftime exists.
* m4/strftime.m4: Don't call AC_FUNC_STRFTIME.
2006-06-29 21:45:51 +00:00
Paul Eggert
4a8016db69 * src/sort.c (main): Support obsolete usages like "sort +1 -2" even when
conforming to POSIX 1003.1-2001, since this is a pure extension to
POSIX.
2006-06-28 23:51:13 +00:00
Paul Eggert
59e82cb266 * coreutils.texi (sort invocation): 'sort +1 -2' is now supported
even when conforming to POSIX 1003.1-2001.
2006-06-28 23:50:40 +00:00
Paul Eggert
5b3614ac91 (sort invocation): 'sort +1 -2' is now supported
even when conforming to POSIX 1003.1-2001, since this is a pure
extension to POSIX.
2006-06-28 23:50:21 +00:00
Paul Eggert
3869e29196 Support obsolete usages like "sort +1 -2" even when conforming to
POSIX 1003.1-2001.
2006-06-28 23:49:58 +00:00
Paul Eggert
ab621d9fa1 (CLOSEDIR): Remove. All uses changed to closedir. 2006-06-28 22:24:54 +00:00
Paul Eggert
699d9c460e * savedir.m4: Remove AC_FUNC_CLOSEDIR_VOID requirement. 2006-06-28 22:24:14 +00:00
Paul Eggert
0b24b84044 * src/system.h (CLOSEDIR): Remove. All uses changed to closedir. 2006-06-28 22:21:48 +00:00
Paul Eggert
3eaec256b7 Fix attribution again. 2006-06-28 22:04:56 +00:00
Paul Eggert
d54ac21e44 Fix attribution for last patch. 2006-06-28 22:04:12 +00:00
Paul Eggert
41872b2d6b Don't require AC_C_CONST, since it's obsolete.
Require Autoconf 2.60.
2006-06-28 22:00:33 +00:00
Paul Eggert
c1f8b7eba9 (gl_FUNC_GNU_STRFTIME): Don't require AC_C_CONST, since it's obsolete. 2006-06-28 22:00:13 +00:00
Paul Eggert
84ab5b148f (_AC_LIBOBJ_FNMATCH): Don't require AC_C_CONST, since it's obsolete. 2006-06-28 21:59:41 +00:00
Paul Eggert
4333e76636 (gl_CHECK_ALL_TYPES): Don't require AC_C_CONST, since it's obsolete. 2006-06-28 21:59:07 +00:00
Jim Meyering
78e532a9e4 * src/c99-to-c89.diff: Regenerate, to remove fuzz. 2006-06-28 07:01:42 +00:00
Jim Meyering
0e0f6e1050 * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
(set -x when VERBOSE=yes) when stderr is redirected before stdout
causing shell tracing of the stdout redirection to be written to
the stderr file.  Avoid problem and test failure on HP-UX by
redirecting stderr last.
* tests/dd/unblock-sync: Order shell file redirections for
stderr and stdout in the common style.
tests/acl: Likewise.
2006-06-28 06:51:06 +00:00
Jim Meyering
c4d2d39cf8 .PHONY: sc_tight_scope 2006-06-27 21:22:15 +00:00
Jim Meyering
05d3db5c60 * coreutils.texi (wc invocation): Remove ./ prefix from example.
From Padraig Brady.
2006-06-27 20:26:12 +00:00
Jim Meyering
df96ded8ae * tests/misc/cat-proc: Try to avoid any spurious numeric
differences in frequently-changing /proc/cpuinfo.
Reported by Nelson Beebe.
2006-06-27 18:43:58 +00:00
Jim Meyering
80059da4ca * coreutils.texi (wc invocation): Spell out `--files0-from' in
the example. Suggestion from Bob Proulx.
2006-06-26 15:34:19 +00:00
Jim Meyering
7590adf9b9 Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
fd_to_subdirp failure, not just when errno == EACCES.
* src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
rmdir, here, even though rmdir may happen to be adequate.
2006-06-26 13:29:48 +00:00
Jim Meyering
78b166d1b1 * NEWS: rm no longer fails to remove an empty, unreadable directory
* src/remove.c (remove_cwd_entries): If we can't open a directory,
and the failure is not being ignored, try to remove the directory
with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
Problem report and test case from Paul Eggert in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
* tests/rm/empty-inacc: New test, for the above.
2006-06-26 13:02:01 +00:00
Jim Meyering
9cabe37ac9 * coreutils.texi (wc invocation): Document new --files0-from option. 2006-06-26 10:33:09 +00:00
Jim Meyering
5cd6710f08 now, trunk passes tests on openbsd 2006-06-26 09:12:35 +00:00
Jim Meyering
6def7f6227 Avoid a segfault for wc --files0=- < /dev/null.
* src/wc.c (compute_number_width): Return right away if nfiles == 0.
2006-06-26 08:39:59 +00:00
Jim Meyering
d77808bb40 remove wc --files0-from item 2006-06-25 20:45:32 +00:00
Jim Meyering
59bafa5a0c tweak grammar in comment 2006-06-25 19:27:19 +00:00
Jim Meyering
cc70571401 * NEWS: wc accepts a new option --files0-from=FILE, where FILE
contains a list of NUL-separated file names.

* src/wc.c: Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
* tests/misc/wc-files0: New tests, for the above.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/Makefile.am (TESTS): Add wc-files0.
2006-06-25 18:26:09 +00:00
Jim Meyering
b2657ecc6a (sleep invocation): Document that accepting
multiple arguments and suffixes are extensions.
Reported by Dan Jacobson.
2006-06-25 06:55:07 +00:00
Jim Meyering
99fb2bfe1f * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions. 2006-06-24 05:31:41 +00:00
Jim Meyering
b505087420 * src/tee.c (tee_files): Rename from tee, to avoid conflict with
the function in glibc's <fcntl.h>.  Reported by Andreas Schwab.
2006-06-22 12:50:32 +00:00
Paul Eggert
9d5fbcc019 (openat): Use ?:, not if, to work around GCC bug 4210. 2006-06-20 19:20:25 +00:00
Jim Meyering
8280381dd7 fix typo in comment: s/nerrower/narrower/ 2006-06-20 10:19:40 +00:00
Paul Eggert
c88873d3a4 (gl_IGNORE_UNUSED_LIBRARIES):
Use -Wl,--as-needed, not bare --as-needed, since HP-UX 11.11
cc merely issues a bunch of annoying warnings for --as-needed
(this problem was reported by Bob Proulx).  Also, try linking with
-lm to detect a bug in binutils 2.16 (this problem was reported
by Ralf Wildenhues).
2006-06-20 05:59:16 +00:00
Jim Meyering
d5a9087fb1 *** empty log message *** 2006-06-19 19:13:04 +00:00
Jim Meyering
bee8bb4c9b Apply this change from gnulib:
2006-06-16  Eric Blake  <ebb9@byu.net>
* unsetenv.c [!defined errno]: Assume errno.h declares errno.
2006-06-19 19:13:00 +00:00
Paul Eggert
050ec5cb29 (gl_IGNORE_UNUSED_LIBRARIES): Prefer binutils's
--as-needed option if available.
2006-06-19 07:19:00 +00:00
Jim Meyering
ed91e298a4 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
so this check is not run as part of "make distcheck".
2006-06-18 22:06:42 +00:00
Jim Meyering
48d2f62213 Test for a bug that causes glibc's getcwd to suffer a failed assertion.
* getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): New file and macro.
* getcwd.m4 (gl_FUNC_GETCWD): If we detect support for getcwd_null,
also check for glibc-2.4's abort-inducing bug.
2006-06-18 21:52:03 +00:00
Jim Meyering
a40e199756 *** empty log message *** 2006-06-18 17:08:52 +00:00
Jim Meyering
0b1dce2485 Fix typo (s/neq/ne/) in previous change. 2006-06-18 17:08:50 +00:00
Jim Meyering
bf24627b4f * getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Fix typo.
Low-probability clean-up should be to use rmdir to get rid of
the just-created directory, not unlink.
2006-06-18 14:29:29 +00:00
Jim Meyering
0399d3ff5f * ftruncate.m4 (gl_FUNC_FTRUNCATE): If ftruncate is missing, make
configure fail, and request a bug report to inform us about it.
Add a comment that, barring reports to the contrary, in 2007 we'll
assume ftruncate is universally available.
2006-06-18 14:00:34 +00:00
Jim Meyering
89c21e7043 make error output a little clearer 2006-06-18 06:31:25 +00:00
Jim Meyering
ef8e124bb2 * tests/rm/inaccessible: Skip this test on systems without openat support.
Reported by Bob Proulx.
2006-06-17 17:46:33 +00:00
Jim Meyering
a49a6bfe1b . 2006-06-16 09:57:36 +00:00
Jim Meyering
3afe316b52 add these two files (a and b) so that I can remove them -- in the eyes of cvsps 2006-06-16 09:57:11 +00:00
Jim Meyering
a2b4ccc56a remove the files once and for all, so that tools like cvsps (and even 'cvs update') don't think they're still around 2006-06-16 09:54:29 +00:00
Paul Eggert
585d681783 Improve permission checks to handle
running mkdir test in set-gid directories.
2006-06-15 17:35:00 +00:00
Jim Meyering
e48234f842 tests/du/basic: Revamp not to hard-code file system block sizes. 2006-06-14 08:45:33 +00:00
Jim Meyering
61691e8f40 tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for the files0-from test. 2006-06-12 20:35:55 +00:00
Paul Eggert
3807c8d93d (check-texinfo): Use $(_W) and $(W_) instead of
assuming grep -w (which is not portable).
2006-06-12 20:10:25 +00:00
Jim Meyering
b50d64f0ad Makefile.am (EXTRA_DIST): Add .gitignore. 2006-06-11 10:03:09 +00:00
Jim Meyering
966a2f95a3 *** empty log message *** 2006-06-11 08:43:28 +00:00
Jim Meyering
ba2948b764 Setting TIME_STYLE=long-iso in the environment would make the
cp/same-file test fail.
* tests/envvar-check (vars): Add TIME_STYLE to the list.
* tests/cp/same-file: Revert last change.
Source the envvar-check script, to ensure that TIME_STYLE
settings don't affect these tests.
2006-06-11 08:12:37 +00:00
Paul Eggert
13d0cd669e * tests/cp/same-file: Execute 'ls' in the C locale, so that it
uses POSIX time stamp formats.  Problem reported by John Nixon in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
2006-06-11 07:59:16 +00:00
Paul Eggert
ff276995ff (__attribute__): Don't define if already defined. 2006-06-11 07:11:31 +00:00
Jim Meyering
d9f0cce0f4 Mention the AIX-strndup-bug vs. dircolors workaround. 2006-06-10 09:41:39 +00:00
Jim Meyering
949ed19da0 Apply this change from gnulib:
2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
	    Bruno Haible  <bruno@clisp.org>

* strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
2006-06-10 09:10:12 +00:00
Jim Meyering
a8ee9bcfb3 Apply this change from gnulib:
2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
	    Bruno Haible  <bruno@clisp.org>

* strndup.m4 (gl_FUNC_STRNDUP): Replace the AC_REPLACE_FUNCS with a
check for the declaration of strnlen and a run test that exposes the
AIX 5.1 strnlen bug.  In the failure case, #define strndup to
rpl_strndup.
2006-06-10 09:01:41 +00:00
Jim Meyering
82f9a230aa *** empty log message *** 2006-06-10 07:58:09 +00:00
Jim Meyering
ea7ded281d Require a "Version N.M" line at the top of the ChangeLog
file only when making the actual release, not when running
"make distcheck".

(maintainer-distcheck): Don't depend on
changelog-check.
(alpha beta major): Depend on it here, instead.
2006-06-10 07:58:05 +00:00
Jim Meyering
790892db65 Ensure that cat works with any of the options, -A -v -e -E -T,
when applied to files in /proc and /sys, even when the FIONREAD
ioctl produces nonsensical results.  Before this change, cat would
produce no output (or truncated output), for some linux kernels.

* src/cat.c (write_pending): New function, factored out of cat.
(cat): Also interpret a negative ioctl/FIONREAD count as indicating
that there are bytes to read.  Some versions of linux-2.6.16 do that.
Write any pending output before returning.
Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
* NEWS: Mention this bug fix.
* tests/misc/cat-proc: New file.  Test for the above.
* tests/misc/Makefile.am (TESTS): Add cat-proc.
2006-06-08 20:13:37 +00:00
Paul Eggert
cad27cdc2e (eval4): Detect overflow properly when multiplying INTMAX_MIN * -1. 2006-06-08 02:53:25 +00:00
Paul Eggert
0eef2e1e8b Don't claim x86 behavior is erroneous in a comment. 2006-06-07 05:58:57 +00:00
Paul Eggert
8863262663 The 'expr' command now detects and reports integer overflow. 2006-06-07 05:52:41 +00:00
Paul Eggert
dea306fe78 (integer_overflow): New function.
(eval4, eval3): Check for integer overflow.
2006-06-07 05:52:27 +00:00
Paul Eggert
0038f24b9a The 'expr' command now detects and reports integer overflow. 2006-06-07 05:52:07 +00:00
Paul Eggert
8ef928100b Fix problems when building with Solaris/SVR4/etc. make, which uses a
different and somewhat bogus implementation of VPATH.
2006-06-05 20:05:26 +00:00
Paul Eggert
856e93df76 Rename file to avoid bugs with VPATH builds and Solaris 'make'. 2006-06-05 20:05:00 +00:00
Paul Eggert
8818e69748 Don't assign to PROG; no longer needed
now that Makefile.am sets PROG to the basename.
2006-06-05 20:03:52 +00:00
Paul Eggert
0d82817eb4 (PROG): Take the basename of $$tst,
in case Solaris make has prepended the directory.
(TESTS): Adjust to test script renamings.
2006-06-05 20:03:27 +00:00
Paul Eggert
f9265a7efe * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
reported by Andreas Schwab.
2006-06-05 05:21:46 +00:00
Jim Meyering
53ca379fa3 *** empty log message *** 2006-06-03 09:04:26 +00:00
Jim Meyering
4c7979f7c2 Make `cp --link --no-dereference' work also on systems where the
link system call cannot create a hard link to a symbolic link.

(copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
the link syscall on a symlink when it would do the wrong thing.
Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
2006-06-03 09:04:22 +00:00
Jim Meyering
6293c4ae50 `cp --link --no-dereference' now works also on systems where the
link system call cannot create a hard link to a symbolic link.
2006-06-03 09:04:05 +00:00
Jim Meyering
09024704ab Test for this:
Make `cp --link --no-dereference' work also on systems where the
  link system call cannot create a hard link to a symbolic link.
  * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
  the link syscall on a symlink when it would do the wrong thing.
  Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
2006-06-03 09:03:19 +00:00
Jim Meyering
db5756af29 (TESTS): Add link-no-deref. 2006-06-03 09:02:53 +00:00
Jim Meyering
593453d7bf *** empty log message *** 2006-06-03 08:29:28 +00:00
Paul Eggert
cfa91bfde8 Fix some HP-UX 11.23 porting bugs. 2006-06-01 07:10:48 +00:00
Paul Eggert
8cf6d1850d Don't assume that >&- works. 2006-06-01 07:10:34 +00:00
Paul Eggert
42314d3303 Don't assume that >&- works. Add a /dev/full test. 2006-06-01 07:10:15 +00:00
Paul Eggert
5d3b41a84a Don't assume that \< \> works in sed. 2006-06-01 07:09:51 +00:00
Jim Meyering
558b3aacbe *** empty log message *** 2006-05-30 06:22:20 +00:00
Jim Meyering
d641a6ad5d (usage): Add `v' to the list of sorting-related options.
From Justin Pryzby.
2006-05-30 06:22:16 +00:00
Jim Meyering
90407bb522 Update from gnulib. 2006-05-29 06:55:36 +00:00
Jim Meyering
a143307078 *** empty log message *** 2006-05-28 12:12:47 +00:00
Jim Meyering
84abb198a2 Source lang-default. From Ralf Wildenhues. 2006-05-28 12:11:35 +00:00
Jim Meyering
9af6ea12a1 *** empty log message *** 2006-05-28 09:33:00 +00:00
Jim Meyering
8542aa6622 AIX 4.3.3 gives a different diagnostic.
Recognize it, too.  Reported by Ralf Wildenhues, in
http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
2006-05-28 09:32:54 +00:00
Paul Eggert
59985f42e6 (gl_C99_STRTOLD): Use a link test rather than a
compile test, for Tru64 4.0D.
2006-05-28 09:16:57 +00:00
Jim Meyering
9602351980 *** empty log message *** 2006-05-28 09:03:12 +00:00
Jim Meyering
fe7323d6cf *** empty log message *** 2006-05-28 09:02:42 +00:00
Jim Meyering
206844c0c4 *** empty log message *** 2006-05-27 15:51:23 +00:00
Jim Meyering
837d12dd60 Use `AM_MAKEINFOFLAGS' rather than
overwriting `MAKEINFO', so that `missing' can do its job.
2006-05-27 15:51:19 +00:00
Jim Meyering
17fc4cd8ab *** empty log message *** 2006-05-27 15:13:35 +00:00
Jim Meyering
3dc0c35710 *** empty log message *** 2006-05-27 15:12:05 +00:00
Jim Meyering
df91a82135 chgrp now supports --preserve-root, --no-preserve-root 2006-05-27 15:01:36 +00:00
Jim Meyering
6f12bb8b21 *** empty log message *** 2006-05-27 15:00:22 +00:00
Jim Meyering
d3ff52d9e2 *** empty log message *** 2006-05-27 14:44:44 +00:00
Jim Meyering
19c28b06a0 Support new options: --preserve-root and --no-preserve-root.
Somehow this program was skipped when those options were added to chown,
chmod, and rm.  Reported by vaqflabuopac@spammotel.com in
<http://bugs.debian.org/365656>.
2006-05-27 14:44:41 +00:00
Jim Meyering
83e40cc849 *** empty log message *** 2006-05-27 13:43:12 +00:00
Jim Meyering
35e7e45ccd (check-texinfo): Use literal `{' only in brackets, i.e., [{] or [}],
to avoid triggering an error from Solaris 2.6's grep.
2006-05-27 13:43:07 +00:00
Jim Meyering
ff2009280e *** empty log message *** 2006-05-27 13:32:10 +00:00
Jim Meyering
b854d91281 Use $(EGREP)' instead of grep -E'. 2006-05-27 13:32:04 +00:00
Paul Eggert
e9eb2ad579 (small_open, large_open): New macros.
(__open, __open64) [!_LIBC]: Remove.
(__gen_tempname): Use small_open and large_open instead of __open
and __open64.  This fixes a portability bug on HP-UX 11.11i
reported by Simon Wing-Tang in
<http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
2006-05-25 21:57:22 +00:00
Paul Eggert
32cea0d8ae Remove mention of --seed. 2006-05-25 16:48:05 +00:00
Paul Eggert
5002b0ba79 (usage): Remove mention of --seed. 2006-05-25 16:47:43 +00:00
Jim Meyering
066e22e537 *** empty log message *** 2006-05-24 07:35:32 +00:00
Jim Meyering
850b999dbb Require autoconf-2.59d, for its fixed version
of AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK.
2006-05-24 07:35:28 +00:00
Paul Eggert
8ebe82ae29 Fix misspelling. 2006-05-23 07:48:31 +00:00
Paul Eggert
bd52082675 Note problem with string.h. 2006-05-23 07:48:12 +00:00
Paul Eggert
41f08b2239 filemode.c: Don't include <string.h>. 2006-05-23 07:47:51 +00:00
Paul Eggert
82008e43bd Don't include <string.h>; this include was
inadvertantly put into the previous patch.
2006-05-23 07:47:32 +00:00
Paul Eggert
c512471974 * filemode.c (setst): Remove.
(strmode): Rewrite to avoid setst.  This makes the code shorter,
(arguably) clearer, and the generated code is a bit smaller on my
Debian GNU/Linux stable x86 host.
2006-05-22 20:11:45 +00:00
Paul Eggert
900b6598d1 Document the internals better. Most of this change
was written by Bruno Haible.
2006-05-22 18:01:48 +00:00
Jim Meyering
d523a83be5 *** empty log message *** 2006-05-21 22:04:34 +00:00
Jim Meyering
3e3aff9926 *** empty log message *** 2006-05-20 22:18:20 +00:00
Jim Meyering
8fb9de41d5 (fts_open): Fail with EINVAL if a caller violates this rule:
Either FTS_LOGICAL or FTS_PHYSICAL must be provided to the
fts_open() function.
2006-05-20 22:18:16 +00:00
Jim Meyering
6776bb7d30 *** empty log message *** 2006-05-20 19:00:46 +00:00
Jim Meyering
ae5d9079f9 (main): Use FTS_PHYSICAL here, too. 2006-05-20 17:27:07 +00:00
Jim Meyering
20c78772b3 *** empty log message *** 2006-05-20 07:20:03 +00:00
Jim Meyering
c58e7ee1cc (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
and arrange for -D to set fts' FTS_PHYSICAL bit as well as
FTS_COMFOLLOW.  Spotted by Justin Pryzby.
2006-05-20 07:19:53 +00:00
Jim Meyering
c11a92383d *** empty log message *** 2006-05-19 22:30:55 +00:00
Jim Meyering
ccea9e8650 Merge changes from automake, retaining the ""--to...
kludge to placate overzealous `make distcheck' check.
2006-05-19 22:30:27 +00:00
Paul Eggert
86873e5082 Sync nanosleep from gnulib. 2006-05-19 18:03:25 +00:00
Jim Meyering
7e9a2a1429 *** empty log message *** 2006-05-19 12:36:36 +00:00
Jim Meyering
4e5f6a5b5e (main): Don't let -D, -L, or -P turn off the internal
FTS_TIGHT_CYCLE_CHECK directory traversal option.
Reported by Justin Pryzby in http://bugs.debian.org/367691
2006-05-19 12:36:18 +00:00
Jim Meyering
197f7d766e mention cp -p vs. no-/proc fix 2006-05-16 17:27:04 +00:00
Jim Meyering
e06a5a5cc7 (usage): Correct description of -a: s/-dpR/-dpPR/. From Tomas Pospisek. 2006-05-15 20:19:02 +00:00
Jim Meyering
58f42eb607 *** empty log message *** 2006-05-15 20:18:49 +00:00
Jim Meyering
db19f3df8b *** empty log message *** 2006-05-15 13:28:28 +00:00
Jim Meyering
212ffe61af (xfts_open): Always use FTS_CWDFD. 2006-05-15 13:28:24 +00:00
Jim Meyering
06918c9589 *** empty log message *** 2006-05-15 10:59:15 +00:00
Jim Meyering
63deb75831 Avoid the expense of an fstat, when possible.
(O_NOFOLLOW, STREQ): Define.
(diropen_fd): Remove function.  Merge it into sole caller...
(diropen): ...here.  Use O_NOFOLLOW when appropriate.
(fts_safe_changedir): Call fstat for dev/inode check, only if the
previous open/openat call may have opened the wrong directory.
2006-05-15 10:59:10 +00:00
Jim Meyering
ad17714291 *** empty log message *** 2006-05-15 10:00:30 +00:00
Jim Meyering
7729ee5e68 Restore the parts of fts that were removed on 2006-01-17, so that
it's easier for legacy applications designed for the version
of fts in glibc or BSD to convert to this more robust version.
Add a new mode, FTS_CWDFD, by which to enable the improved
(openat- based -- aka no-chdir) semantics.

* fts_.h (FTS_CWDFD): Define.  Callers must use this fts_open
option to enable the more robust behavior.
(FTS_OPTIONMASK): Widen accordingly.
* fts.c: Restore removed code, reverting the default behavior.
2006-05-15 10:00:16 +00:00
Paul Eggert
48138763f0 (AC_HEADER_STDBOOL): Fix overly-picky
test for C99 conformance; (bool) 0.5 is an integer constant
expression, but (bool) -0.5 is not.  Problem reported by Fedor
Sergeev in <http://forum.sun.com/jive/thread.jspa?threadID=96202>.
2006-05-15 03:17:08 +00:00
Jim Meyering
3c51d8f36f *** empty log message *** 2006-05-13 08:41:37 +00:00
Jim Meyering
4e4cb620fb *** empty log message *** 2006-05-13 08:41:06 +00:00
Jim Meyering
9f1c534949 Test two more cases. 2006-05-13 08:41:02 +00:00
Jim Meyering
b54dfec827 update from gnulib 2006-05-12 07:18:08 +00:00
Jim Meyering
0e3dfb2439 *** empty log message *** 2006-05-11 19:44:47 +00:00
Jim Meyering
3b136eec7b (sha1_buffer): Correct comment: s/MD5/SHA1/. From James Lemley. 2006-05-11 19:44:42 +00:00
Jim Meyering
03b02874a7 . 2006-05-11 08:58:23 +00:00
Jim Meyering
ccafe4292f Mention that:
mv -T DIR EMPTY_DIR no longer fails unconditionally
2006-05-11 08:57:45 +00:00
Jim Meyering
5a55ecfac3 *** empty log message *** 2006-05-11 08:57:32 +00:00
Jim Meyering
af5ca358b9 *** empty log message *** 2006-05-11 08:55:08 +00:00
Jim Meyering
156459c2f5 mv -T DIR EMPTY_DIR no longer fails
(copy_internal): Don't manually prohibit a move where
the destination is an existing directory.  Sometimes doing that is
valid.  Let the rename system call enforce the rules.  That is
allowed only when the source is a directory and the destination
directory (to be replaced) is empty.  Reported by Eric Blake.
2006-05-11 08:55:04 +00:00
Jim Meyering
8ebce3d9a5 *** empty log message *** 2006-05-11 08:54:30 +00:00
Jim Meyering
54d36f3dc2 (TESTS): Add no-target-dir. 2006-05-11 08:54:23 +00:00
Jim Meyering
b7c2ae47f0 ensure that mv did what it's supposed to 2006-05-11 08:18:34 +00:00
Jim Meyering
96a2e1be04 . 2006-05-11 07:53:25 +00:00
Jim Meyering
c70ad7aa27 *** empty log message *** 2006-05-11 07:51:17 +00:00
Jim Meyering
6ccf57e3b9 (TESTS): Add atomic. 2006-05-11 07:51:05 +00:00
Jim Meyering
40b5d67c1f New file/test for yesterday's fix. 2006-05-11 07:50:55 +00:00
Jim Meyering
f79fbe2212 *** empty log message *** 2006-05-11 07:33:10 +00:00
Jim Meyering
f1d1ee9121 (copy_internal): Don't explicitly unlink the destination
when moving a symlink into the place of an existing non-directory.
Reported by Joshua Hudson.
2006-05-11 07:33:00 +00:00
Jim Meyering
029057a361 Avoid harmless `ambiguous redirect' diagnostic. 2006-05-11 07:29:53 +00:00
Jim Meyering
6dd69d3281 *** empty log message *** 2006-05-10 13:39:30 +00:00
Jim Meyering
b8b7669b3e update from gnulib 2006-05-08 07:22:19 +00:00
Jim Meyering
d4d3446bab (patch-check): Correct reversed sense of `test -s' test.
Work around the fact that patch always outputs `patching file ...'.
2006-05-07 17:46:57 +00:00
Jim Meyering
6af864de67 *** empty log message *** 2006-05-07 17:25:25 +00:00
Jim Meyering
194a26ac5c *** empty log message *** 2006-05-07 17:21:01 +00:00
Jim Meyering
c8a85eda8c Adjust to reflect new offsets. 2006-05-07 17:20:49 +00:00
Jim Meyering
f7e3e90916 mention the df fix of 2006-01-24 2006-05-07 15:53:25 +00:00
Jim Meyering
89745f895e mention the df improvement from 2006-01-24 2006-05-07 15:37:38 +00:00
Jim Meyering
afbf453a82 *** empty log message *** 2006-05-06 21:09:35 +00:00
Jim Meyering
a44d1cdd38 *** empty log message *** 2006-05-06 18:56:46 +00:00
Jim Meyering
e0beb8aab5 mention the shred-segfault fix 2006-05-06 16:03:20 +00:00
Jim Meyering
23e6a454b4 remove stray stat-related line 2006-05-06 16:01:39 +00:00
Jim Meyering
9980147451 . 2006-05-06 15:52:56 +00:00
Jim Meyering
f3e78aa999 *** empty log message *** 2006-05-06 15:44:25 +00:00
Jim Meyering
cc86eaf147 Expand to test broken links encountered
implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
2006-05-06 15:44:19 +00:00
Jim Meyering
b68ddecba7 Expand to test inode from readdir case. 2006-05-06 15:44:01 +00:00
Jim Meyering
439be6d613 *** empty log message *** 2006-05-06 15:29:49 +00:00
Jim Meyering
1cf31b9cb6 (TESTS): Add stat-vs-dirent. 2006-05-06 15:29:44 +00:00
Jim Meyering
c5a425ef3d *** empty log message *** 2006-05-06 15:29:20 +00:00
Jim Meyering
8840dfb071 *** empty log message *** 2006-05-06 15:27:38 +00:00
Jim Meyering
7704c7d7cb *** empty log message *** 2006-05-06 14:23:38 +00:00
Jim Meyering
29f7820bba Work even on case-insensitive file system. 2006-05-06 14:23:31 +00:00
Jim Meyering
aa02687360 *** empty log message *** 2006-05-06 14:17:31 +00:00
Jim Meyering
8b13a959ae (gl_GETADDRINFO): Fix caching error. 2006-05-06 14:17:21 +00:00
Jim Meyering
b5497557d3 update from gnulib 2006-05-05 18:51:44 +00:00
Jim Meyering
06ba3a2237 *** empty log message *** 2006-05-04 12:55:54 +00:00
Jim Meyering
d98da55f1d (Examples of date): Give example of @seconds. 2006-05-04 12:55:08 +00:00
Jim Meyering
72049d2e2e *** empty log message *** 2006-05-04 10:33:39 +00:00
Jim Meyering
db0ab05030 *** empty log message *** 2006-05-04 10:02:54 +00:00
Jim Meyering
6c63d830b4 *** empty log message *** 2006-05-04 10:01:43 +00:00
Jim Meyering
aac1ddf240 mention pwd fix 2006-05-04 10:00:40 +00:00
Paul Eggert
c1f85fb9e1 (head invocation, tail invocation, sort invocation):
Give advice about porting to hosts that support only obsolete syntax.
2006-05-03 23:10:04 +00:00
Jim Meyering
b400a630ae Include "same-inode.h". 2006-05-03 10:13:07 +00:00
Jim Meyering
c139c9a58b . 2006-05-03 10:11:25 +00:00
Jim Meyering
1e4bc06b2e *** empty log message *** 2006-05-03 10:11:05 +00:00
Jim Meyering
c37b81a6fa *** empty log message *** 2006-05-03 10:10:00 +00:00
Jim Meyering
1f350a9d34 (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
Use better macro parameter names: s/basename/key_name/,
s/basefunc/key_cmp_func.  Fix typo in comment.
2006-05-03 10:07:36 +00:00
Jim Meyering
a99440c4ee (main): On systems with d_type, directories_first only
implies format_needs_type, not format_needs_stat.
2006-05-03 10:03:58 +00:00
Jim Meyering
f0562bdf48 (xstrcoll_df_version, rev_xstrcoll_df_version): Add space after comma
in arg list, from Eric Blake.
2006-05-03 09:36:03 +00:00
Paul Eggert
972d0198a9 (get_date): When adding relative date, start with the
initial time, not with the result of the first mktime call.
2006-04-25 10:29:47 +00:00
Paul Eggert
dfef85e753 (relative-3): New test, derived from a bug report by John Thomas McDole. 2006-04-25 10:29:10 +00:00
Paul Eggert
9f0b994993 Remove typo in previous checkin. 2006-04-24 17:51:56 +00:00
Paul Eggert
d02ad57764 * unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Use prototype
to define main with arguments, for C++.  Reported by Eric Blake.
* c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC):
Prefer 'int main ()' to 'int main (void)', for C++.
* getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* fsusage.m4 (gl_FILE_SYSTEM_USAGE): Specify a return type
for 'main', for C99 and C++.
2006-04-24 17:50:24 +00:00
Paul Eggert
779532f556 Don't assume that 'exit' is declared for us.
Don't assume that you can exit with status -1.
(import from gnulib)
2006-04-24 07:40:00 +00:00
Jim Meyering
79aba863ce *** empty log message *** 2006-04-23 21:48:27 +00:00
Jim Meyering
02207e6a72 *** empty log message *** 2006-04-23 21:47:00 +00:00
Jim Meyering
972fa947d1 (Which files are listed): Describe new option: --group-directories-first. 2006-04-23 21:46:54 +00:00
Jim Meyering
db6a912f8c [New features]: Mention ls's new option, --group-directories-first 2006-04-23 21:38:32 +00:00
Jim Meyering
513c5ec411 (sort_type): Rearrange to use as an array index when
choosing sort function; added new sort_numtypes member for
compile-time check.
(time_type): Add new time_numtypes member for compile-time check.
(directories_first): New global variable.
(GROUP_DIRECTORIES_FIRST_OPTION): New enum.
(long_options): Add --directories-first.
(main): Support new option.
(is_directory): New function.
(extract_dirs_from_files): Use it.
(DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
(LIST_SORTFUNCTION_VARIANTS): New macros.
(sort_functions): New global variable.
(sort_files): Use it.
(usage): Document new option.
2006-04-23 21:35:04 +00:00
Paul Eggert
5bbcc061d8 Change 'shred' to not use alloca. 2006-04-19 06:28:11 +00:00
Paul Eggert
43d487b711 (fillrand): The assertion was way too weak, due to
what must be a typo.  Strengthen it to its intended value.
(dopass): Don't use alloca; it's not worth the aggravation here,
since it's used only to get a page-aligned buffer, and page
alignment doesn't buy us much here.  I'm suspicious that alloca
causes problems on some hosts, due to a recent bug report by Adam
Waltman.
2006-04-19 06:27:43 +00:00
Jim Meyering
f3bacff51f *** empty log message *** 2006-04-18 14:59:27 +00:00
Jim Meyering
332498c318 Add new programs, base64, sha224sum, sha256sum, sha384sum, sha512sum. 2006-04-18 14:59:22 +00:00
Paul Eggert
ae5252e393 Document filemode changes. 2006-04-17 23:24:49 +00:00
Paul Eggert
d918aff890 (human_access): Use (new) filemodestring rather than
(old) mode_string, so that we get more file types right, at least
in theory.  Adjust to filemode changes.
2006-04-17 23:23:43 +00:00
Paul Eggert
58d7770a00 (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
(print_long_format): Use (new) filemodestring rather than
(old) mode_string, so that we get more file types right, at least
in theory.  Adjust to filemode changes.
2006-04-17 23:23:11 +00:00
Paul Eggert
137de3d3b6 (describe_change): Adjust to filemode changes. 2006-04-17 23:22:51 +00:00
Paul Eggert
54cf93b996 (gl_FILEMODE): Check for strmode declaration. 2006-04-17 23:22:16 +00:00
Paul Eggert
99277ba7c6 Don't undef S_ISDOOR, since it's never buggy.
(S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
(S_ISPORT, S_ISWHT): New macros, if not already defined.
2006-04-17 23:22:01 +00:00
Paul Eggert
dc536fbed1 (HAVE_DECL_STRMODE): Include <string.h> for strmode.
(strmode): Renamed from mode_string.
(filemodestring): New decl.
2006-04-17 23:21:30 +00:00
Paul Eggert
ac2d45ce67 Include "filemode.h" first, to test the interface.
Assume that filemode.h includes sys/types.h and sys/stat.h.
(HAVE_ST_DM_MODE): New macro, moved here from ls.c.
(ftypelet): Reorder to put common cases first, for efficiency.
Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
to do 'M'.
(strmode): Renamed from mode_string, and now stores 12 bytes instead
of 10, for compatibility with FreeBSD.  All callers changed.
(filemodestring): Now stores 12 bytes instead of 10, and sets file types
that can't be deduced solely from st_mode.  First arg is now a const
pointer.
2006-04-17 23:21:14 +00:00
Paul Eggert
79cbf5925c (What information is listed): Add P for Solaris
10 ports.  Add commented-out entries for other types that POSIX
says are possible, or that I observed in FreeBSD documentation.
2006-04-17 23:20:53 +00:00
Jim Meyering
3280967bdb *** empty log message *** 2006-04-17 23:17:16 +00:00
Jim Meyering
1cdde80263 (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
ignore file.  This has never been enabled.  Reported by Eric Blake.
2006-04-17 23:17:11 +00:00
Jim Meyering
e4e04491a0 *** empty log message *** 2006-04-17 23:14:57 +00:00
Jim Meyering
0c13c770e3 (Input processing in ptx): Remove mention of the
default --ignore file, /usr/local/lib/eign.  That file has never been used.
Reported by Eric Blake.
2006-04-17 23:14:45 +00:00
Jim Meyering
58fab28670 *** empty log message *** 2006-04-17 21:07:53 +00:00
Jim Meyering
415dddb568 *** empty log message *** 2006-04-17 20:53:20 +00:00
Paul Eggert
ade4e95345 (openat_needs_fchdir) [defined __OPENAT_PREFIX]:
Turn this into a macro that always returns true.
2006-04-17 20:48:23 +00:00
Paul Eggert
39448a239a (futimens): glibc futimesat messes up if /proc isn't mounted. 2006-04-15 07:39:46 +00:00
Jim Meyering
ca094485f9 *** empty log message *** 2006-04-14 20:33:42 +00:00
Jim Meyering
52f9cd6688 remove SPACEs before TAB 2006-04-14 16:36:34 +00:00
Jim Meyering
ea26299816 *** empty log message *** 2006-04-14 16:35:44 +00:00
Jim Meyering
47d0eb8722 (fts_open): Don't allocate parent if *argv==NULL. Patch from glibc. 2006-04-14 16:35:41 +00:00
Jim Meyering
8085d02998 (fts_build): Free `head' before returning NULL, in two places,
to avoid leaks.  Patch from glibc.
2006-04-14 16:26:15 +00:00
Jim Meyering
d657c35562 (fts_build): Remove just-#if-0'd code and the code that
declares and sets cderrno.
2006-04-14 16:21:21 +00:00
Jim Meyering
091c012089 (fts_build): #if-0-out a block of unused code. Patch via glibc. 2006-04-14 16:11:01 +00:00
Paul Eggert
52bb8bdd10 Don't use wchar_t or wctype_t; update comment. 2006-04-13 22:17:17 +00:00
Paul Eggert
3125c35bc7 (RE_DUP_MAX): Update comment to match current implementation. 2006-04-13 22:16:58 +00:00
Paul Eggert
372285b207 (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
2006-04-13 22:16:43 +00:00
Paul Eggert
eeac99af71 (What information is listed): Document 'ls' type letters. 2006-04-13 04:01:47 +00:00
Paul Eggert
e0637b5b68 Port to Interix. 2006-04-12 20:15:30 +00:00
Paul Eggert
00e67bf028 (sync) [!HAVE_SYNC]: New macro. 2006-04-12 20:15:08 +00:00
Paul Eggert
eda15d7cca (USE_STATVFS): New macro.
Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
(NAMEMAX_FORMAT): define a bit more clearly, now that the
statvfs-using code is a bit more regular.
2006-04-12 20:14:42 +00:00
Paul Eggert
2e16cd4302 (main) [! HAVE_SETGROUPS]: Don't call setgroups. 2006-04-12 20:14:19 +00:00
Paul Eggert
e26a29be00 (linkfunc): Remove. This method ran into a compiler/linker
bug in Interix.  Just call symlink or link directly.  All uses changed.
2006-04-12 20:14:01 +00:00
Paul Eggert
cec6e43aae (gl_MACROS): Check for setgroups and sync, since they
are not in Interix.
2006-04-12 20:13:34 +00:00
Paul Eggert
2fc455e2d5 Include <inttypes.h> and <stdint.h> if they exist. 2006-04-12 20:13:13 +00:00
Paul Eggert
368bc94656 Don't include <inttypes.h> or <stdint.h>, since
fsusage.h now does that.  Include fsusage.h first, to test interface.
Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
at most one method (the old code could have generated decls that
didn't conform to C89, not that this was ever exercised).
2006-04-12 20:13:00 +00:00
Paul Eggert
dfe1ede00d csplit, nl, expr now conform to POSIX better, and are
more-compatible with traditional Unix, with respect to regular
expressions.
2006-04-12 07:49:34 +00:00
Paul Eggert
ce1f8e6ecd (expr invocation): expr exit status is 3 only for
internal errors now; 2 is also for invalid values in expressions.
2006-04-12 07:47:11 +00:00
Paul Eggert
7e17831f0a Clear the RE_NO_EMPTY_RANGES re syntax option, as this is a less intrusive
change from the old (Emacs) behavior, and POSIX allows us to treat [z-a]
as an empty range.
2006-04-12 07:37:11 +00:00
Paul Eggert
79b051c610 expr, csplit, nl patches to conform better to POSIX and/or traditional
behavior.  Port tests to Solaris 8.
2006-04-12 07:18:11 +00:00
Paul Eggert
93305ed5f9 Use \{...\} in test RE, to test that we're conforming to POSIX. 2006-04-12 07:17:26 +00:00
Paul Eggert
661b506c3d (fail-a): Adjust exit status to match new expr behavior, for status 2 versus 3.
(anchor): New test.
(bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
(bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
(bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
(bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
(bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
(bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
(bre61, bre62): New tests.
2006-04-12 07:17:02 +00:00
Paul Eggert
110970f622 (docolon): Set re_syntax_options to a value that is compatible with
what POSIX requires.  Also, don't let anchors match
newline; this fixes an incompatibility with tradition and with POSIX.
Don't warn about leading ^.  POSIX says it is unspecified whether
^ is a special character, which means that implementations can
either treat it as special or not, but either way a warning is not
allowed (unless the regexp is otherwise invalid).  Instead, anchor
the expression but treat ^ as an anchor; this is the traditional
behavior (e.g., Solaris 10).
(eval4, eval3, eval2): Treat non-numeric args, division by zero,
and the like as invalid expressions (exit status 2), not as
failure of 'expr' (exit status 3).  This is more consistent with
how Solaris behaves.
2006-04-12 07:16:20 +00:00
Paul Eggert
6fd9c6f98e (build_type_arg): Set re_syntax_options to a value that is compatible
with what POSIX requires.
2006-04-12 07:15:21 +00:00
Paul Eggert
2a75bb4ae0 (extract_regexp): Set re_syntax_options to a
value that is compatible with what POSIX requires.
2006-04-12 07:14:53 +00:00
Paul Eggert
f666da6f32 (gl_TIME_R): Add AC_LIBSOURCES for time_r.c and time_r.h. 2006-04-12 07:11:52 +00:00
Paul Eggert
1ff52c6a54 Do not assume that 'sed' can handle long, newline-free input.
Evaluate expr once, not $n times.
2006-04-12 07:07:55 +00:00
Paul Eggert
0dfc08bf3a Solaris 8 sh doesn't understand "if !". Do not assume that 'sed' can
handle long, newline-free input.
2006-04-12 07:07:32 +00:00
Paul Eggert
9066275509 Adjust to new regex.h API (with new fastmap type), and clean
up the regex storage allocation a bit.
2006-04-11 00:52:16 +00:00
Paul Eggert
1f1ff10b0c (compiled_separator_fastmap): New ver.
(main): Use it.  Don't bother allocating a buffer.
2006-04-11 00:52:01 +00:00
Paul Eggert
8745735aaf (context_regex_string, word_regex_string): Remove.
(context_regex, word_regex): New vars, replacing the above.
All uses changed.
(struct regex_data): New type.
(compile_regex): Renamed from alloc_and_compile_regex, since
we no longer allocate storage.  Arg is now a struct regex_data *,
not a const char *.  All uses changed.  Don't allocate the fastmap;
instead, take it from the caller.  Don't convert size_t to int,
to avoid arithmetic overflow problems.  Don't bother freeing
storage afterwards; it's not worth the aggravation.
2006-04-11 00:51:42 +00:00
Paul Eggert
fad52643e0 (body_fastmap, header_fastmap, footer_fastmap):
New vars.
(build_type_arg): New fastmap arg.  All uses changed.
Don't bother allocating a buffer, but set a fastmap.
2006-04-11 00:51:23 +00:00
Paul Eggert
2a124564c7 (docolon): Allocate and use a fastmap.
Don't bother allocating a buffer.
2006-04-11 00:50:56 +00:00
Paul Eggert
87bd526828 Update copyright year. 2006-04-11 00:50:33 +00:00
Paul Eggert
ff652937b0 (struct control): Put re_compiled member at the
end, since it's large.  Change regexpr member from char * to bool;
all uses changed.  Add new member fastmap.
(extract_regexp): regexp arg is now char const *, not char *.
Don't bother duplicating the regular expression; it's not needed.
Set fastmap from new fastmap member.  Don't bother allocating
a buffer, as the regexp code does a better job than we do.
2006-04-11 00:49:59 +00:00
Jim Meyering
ba75c95164 remove useless spaces before TABs 2006-04-10 19:15:08 +00:00
Paul Eggert
72021730a8 Import latest regex module from gnulib. 2006-04-10 06:46:07 +00:00
Paul Eggert
1fe38016fa Add 'hostid' to System context menu line. 2006-04-09 07:55:05 +00:00
Paul Eggert
dd175a9f41 (Top): Fix typo in System context menu entry: hostid wasn't mentioned. 2006-04-09 07:52:33 +00:00
Jim Meyering
38433b219d (iwrite): Remove assignment without effect.
Reported by Felix Rauch Valenti.
2006-03-30 13:47:57 +00:00
Jim Meyering
568eec4a9d *** empty log message *** 2006-03-30 13:26:59 +00:00
Jim Meyering
6809ff6910 *** empty log message *** 2006-03-28 09:48:26 +00:00
Jim Meyering
b1aecc319f (General options in ptx): Undocument --copyright. 2006-03-28 09:48:15 +00:00
Jim Meyering
2fdcdc90f0 *** empty log message *** 2006-03-28 09:47:56 +00:00
Jim Meyering
1ae249fba2 (usage): Remove mention of --copyright/-C.
(main): Alias --copyright to --version plus a deprecation warning.
2006-03-28 09:47:28 +00:00
Jim Meyering
5378e090da deprecate ptx's --copyright (-C) option 2006-03-28 09:46:38 +00:00
Jim Meyering
4e5755ff74 *** empty log message *** 2006-03-27 14:08:04 +00:00
Jim Meyering
ce88154fd8 (dirname invocation): Macro in previous patch was too broad. 2006-03-27 14:08:00 +00:00
Jim Meyering
120d34efe1 version: 5.94 2006-03-27 10:30:34 +00:00
Jim Meyering
c5e8364536 . 2006-03-27 07:35:23 +00:00
Jim Meyering
20e2d352c0 (uptime_LDADD): Add $(POW_LIB), for uptime's use of strtod.
Tiny patch from Nickolai Zeldovich.
2006-03-27 07:34:48 +00:00
Jim Meyering
1c952c4d7d *** empty log message *** 2006-03-27 07:32:44 +00:00
Jim Meyering
a35fc49153 . 2006-03-26 12:33:28 +00:00
Jim Meyering
fa9be79b41 *** empty log message *** 2006-03-26 12:30:45 +00:00
Jim Meyering
3c7ab9f144 (gl_DIRNAME): Use gl_DOUBLE_SLASH_ROOT. 2006-03-26 12:30:37 +00:00
Jim Meyering
d5a462a196 (FILE_SYSTEM_PREFIX_LEN): Move from here to dirname.h.
(FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): New define.
2006-03-26 12:30:07 +00:00
Jim Meyering
665ede556d new file from Eric Blake 2006-03-26 12:22:44 +00:00
Jim Meyering
864c4c28af *** empty log message *** 2006-03-26 12:20:59 +00:00
Jim Meyering
8773d59d55 (base_name): New semantics - malloc the result.
Preserve // when it is special.
Preserve relative files that look like drive letters.
(base_len): Preserve // when it is special.
(last_component): New method, similar to old base_name semantics.
2006-03-26 12:20:46 +00:00
Jim Meyering
8132c6e76e (dir_len): Determine when drive letters need a subsequent slash.
Preserve // when it is special.
(dir_name): Don't append dot when drive letter is absolute.
[TEST_DIRNAME]: Move into a full-blown gnulib test.
2006-03-26 12:20:24 +00:00
Jim Meyering
ba0f1e7d7f (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
[FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a drive prefix.
(IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
(last_component): New method.
2006-03-26 12:20:06 +00:00
Jim Meyering
7029f979e5 (strip_trailing_slashes): Use last_component, not base_name.
Strip redundant slashes from ///.
2006-03-26 12:18:51 +00:00
Jim Meyering
cb916337dc (file_name_concat): s/base_name/last_component/ 2006-03-26 12:16:11 +00:00
Jim Meyering
bfbe80d004 (check_extension, numbered_backup): s/base_name/last_component/ 2006-03-26 12:15:59 +00:00
Jim Meyering
4ecf233b95 (same_name): s/base_name/last_component/ 2006-03-26 12:14:16 +00:00
Jim Meyering
ee660c455a (basename invocation, dirname invocation):
Improve documentation to match recent // patches.
2006-03-26 12:11:40 +00:00
Jim Meyering
bbee8a57b0 *** empty log message *** 2006-03-26 12:09:09 +00:00
Jim Meyering
0ad9592c12 *** empty log message *** 2006-03-26 12:08:27 +00:00
Jim Meyering
1225a53068 (log_su, run_shell): Use new last_component, in place of base_name. 2006-03-26 12:08:20 +00:00
Jim Meyering
b828255717 (next_file_name): Use new last_component, in place of base_name. 2006-03-26 12:08:10 +00:00
Jim Meyering
d4d9a40b82 (wipename): Use new last_component, in place of base_name. 2006-03-26 12:07:59 +00:00
Jim Meyering
0cabfe4b6d (rm_1): Use new last_component, in place of base_name. 2006-03-26 12:07:47 +00:00
Jim Meyering
00f103b6d1 (target_directory_operand, movefile): Use new last_component, in place of base_name. 2006-03-26 12:07:34 +00:00
Jim Meyering
811ecf9284 (basename_is_dot_or_dotdot): Use new last_component, in place of base_name. 2006-03-26 12:07:20 +00:00
Jim Meyering
02b8c9a452 (target_directory_operand, main): Use new last_component, in place of base_name. 2006-03-26 12:07:04 +00:00
Jim Meyering
9c3afb4a64 (target_directory_operand, install_file_in_dir): Use new last_component, in place of base_name. 2006-03-26 12:06:45 +00:00
Jim Meyering
a1935760e5 (guess_shell_syntax): Use new last_component. 2006-03-26 12:06:05 +00:00
Jim Meyering
c3965052fe (target_directory_operand): Use new last_component.
(ASSIGN_BASENAME_STRDUPA): Likewise.  Reduce time spent
traversing the string.
2006-03-26 12:05:51 +00:00
Jim Meyering
a9e9c226da (main): Don't strip suffix from file system roots. 2006-03-26 11:59:58 +00:00
Jim Meyering
ba3419a626 Improvements to dirname/basename handling on platforms like
cygwin with distinct // and with drive letters.
2006-03-26 11:59:31 +00:00
Jim Meyering
a538c18d7a (AC_CONFIG_FILES): Remove tests/basename. 2006-03-26 11:58:57 +00:00
Jim Meyering
fdecd2cfcd . 2006-03-26 11:56:09 +00:00
Jim Meyering
82142e155d remove this entire directory 2006-03-26 11:55:38 +00:00
Jim Meyering
06ada66861 remove this entire directory 2006-03-26 11:54:50 +00:00
Jim Meyering
1f16c42214 (SUBDIRS): Remove basename. 2006-03-26 11:52:47 +00:00
Jim Meyering
8ebb9e3154 (TESTS): Sort. Add basename, dirname. 2006-03-26 11:48:19 +00:00
Jim Meyering
1a032f1114 new file -- from Eric Blake 2006-03-26 11:47:51 +00:00
Jim Meyering
c170f9ca79 Move to ../misc/basename 2006-03-26 11:47:24 +00:00
Jim Meyering
c794482058 Moved from ../basename/basic.
Add some tests, including fixed behavior for //.
2006-03-26 11:46:46 +00:00
Paul Eggert
14c720faab (gl_REGEX): Fix a longstanding typo in the
implementation of Spencer ERE test #75 from grep 2.3.  Problem
reported by Emanuele Giaquinta.  Also, change sense of cached
variable, so that the message makes sense.
2006-03-25 09:49:24 +00:00
Paul Eggert
cd70d37ee3 (gl_REGEX): Don't insist on REG_SYNTAX_POSIX_EGREP,
REG_SYNTAX_EMACS, and REG_IGNORE_CASE.  Settle for the traditional
glibc names.
2006-03-25 09:10:28 +00:00
Jim Meyering
f6d592cbb2 version: 5.94 2006-03-25 08:43:48 +00:00
Paul Eggert
195689e7c7 (main): Ignore fd_reopen return value when ignoring input, since
we've closed input at that point so we are ignoring input.
2006-03-23 23:56:34 +00:00
Paul Eggert
7a88cb696f nohup diagnostics are now more precise, and nohup now
redirects stderr to nohup.out if stdout is closed and stderr is a tty.
2006-03-23 23:47:37 +00:00
Paul Eggert
6fe4cc7f91 Test the new nohup behavior. 2006-03-23 23:35:32 +00:00
Paul Eggert
9b109290de (main): nohup diagnostics are now more precise, and nohup now
redirects stderr to nohup.out if stdout is closed and stderr
is a tty.
2006-03-23 23:35:13 +00:00
Paul Eggert
29360166ff (nohup invocation): nohup now redirects stderr to
nohup.out if stdout is closed and stderr is a tty.
2006-03-23 23:34:42 +00:00
Paul Eggert
9f6b2d2548 nohup diagnostics are now more precise, and nohup now
redirects stderr to nohup.out if stdout is closed and stderr is a tty.
2006-03-23 23:34:22 +00:00
Jim Meyering
4de8dde339 update from gnulib 2006-03-22 15:59:58 +00:00
Jim Meyering
7cf97ab1ff *** empty log message *** 2006-03-19 18:27:55 +00:00
Jim Meyering
164d936ac2 Work even in a chroot where d_ino values for entries in "/"
don't match the stat.st_ino values for the same names.

(__getcwd): When no d_ino value matches the target inode
number, iterate through all entries again, using lstat instead.
Reported by Kenshi Muto in http://bugs.debian.org/355810.
2006-03-19 18:27:51 +00:00
Jim Meyering
e233777dbe (__getcwd): Clarify a comment.
Use memcpy in place of a call to strcpy.
2006-03-19 17:18:32 +00:00
Jim Meyering
57a06e9966 . 2006-03-17 16:41:30 +00:00
Jim Meyering
ca29b9b803 *** empty log message *** 2006-03-17 10:12:37 +00:00
Jim Meyering
9589cc5c57 (gl_REGEX): Fix typo in last change:
s/_REGEX_WIDE_OFFSETS/_REGEX_LARGE_OFFSETS/.
2006-03-17 10:07:28 +00:00
Jim Meyering
97530a0a35 remove trailing space 2006-03-17 08:35:50 +00:00
Paul Eggert
7202bc0610 regex fixes for future POSIX and --without-included-regex. 2006-03-17 07:35:25 +00:00
Paul Eggert
d01c74cabd (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
Typedef to long int, not to off_t, as POSIX will likely change
in that direction.
2006-03-17 07:33:40 +00:00
Paul Eggert
f7bc3c2bfc (gl_REGEX): Don't check for off_t, since the code
no longer needs it.  Instead, check that regoff_t is as least
as wide as ptrdiff_t.

Don't define _REGEX_WIDE_OFFSETS unless using the included regex,
so that our regex.h stays compatible with the installed regex.
This is helpful for installers who configure --without-included-regex.
Problem reported by Emanuele Giaquinta.
2006-03-17 07:33:06 +00:00
Jim Meyering
2379e76856 version: 5.94 2006-03-16 10:33:28 +00:00
Jim Meyering
bfae88c97b update from gnulib 2006-03-15 06:53:11 +00:00
Jim Meyering
09674e1952 update from gnulib 2006-03-15 06:52:39 +00:00
Jim Meyering
e22fdec364 *** empty log message *** 2006-03-12 22:52:51 +00:00
Jim Meyering
fd1628cb1c (set_author): Rename function, from preserve_author. 2006-03-12 22:52:46 +00:00
Jim Meyering
de33c6c49d . 2006-03-12 22:47:35 +00:00
Jim Meyering
c079c60598 *** empty log message *** 2006-03-12 22:21:12 +00:00
Jim Meyering
d0c89246d0 (AD_pop_and_chdir): Use new macro,
CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
2006-03-12 22:21:05 +00:00
Jim Meyering
4798c23152 *** empty log message *** 2006-03-12 22:05:59 +00:00
Jim Meyering
b1bb68d5b1 *** empty log message *** 2006-03-12 22:05:18 +00:00
Jim Meyering
435f331bee (gl_ROOT_DEV_INO): Add same-inode.h to the list. 2006-03-12 22:05:12 +00:00
Jim Meyering
f497e71465 *** empty log message *** 2006-03-12 22:03:37 +00:00
Jim Meyering
5ff988ec22 (leave_dir): If cycle-check's saved dev-ino pair matches
that of the current directory (which we're about to chdir ".." out of),
then save the dev-ino of the parent, instead.
2006-03-12 22:03:17 +00:00
Jim Meyering
ac1e215dc2 *** empty log message *** 2006-03-12 22:02:12 +00:00
Jim Meyering
275d9242ff (SAME_INODE): Remove definition. 2006-03-12 22:02:03 +00:00
Jim Meyering
fa44d25fdb Include "same-inode.h".
(CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
2006-03-12 22:01:29 +00:00
Jim Meyering
6ae28d0eb5 (SAME_INODE): Remove definition.
Include "same-inode.h", instead.
2006-03-12 21:59:55 +00:00
Jim Meyering
1ccf35a5e3 (SAME_INODE): Remove definition.
Include "same-inode.h", instead.
2006-03-12 21:59:29 +00:00
Jim Meyering
a0d7555ba0 *** empty log message *** 2006-03-12 21:50:12 +00:00
Jim Meyering
9dbfaca637 (gl_SAME): Add same-inode.h to the list. 2006-03-12 21:49:48 +00:00
Jim Meyering
34401c51f9 (gl_CYCLE_CHECK): Add same-inode.h to the list. 2006-03-12 21:48:52 +00:00
Jim Meyering
eb5f5d091d (gl_CHDIR_SAFER): Add same-inode.h to the list. 2006-03-12 20:46:36 +00:00
Jim Meyering
dc73889ce6 (SAME_INODE): New file/macro. 2006-03-12 20:45:31 +00:00
Jim Meyering
9c8902a290 *** empty log message *** 2006-03-12 20:45:10 +00:00
Jim Meyering
90be59547e (SAME_INODE): Remove definition.
Include "same-inode.h", instead.
2006-03-12 20:45:04 +00:00
Jim Meyering
801f6fc44e . 2006-03-12 19:24:52 +00:00
Paul Eggert
99db964248 Remove asctime_r, ctime_r, and let m4 specify the sources. 2006-03-12 08:07:34 +00:00
Paul Eggert
66314b605e Add time_r.m4. 2006-03-12 08:07:09 +00:00
Paul Eggert
c9d6c40b73 (gl_PREREQ): Require gl_TIME_R. 2006-03-12 08:06:49 +00:00
Paul Eggert
be8d40f7e7 (asctime_r, ctime_r): Remove. 2006-03-12 08:06:00 +00:00
Paul Eggert
9c4784e50e (libcoreutils_a_SOURCES): Remove time_r.c, time_r.h,
as this is now done in m4.
2006-03-12 08:05:22 +00:00
Paul Eggert
13431ec5b0 New file, from gnulib. 2006-03-12 08:04:42 +00:00
Jim Meyering
7384af3482 *** empty log message *** 2006-03-11 20:40:23 +00:00
Jim Meyering
28bffbc6fe (robust_getcwd): Prepend only one slash, not two. 2006-03-11 20:40:18 +00:00
Jim Meyering
76d20d82dd Fix a bug whereby a user with write access to a directory being removed
could cause the removal of that directory to fail with an erroneous
diagnostic about a directory cycle.  Reported by Vineet Chadha.

(AD_pop_and_chdir): If the directory we're about to
leave (and try to rmdir) is the one whose dev_ino is being used to
detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
2006-03-10 21:47:34 +00:00
Jim Meyering
6754d7a74f *** empty log message *** 2006-03-10 21:44:30 +00:00
Jim Meyering
b72303e7e6 mention today's rm -r fix. 2006-03-10 21:31:53 +00:00
Jim Meyering
bf46e04149 *** empty log message *** 2006-03-10 21:24:38 +00:00
Paul Eggert
90b915c863 Handle dd's file-creation flags even on file descriptors. Improve
test cases and documentation for these flags.
2006-03-08 18:58:39 +00:00
Paul Eggert
12565180f4 Add test cases for append, nofollow, directory,
and nolinks flags.  Simplify redirection to /dev/null in some cases.
2006-03-08 18:57:55 +00:00
Paul Eggert
cf40950274 (set_fd_flags): Handle file-creation flags on file
descriptors, rather than ignoring them.
2006-03-08 18:57:39 +00:00
Paul Eggert
e190228997 Document dd's new 'directory' and 'nolinks' flags. 2006-03-08 18:57:21 +00:00
Paul Eggert
c66e95f41f iflags->iflag. This fixes a typo that meant the
noatime test never tested anything.
2006-03-08 18:21:54 +00:00
Jim Meyering
4e96bd9131 *** empty log message *** 2006-03-06 15:27:56 +00:00
Jim Meyering
2810f3534b Add `SEE ALSO' references to syscalls from utilities of the same name. 2006-03-06 15:27:50 +00:00
Paul Eggert
ca6207e2f9 Describe dd, ls changes. Convert from Latin-1 to UTF-8. 2006-03-06 07:22:02 +00:00
Paul Eggert
7c7486d168 (dd invocation): New flags directory, nolinks.
Alphabetize nofollow.
2006-03-06 07:21:40 +00:00
Paul Eggert
c21aeb1bd8 (O_NOLINKS): Define to 0 if not already defined. 2006-03-06 07:20:35 +00:00
Paul Eggert
82a7e80d5b (flags, usage): New flags directory, nolinks. 2006-03-06 07:20:19 +00:00
Paul Eggert
78006af421 (usage): Mention that -f disables --color. 2006-03-06 07:02:39 +00:00
Jim Meyering
64e8ade1fa *** empty log message *** 2006-03-05 17:29:13 +00:00
Jim Meyering
103d096349 *** empty log message *** 2006-03-05 17:28:51 +00:00
Jim Meyering
2467cad537 Set SHELL, if not already set, in order to
avoid failure when `make check' is run through debuild;  dircolors
would fail due to lack of $SHELL.  Reported by Sven Joachim.
2006-03-05 17:28:42 +00:00
Jim Meyering
bda9edc1d5 . 2006-03-05 11:23:15 +00:00
Jim Meyering
0be41be0df *** empty log message *** 2006-03-05 11:20:57 +00:00
Jim Meyering
83e984547b Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
(wrap_write, do_encode, main): Change type of
parameters and locals, wrap_column, form size_t to uintmax_t.
(main): Adjust to use xstrtoumax, accordingly.
2006-03-05 11:20:53 +00:00
Jim Meyering
450dee8d8d add warning comment 2006-03-03 07:49:39 +00:00
Jim Meyering
158c715afd *** empty log message *** 2006-03-03 07:44:12 +00:00
Jim Meyering
d95fa804bb Don't fail when run from an environment with SHELL not a Bourne
shell, e.g. `env SHELL=/bin/csh make check' would fail this test.

Invoke each non-failing test with -b.
Reported by Michael Stone.
2006-03-03 07:44:02 +00:00
Paul Eggert
cdf8e464b0 Require gl_USE_SYSTEM_EXTENSIONS, not merely AC_GNU_SOURCE, for the
benefit of Solaris 10 when compiled pedantically.
2006-03-02 07:37:12 +00:00
Paul Eggert
d124b35e42 (gl_USE_SYSTEM_EXTENSIONS): Use "=" with "test", not "==". 2006-03-02 03:42:49 +00:00
Jim Meyering
79e217821d *** empty log message *** 2006-02-27 14:40:58 +00:00
Jim Meyering
91473aec4c Derive --decode-using tests from the encode-based ones. 2006-02-27 14:40:49 +00:00
Jim Meyering
bf515ddf82 Factor out a long constant string.
Split lines to stay within 80 columns.
2006-02-27 13:46:09 +00:00
Jim Meyering
d447ec607f *** empty log message *** 2006-02-27 13:40:16 +00:00
Jim Meyering
909b7b12a2 (TESTS): Add base64. 2006-02-27 13:38:42 +00:00
Jim Meyering
f291424dd9 Test base64. From Simon Josefsson. 2006-02-27 13:38:22 +00:00
Jim Meyering
96a0a0857a *** empty log message *** 2006-02-27 13:31:17 +00:00
Jim Meyering
193f1a070a (do_decode): Use correct type for parameter, ignore_garbage: s/size_t/bool/. 2006-02-27 13:31:12 +00:00
Jim Meyering
4cfd2d742b *** empty log message *** 2006-02-27 11:06:29 +00:00
Jim Meyering
f89c9d724c Add src/base64.c. 2006-02-27 11:06:27 +00:00
Jim Meyering
60fc871dcd *** empty log message *** 2006-02-27 11:03:31 +00:00
Jim Meyering
2f18c53a7b base64 comes first 2006-02-27 11:03:12 +00:00
Jim Meyering
0c0d4f5707 . 2006-02-27 10:54:09 +00:00
Jim Meyering
aeacca612b Build base64.1. 2006-02-27 10:53:49 +00:00
Jim Meyering
d3ae5ba2b4 *** empty log message *** 2006-02-27 10:52:48 +00:00
Jim Meyering
51fd587ca6 *** empty log message *** 2006-02-27 10:52:01 +00:00
Jim Meyering
0374086247 *** empty log message *** 2006-02-27 10:51:36 +00:00
Jim Meyering
021990a737 (libcoreutils_a_SOURCES): Add base64.h and base64.c. 2006-02-27 10:49:40 +00:00
Jim Meyering
a4050e7a70 Add base64 to the list. 2006-02-27 10:48:35 +00:00
Jim Meyering
1d9604cdd6 *** empty log message *** 2006-02-27 10:48:04 +00:00
Jim Meyering
f3465b0ec6 mention new program: base64 2006-02-27 10:47:56 +00:00
Jim Meyering
5c86478c19 *** empty log message *** 2006-02-27 10:47:29 +00:00
Jim Meyering
63351bf602 Add base64 section. 2006-02-27 10:47:23 +00:00
Jim Meyering
3d1be95578 (bin_PROGRAMS): Add base64. 2006-02-27 10:44:34 +00:00
Jim Meyering
6b66f12ea8 *** empty log message *** 2006-02-27 10:43:01 +00:00
Jim Meyering
b4b3e819aa (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/. 2006-02-27 10:42:36 +00:00
Jim Meyering
ee5fbeafea Don't include .h files already included by system.h:
<string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
Include "system.h" before the other lib/*.h header files.
Include <sys/types.h> before "system.h".
(wrap_write): Remove declaration of unused local, initial_column.
2006-02-27 10:41:03 +00:00
Jim Meyering
cec76053e7 *** empty log message *** 2006-02-27 10:35:37 +00:00
Jim Meyering
7561654142 (NOT_AN_INODE_NUMBER, D_INO): Define (moved here from pwd.c). 2006-02-26 10:03:17 +00:00
Jim Meyering
083f6ad61c (NOT_AN_INODE_NUMBER, D_INO): Move definitions to system.h 2006-02-26 10:02:49 +00:00
Jim Meyering
af7863c36c *** empty log message *** 2006-02-26 10:01:05 +00:00
Jim Meyering
33eb3efe9f In ls, avoid calling stat for --inode (-i), when possible.
(main): Prefer dirent.d_ino to stat when possible.
(gobble_file): Add inode argument.
(print_dir): Pass inode if available.
(usage): Remove inaccuracy.
2006-02-26 10:01:00 +00:00
Jim Meyering
256239cd3d update from gnulib 2006-02-24 20:06:29 +00:00
Jim Meyering
b16a67a7c9 *** empty log message *** 2006-02-24 07:24:24 +00:00
Jim Meyering
963120cb52 (gl_MKDIR_PARENTS): Require gl_FUNC_LCHMOD and gl_CHDIR_SAFER. 2006-02-24 07:24:18 +00:00
Jim Meyering
1bb24c3039 *** empty log message *** 2006-02-23 14:57:17 +00:00
Jim Meyering
9d9d11937b Update/correct some obsolete entries. 2006-02-23 14:57:08 +00:00
Paul Eggert
6870eeeaff (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
AT_FDCWD exceeds INT_MAX.
2006-02-21 06:42:29 +00:00
Paul Eggert
362e0d7bd1 Mention `sort -k 1b,1'. 2006-02-21 02:56:21 +00:00
Paul Eggert
0e3c5842ad (usage): Mention `sort -k 1b,1'. 2006-02-21 02:55:31 +00:00
Paul Eggert
5bc9231e76 (join invocation): Mention `sort -k 1b,1'. 2006-02-21 02:55:10 +00:00
Jim Meyering
33637fa804 *** empty log message *** 2006-02-20 16:50:14 +00:00
Jim Meyering
cdc9fa3b0c (rm invocation): Fix typo in last patch.
(paste invocation): Fix whitespace.
2006-02-20 16:50:11 +00:00
Jim Meyering
77ab7a182c Update documentation to match previous patch. 2006-02-20 16:49:27 +00:00
Jim Meyering
e8bf2b837f *** empty log message *** 2006-02-20 13:01:56 +00:00
Jim Meyering
0aed496787 (rm invocation): Document new -I option, and new --interactive behavior. 2006-02-20 13:01:51 +00:00
Jim Meyering
5db7689366 *** empty log message *** 2006-02-20 13:01:20 +00:00
Jim Meyering
3f7e0c2173 . 2006-02-20 13:00:54 +00:00
Jim Meyering
ed5113ea27 . 2006-02-20 13:00:16 +00:00
Jim Meyering
81e3b9d698 Remove entry for implementing rm -I 2006-02-20 13:00:03 +00:00
Jim Meyering
f97b02c197 New option for rm: --interactive=once (-I).
Document it, along with change to rm --interactive.
2006-02-20 12:50:38 +00:00
Jim Meyering
9d07927d52 tests for new, -I, option 2006-02-20 12:49:54 +00:00
Jim Meyering
2e1677873a (TESTS): Add interactive-always and interactive-once. 2006-02-20 12:49:14 +00:00
Jim Meyering
1a301edfc7 (INTERACTIVE_OPTION): New enum value.
(interactive_type): New enum.
(long_opts): Let interactive take an optional argument.
(interactive_args, interactive_types): New option arguments.
(usage): Document -I, --interactive=WHEN.  Use program_name
instead of a basename.
(main): New -I option, new behavior to --interactive.
[From Eric Blake]
2006-02-20 12:48:11 +00:00
Jim Meyering
da3340fab1 (usage): Use two spaces (not one) to separate the
--first-only option string from its description, so help2man formats
the derived man page properly.
2006-02-18 07:45:27 +00:00
Jim Meyering
703b835b47 *** empty log message *** 2006-02-18 07:44:22 +00:00
Jim Meyering
d6342e9352 (sc_two_space_separator_in_usage): Make the regular
expression match more of the target lines, e.g., those that start with
`-S,' (short option followed by a comma) or that include `=[...]'.
Patch by Nicolas Franois.
2006-02-18 07:40:51 +00:00
Jim Meyering
e7771c1161 (usage): Use two spaces (not one) to separate the
--first-only option string from its description, so help2man formats
the derived man page properly.
2006-02-18 07:23:05 +00:00
Jim Meyering
8c232ab86f (usage): Use two spaces (not one) to separate the
--first-only option string from its description, so help2man formats
the derived man page properly.
2006-02-18 07:21:50 +00:00
Paul Eggert
4492bcd9ef Sync from gnulib. 2006-02-16 23:34:00 +00:00
Jim Meyering
74699a2b52 *** empty log message *** 2006-02-16 23:10:27 +00:00
Jim Meyering
1ec610ba19 Include lstat.h, so that uses of lstat are converted
to uses of rpl_lstat, e.g., on Solaris 9.  Otherwise, programs like
du (which now uses the openat-enabled fts and hence fstatat) would
mistakenly fail to dereference a symlink-to-directory specified
with a trailing slash.
2006-02-16 23:10:01 +00:00
Jim Meyering
ec2631dee1 . 2006-02-16 20:39:10 +00:00
Jim Meyering
9955ae4cc5 . 2006-02-16 20:28:32 +00:00
Jim Meyering
d2462f8a1b *** empty log message *** 2006-02-15 08:51:52 +00:00
Jim Meyering
1442d8987d (alpha beta major): For `make major', ensure that the
version string is of the form N.N[.N]*, where N is one or more digits.
2006-02-15 08:51:47 +00:00
Paul Eggert
05e61daca4 Sync from gnulib. 2006-02-14 23:08:59 +00:00
Jim Meyering
83dcf2436f fix typo in diagnostic 2006-02-14 22:21:56 +00:00
Jim Meyering
6d35aa2e6e *** empty log message *** 2006-02-14 20:23:23 +00:00
Jim Meyering
907ec598fc update from gnulib 2006-02-14 20:23:07 +00:00
Jim Meyering
2ceb43fd7a update from gnulib 2006-02-14 12:27:35 +00:00
Paul Eggert
87f3f6a09a Clarify wording in the light of later comments from the Open Group
and from rms.
2006-02-13 23:30:58 +00:00
Jim Meyering
be54312178 *** empty log message *** 2006-02-13 18:29:31 +00:00
Jim Meyering
c45d1385a9 (all): Emit diagnostics to stderr, not stdout. 2006-02-13 18:29:24 +00:00
Jim Meyering
158f8bac05 *** empty log message *** 2006-02-12 15:15:32 +00:00
Jim Meyering
2f1ac790d9 (patch-check): New target.
(local-checks-available): Add to the list.
2006-02-12 15:15:06 +00:00
Jim Meyering
a3057b4382 *** empty log message *** 2006-02-12 08:48:46 +00:00
Jim Meyering
8a52d68a72 (Character sets): Don't say that an unknown
backslash-escape causes an error message -- it doesn't.
Mention that `\' also removes any special significance, so
is useful for [, ], *, -.  Prompted by Richard Neill in
http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=14937
2006-02-12 08:48:42 +00:00
Jim Meyering
398c7ab669 (Character sets): Don't say that an unknown
backslash-escape causes an error message -- it doesn't.
2006-02-12 08:41:18 +00:00
Jim Meyering
4eb8760272 fix typo in comment 2006-02-12 07:55:38 +00:00
Jim Meyering
f99aab89d3 . 2006-02-11 20:58:28 +00:00
Jim Meyering
724f97cee2 *** empty log message *** 2006-02-11 20:58:09 +00:00
Jim Meyering
0d26303c37 *** empty log message *** 2006-02-11 20:57:30 +00:00
Jim Meyering
6c71cff47b *** empty log message *** 2006-02-11 20:56:08 +00:00
Jim Meyering
29dc2a0dfc Adjust two expected diagnostics, now that they're
a tiny bit less precise: cannot remove `a/1': ... instead of
cannot open directory `a/1': ...
2006-02-11 20:55:58 +00:00
Jim Meyering
15ee70a510 . 2006-02-11 20:54:42 +00:00
Jim Meyering
048e85c751 *** empty log message *** 2006-02-11 20:53:33 +00:00
Jim Meyering
8b8f569619 *** empty log message *** 2006-02-11 20:53:01 +00:00
Jim Meyering
3d2111620b . 2006-02-11 20:52:49 +00:00
Jim Meyering
86dd36850a *** empty log message *** 2006-02-11 20:45:22 +00:00
Jim Meyering
2365901176 *** empty log message *** 2006-02-11 20:45:20 +00:00
Jim Meyering
3693f5cc94 (EXTRA_DIST): Add c99-to-c98.diff. 2006-02-11 20:45:15 +00:00
Jim Meyering
420e8bfc35 *** empty log message *** 2006-02-11 20:44:05 +00:00
Jim Meyering
abe70265ce *** empty log message *** 2006-02-11 20:43:24 +00:00
Jim Meyering
a98c1e15eb (EXTRA_DIST): Add .x-po-check. 2006-02-11 20:43:20 +00:00
Jim Meyering
afbc8353e7 *** empty log message *** 2006-02-11 20:42:27 +00:00
Jim Meyering
9754f53054 *** empty log message *** 2006-02-11 20:41:41 +00:00
Jim Meyering
db4e4b670c *** empty log message *** 2006-02-11 20:40:49 +00:00
Jim Meyering
0e58927dd9 *** empty log message *** 2006-02-11 19:25:29 +00:00
Jim Meyering
8bb7d21a7c Bug fix:
rm -r must remove an empty directory, even if it is inaccessible.
2006-02-11 19:25:26 +00:00
Jim Meyering
3b79c6d912 rm -r must remove an empty directory, even if it is inaccessible.
(close_preserve_errno): New function.
(fd_to_subdirp): Don't print a diagnostic in this function.
Do it from the callers instead, unless rmdir succeeds.
(remove_cwd_entries, remove_dir): Adjust callers.
2006-02-11 19:25:02 +00:00
Jim Meyering
f00751ef19 (TESTS): Add empty-inacc. 2006-02-11 18:03:52 +00:00
Jim Meyering
be39ded889 # Ensure that rm -rf removes an empty-and-inaccessible directory. 2006-02-11 18:03:29 +00:00
Jim Meyering
870179fcd8 add a comment 2006-02-11 07:38:25 +00:00
Jim Meyering
bcaa48a0e3 *** empty log message *** 2006-02-11 07:36:16 +00:00
Jim Meyering
ea05edb822 (syntax-check-rules): Automatically derive this list of sc_-prefixed rule names. 2006-02-11 07:36:10 +00:00
Paul Eggert
be8d11b9ed Makefile.maint import from Bison. 2006-02-11 06:05:39 +00:00
Paul Eggert
8018407342 (CVS_LIST): Don't assume cvsu is available.
(CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
(syntax-check-rules): Bring back sc_changelong.  (Hmm, why did it
go away? was that an accident?)
(sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
(sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
(sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
(sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
(sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
(sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
(sc_useless_cpp_parens, makefile-check, m4-check, po-check):
(author_mark_check, makefile_path_separator_check):
Output line numbers, to simplify navigation of Emacs *compilation*
buffers.
(sc_prohibit_atoi_atof, sc_file_system):
Rework slightly so that Makefile.maint doesn't get reported as a
violation of its own syntax rules.
(sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
it at run-time (which didn't work with Bison).  Fix a makefile typo,
caught by Makefile.maint itself: spaces where a tab should be.
(po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
Ignore djgpp and man subdirectories, to avoid false matches with
Bison and coreutils, respectively.  Use sort -u to remove the
resulting duplicates.
2006-02-11 06:05:23 +00:00
Paul Eggert
eedf8c2d7d Rework slightly to avoid bogus warning from
sc_two_space_separator_in_usage.
2006-02-11 06:04:56 +00:00
Paul Eggert
de107e9110 Fix typo in previous checkin: I deleted a '2' by mistake. 2006-02-11 00:36:08 +00:00
Jim Meyering
9d5e0e26db *** empty log message *** 2006-02-10 17:47:24 +00:00
Jim Meyering
6ceaaa02dc Use gzip's --rsyncable option only if it's available.
(gzip_rsyncable): New variable.
(GZIP_ENV): Use it.
2006-02-10 17:47:16 +00:00
Jim Meyering
321f772415 *** empty log message *** 2006-02-08 12:44:45 +00:00
Jim Meyering
dd8d8b4be1 (local-checks-available): Define in terms of
the expansion, $(syntax-check-rules), rather than the single,
top-level target `syntax-check', so that it's easier to exclude
individual rules (via $(local-checks-to-skip)).
(tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
2006-02-08 12:44:36 +00:00
Paul Eggert
b455780a19 (close_stdout): Don't assume 'bool' converts nonzero
ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2006-02-08 00:08:38 +00:00
Jim Meyering
f90c6bf22e *** empty log message *** 2006-02-07 22:33:01 +00:00
Jim Meyering
781167fbe1 (!defined O_DIRECT): If O_DIRECTIO is defined (as it is on Tru64),
define O_DIRECT to that.  Patch From James Lemley.
2006-02-07 22:32:50 +00:00
Jim Meyering
cabedb13fd *** empty log message *** 2006-02-07 09:21:27 +00:00
Jim Meyering
2f26574a5d *** empty log message *** 2006-02-07 09:18:46 +00:00
Jim Meyering
6b43f36dcb (expected_failure_status_vdir):
Redirect an expected disk-full diagnostic to /dev/null.
2006-02-07 09:18:28 +00:00
Jim Meyering
6f4ae95f06 *** empty log message *** 2006-02-07 08:40:58 +00:00
Jim Meyering
82959f79fe Mention the `cp -RL' bug fix. 2006-02-06 12:42:13 +00:00
Jim Meyering
b564d5e88f *** empty log message *** 2006-02-06 12:41:55 +00:00
Jim Meyering
2489dfb646 *** empty log message *** 2006-02-06 12:37:47 +00:00
Jim Meyering
c501fbc346 *** empty log message *** 2006-02-06 09:06:50 +00:00
Jim Meyering
bfd6ff089f . 2006-02-06 09:05:29 +00:00
Jim Meyering
32d3c24ad6 (sc_two_space_separator_in_usage): New rule.
(syntax-check-rules): Add it.
2006-02-06 08:57:49 +00:00
Jim Meyering
c4ae842f9e *** empty log message *** 2006-02-06 08:46:06 +00:00
Jim Meyering
0c7caf6d13 *** empty log message *** 2006-02-06 08:01:46 +00:00
Jim Meyering
21b19ab75b (usage): Use two spaces (not one) to separate the --no-preserve-root option
string from its description, so help2man formats the derived man page properly.
2006-02-06 08:00:23 +00:00
Jim Meyering
ca51e71b96 (usage): Use two spaces (not one) to separate the
--first-only option string from its description, so help2man formats
the derived man page properly.
2006-02-06 07:58:53 +00:00
Jim Meyering
4c448c6245 (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage. 2006-02-06 07:56:05 +00:00
Jim Meyering
811ae088ec *** empty log message *** 2006-02-06 07:40:35 +00:00
Jim Meyering
c446eceb9c (usage): Use two spaces (not one) to separate the
option string from its description, so help2man formats the
derived man page properly.  Patch from Nicolas Franois
in http://bugs.debian.org/351601.
2006-02-06 07:39:37 +00:00
Paul Eggert
3ff73ab0a9 (gl_USE_SYSTEM_EXTENSIONS): Don't #define
__EXTENSIONS__ if this causes compilation to fail.
2006-02-06 05:22:12 +00:00
Jim Meyering
130dd0656d (copy_internal): cp -RL no longer fails when encountering
the same directory more than once in the hierarchy beneath a single
command-line argument.  That is legitimate, e.g. when there are
two or more symbolic links, each pointing to some directory that
would not otherwise be copied.  Reported by Christophe LYON.
2006-02-04 10:49:21 +00:00
Jim Meyering
ee84ffc695 *** empty log message *** 2006-02-04 10:48:00 +00:00
Jim Meyering
6e7b489f51 *** empty log message *** 2006-02-04 10:45:44 +00:00
Jim Meyering
4fdce04c94 *** empty log message *** 2006-02-04 10:44:39 +00:00
Jim Meyering
ec1f8579a0 tweak comment 2006-02-04 10:44:19 +00:00
Jim Meyering
76a9394075 add a comment 2006-02-04 09:40:13 +00:00
Jim Meyering
77c01d6dfb (TESTS): Add cp-deref. 2006-02-04 09:37:41 +00:00
Jim Meyering
c11d87154a New file. Test for today's fix. 2006-02-04 09:37:32 +00:00
Jim Meyering
20d6e394fe *** empty log message *** 2006-02-03 14:40:38 +00:00
Jim Meyering
cacbb7434a Require automake-1.9.6, not 1.8.3. 2006-02-03 14:40:35 +00:00
Jim Meyering
4ccc271adf regenerate, as usual 2006-02-03 14:09:53 +00:00
Jim Meyering
9a8fc54523 *** empty log message *** 2006-02-02 21:25:10 +00:00
Jim Meyering
b88d20f978 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
failure on deficient systems, and simplify gnulib lgpl dependencies.

(rpl_lstat): Rewrite to use stat() in place of the
xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2006-02-02 21:25:06 +00:00
Paul Eggert
32c694b908 (od invocation): Warn that -t a ignores the high order bit. 2006-02-02 07:45:21 +00:00
Paul Eggert
2741d9b096 (usage): Mention that -t a ignores high order bit. 2006-02-02 07:44:57 +00:00
Jim Meyering
944a17de32 *** empty log message *** 2006-02-01 14:43:29 +00:00
Jim Meyering
81b5d8af5f (find_dir_entry): Remove unused local, `ent_sb_valid'. 2006-02-01 14:43:24 +00:00
Jim Meyering
f7617f0b4d *** empty log message *** 2006-01-31 16:05:42 +00:00
Jim Meyering
07fcda028e Update from gnulib. 2006-01-31 16:05:23 +00:00
Paul Eggert
6fa9bd80b9 Use better diagnostics for "head -3 -4" and likewise for tail. 2006-01-31 01:39:44 +00:00
Paul Eggert
4b4cc17d42 (parse_options): Use a better diagnostic when someone uses a trailing
numeric option in an invalid way.
2006-01-31 01:39:10 +00:00
Paul Eggert
e7000e0118 (main): Use a better diagnostic when someone uses a
trailing numeric option in an invalid way.
2006-01-31 01:38:30 +00:00
Paul Eggert
251468f113 (tail invocation): In the obsolete usage, the
count is optional, so put square brackets around it.
2006-01-31 01:38:05 +00:00
Jim Meyering
8d5ba536cf *** empty log message *** 2006-01-30 21:11:12 +00:00
Jim Meyering
7fb7a2d271 Include `count' keyword in man page synopsis,
per suggestion from http://bugs.debian.org/181585.
2006-01-30 21:11:06 +00:00
Paul Eggert
32aba5ac50 (L_): Renamed from L. All uses changed. 2006-01-27 18:41:50 +00:00
Paul Eggert
da953b9d22 Sync stdbool from gnulib. 2006-01-26 21:01:56 +00:00
Paul Eggert
a768b3ebec Merge stdbool from gnulib; we're still not quite there yet. 2006-01-25 18:32:46 +00:00
Paul Eggert
1a9e9d670d (true, false) [defined __BEOS__]: undef, as before.
(_Bool) [!@HAVE__BOOL@ && defined __GNUC__]: Use an enum
rather than a #define.
2006-01-25 18:32:19 +00:00
Paul Eggert
f3c2752caa (AC_HEADER_STDBOOL): Add some comments. 2006-01-25 18:31:56 +00:00
Jim Meyering
3423599809 . 2006-01-25 08:11:25 +00:00
Jim Meyering
e2c3daca96 . 2006-01-25 08:05:45 +00:00
Jim Meyering
14e53291e3 Remove this:
^lib/readutmp.h
2006-01-25 07:44:47 +00:00
Jim Meyering
292e0cdfa6 Remove useless parentheses in cpp directive. 2006-01-25 07:44:28 +00:00
Jim Meyering
900cc884d6 remove fileblocks.c 2006-01-25 07:43:38 +00:00
Jim Meyering
0a42446129 *** empty log message *** 2006-01-25 07:43:20 +00:00
Jim Meyering
d433382eaa Remove useless parentheses in cpp directive. 2006-01-25 07:43:17 +00:00
Paul Eggert
5b917cfa59 (show_dev): If the file system claims to have more available than total
blocks, report the number of used blocks as being total - available
(a negative number) rather than as garbage.
2006-01-24 23:30:46 +00:00
Jim Meyering
0efb6d171e *** empty log message *** 2006-01-24 22:56:03 +00:00
Jim Meyering
79dc4ea61d New file. Test for today's fix. 2006-01-24 22:55:59 +00:00
Jim Meyering
b80418f744 (TESTS): Add append-only. 2006-01-24 22:55:38 +00:00
Jim Meyering
b4440fe269 (check-root): Add tail-2/append-only 2006-01-24 22:54:49 +00:00
Jim Meyering
b11079e168 *** empty log message *** 2006-01-24 19:14:07 +00:00
Jim Meyering
1f6beea8e9 (gl_FUNC_OPENAT): Add AC_LIBSOURCES([intprops.h]).
Reported by Mark D. Baushke.
2006-01-24 19:13:41 +00:00
Jim Meyering
8e3fd3cc7a tweak wording so as to pass `remedial English class' :-) 2006-01-24 15:26:56 +00:00
Jim Meyering
d99e1c3342 tail -f once again works on a file with the append-only
attribute (affects at least Linux ext2, ext3, xfs file systems)
2006-01-24 10:36:28 +00:00
Jim Meyering
b2c30f765b *** empty log message *** 2006-01-24 10:36:18 +00:00
Jim Meyering
8c905f8349 *** empty log message *** 2006-01-24 10:32:40 +00:00
Jim Meyering
0cc660d1fe (tail_forever): Don't exit-nonzero when an attempt
to put a regular file in O_NONBLOCK mode fails with EPERM.
That happens on Linux when using tail -f on a file with the
append-only attribute.  Reported by Dean Gaudet.  For details,
see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
2006-01-24 10:32:32 +00:00
Paul Eggert
a30a9a3ec4 Import from gnulib. 2006-01-24 07:52:03 +00:00
Jim Meyering
529ecbddcc *** empty log message *** 2006-01-23 20:13:44 +00:00
Jim Meyering
4cf7d77126 *** empty log message *** 2006-01-23 15:06:42 +00:00
Jim Meyering
e17e330140 Remove unused definition of N_. 2006-01-23 15:06:37 +00:00
Jim Meyering
791e40357b . 2006-01-22 08:53:59 +00:00
Paul Eggert
7c364b54fc (quotearg_buffer_restyled): Add "default: break;"
to pacify gcc -Wswitch-default.
2006-01-22 08:46:54 +00:00
Jim Meyering
3173cb27dd . 2006-01-21 11:17:19 +00:00
Jim Meyering
abfc689b07 *** empty log message *** 2006-01-21 11:16:46 +00:00
Jim Meyering
af1885b91f Mention fts-related improvements and bug fixes. 2006-01-21 11:16:43 +00:00
Paul Eggert
4393cb56ca * lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Use -Wl,-z,ignore
rather than -Xlinker -z -Xlinker ignore, as it's more portable.
2006-01-21 07:59:38 +00:00
Paul Eggert
5a85d9f93f (gl_IGNORE_UNUSED_LIBRARIES): Use -Wl,-z,ignore
rather than -Xlinker -z -Xlinker ignore, as it's more portable.
2006-01-21 07:59:22 +00:00
Jim Meyering
911776e965 *** empty log message *** 2006-01-19 20:58:26 +00:00
Jim Meyering
a74a458f5f (pfx-1, pfx-2): New tests, to demonstrate the bug
reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
2006-01-19 20:58:22 +00:00
Jim Meyering
f8655e1804 *** empty log message *** 2006-01-18 06:29:21 +00:00
Jim Meyering
d848382c2f (TESTS): Add long-from-unreadable. 2006-01-18 06:29:14 +00:00
Jim Meyering
42629c4629 . 2006-01-17 19:57:26 +00:00
Jim Meyering
d55e2d8528 (openat_needs_fchdir): New function. 2006-01-17 17:43:10 +00:00
Jim Meyering
88df081621 *** empty log message *** 2006-01-17 17:42:57 +00:00
Jim Meyering
264f1bc3cd (openat_needs_fchdir): Declare it. 2006-01-17 17:42:53 +00:00
Jim Meyering
debc171df3 *** empty log message *** 2006-01-17 17:27:32 +00:00
Jim Meyering
b517279580 (gl_FUNC_FTS_CORE): Depend on gl_FUNC_OPENAT. 2006-01-17 17:27:27 +00:00
Jim Meyering
ba19fb9f38 *** empty log message *** 2006-01-17 17:26:39 +00:00
Jim Meyering
5c184343b8 New test, to exercise one small corner of fts.c. 2006-01-17 17:26:32 +00:00
Jim Meyering
0ca8bc4273 Include "openat.h".
Don't include "lchown.h".
(restricted_chown): Accept a new parameter, CWD_FD, and use it in
calling openat, lchownat, chownat, rather than open, lchown, chown.
Update caller.
2006-01-17 17:26:15 +00:00
Jim Meyering
c97a36e2d9 Now that fts no longer changes the current working directory, adjust
its clients accordingly -- note that du.c uses fts but doesn't need
any adjustment, since it doesn't operate on the actual files,
but rather just uses the stat buffers provided by fts.

Include "openat.h".
(process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
2006-01-17 17:25:42 +00:00
Jim Meyering
e9f0c42afc *** empty log message *** 2006-01-17 17:24:38 +00:00
Jim Meyering
a28b096d7f [struct FTS] (fts_cwd_fd): New member.
[struct FTS] (fts_rft): Remove now-unused member.
[struct FTS] (fts_cycle.state): Improve comment.
2006-01-17 17:24:29 +00:00
Jim Meyering
c1994c16c2 Rewrite fts.c not to change the current working directory,
by using openat, fstatat, fdopendir, etc..

[! _LIBC]: Include "openat.h" and "unistd--.h".
(HAVE_OPENAT_SUPPORT): Define.
[_LIBC] (fchdir): Don't undef or define; no longer used.
(FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
Now, this `function' always succeeds, and consumes its file descriptor
parameter -- so callers must not close such FDs.  Update callers.
(diropen_fd, opendirat, cwd_advance_fd): New functions.
(diropen): Add parameter, SP.  Adjust all callers.
Implement using diropen_fd, rather than open.
(fts_open): Initialize new member, fts_cwd_fd.
Remove fts_rft-setting code.
(fts_close): Close fts_cwd_fd, if necessary.
(__opendir2): Define in terms of opendir or opendirat,
depending on whether the FST_NOCHDIR flag is set.
(fts_build): Since fts_safe_changedir consumes its FD, and since
this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
and close the dup'd file descriptor upon failure.
(fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
(fts_safe_changedir): Tweak semantics to reflect that this function
now calls cwd_advance_fd and hence consumes its FD argument.
2006-01-17 17:24:14 +00:00
Paul Eggert
739de8914f (gl_IGNORE_UNUSED_LIBRARIES): Don't use ldd, as it's not portable
and it doesn't work with cross-compiles.  Fix missing-$ typo in 'test
"gl_cv_ignore_unused_libraries" ...' that prevented -zignore from being
used with Sun's C compiler.
2006-01-17 07:21:48 +00:00
Jim Meyering
b88411cca3 *** empty log message *** 2006-01-13 13:55:53 +00:00
Jim Meyering
9f43b7e39d (SUBDIRS): Add comments discouraging the
addition of new directories under tests/.
2006-01-13 13:55:49 +00:00
Jim Meyering
a25795c926 *** empty log message *** 2006-01-13 13:38:45 +00:00
Jim Meyering
583cd919cc Redirect stdin to /dev/null. Otherwise, FreeBSD 5.0's getfacl would hang. 2006-01-13 13:38:39 +00:00
Jim Meyering
153a886d6d *** empty log message *** 2006-01-13 13:35:31 +00:00
Jim Meyering
6c1675394f (AC_FUNC_GETMNTENT): Invoke AC_CHECK_FUNCS(getmntent)
unconditionally so that tests of $ac_cv_func_getmntent (e.g., in
gl_LIST_MOUNTED_FILE_SYSTEMS) need not double-quote uses that variable,
to accommodate the rare case in which getmntent is available in none
of the libraries checked.  This happens at least on FreeBSD 5.0.
2006-01-13 13:35:26 +00:00
Jim Meyering
86d43d3826 *** empty log message *** 2006-01-12 18:08:42 +00:00
Jim Meyering
8e6c26e593 Adjust not to hard-code the expected
diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
from that of Linux/libc.  Reported by Paul Eggert.
2006-01-12 18:08:18 +00:00
Jim Meyering
d56050cc6f Create final file *after* the loop. 2006-01-12 14:45:15 +00:00
Jim Meyering
2a8499e09f Create file at end of symlink chain. 2006-01-12 14:31:02 +00:00
Jim Meyering
9d7a6ee0f3 skip the test on a system that can handle this many symlinks in a file name, 2006-01-12 09:25:33 +00:00
Jim Meyering
7dabfc7e73 . 2006-01-12 08:40:34 +00:00
Jim Meyering
8d75ee59e0 whoops. traps were commented out. 2006-01-12 08:00:17 +00:00
Jim Meyering
c27afc1a04 *** empty log message *** 2006-01-12 07:55:40 +00:00
Jim Meyering
b78b7818af Remove useless parentheses in cpp directives, so that
this file passes coreutils' `make syntax-check' tests.
2006-01-12 07:55:36 +00:00
Jim Meyering
e4c3f364f3 fix typo: s/stdint.h.m4/stdint.m4/ 2006-01-12 07:48:36 +00:00
Jim Meyering
e9a7b49342 from gnulib 2006-01-12 07:45:26 +00:00
Jim Meyering
395cb7a6b9 *** empty log message *** 2006-01-12 07:22:36 +00:00
Jim Meyering
d80a835f4a (TESTS): Add test. 2006-01-12 07:22:18 +00:00
Jim Meyering
41a358ec88 New file, with a test for one of the
bugs fixed by yesterday's test.c changes.
2006-01-12 07:22:00 +00:00
Paul Eggert
9b6eae76de Import from gnulib. 2006-01-12 07:21:34 +00:00
Paul Eggert
ea58c1150c Add stdint_.h. 2006-01-12 07:21:19 +00:00
Paul Eggert
518d041db8 Adjust to md5 changes in gnulib, and make sha1 etc. more consistent
with md5.
2006-01-12 07:19:50 +00:00
Paul Eggert
59a8b22268 (gl_PREREQ): Require gl_STDINT_H. 2006-01-12 07:19:00 +00:00
Paul Eggert
3f83336726 (struct sha512_ctx): Use a word buffer, not a byte buffer, so that we
don't need to worry about alignment.
2006-01-12 07:18:39 +00:00
Paul Eggert
a60af3a64f (struct sha256_ctx): Use a word buffer, not a byte buffer, so that we
don't need to worry about alignment.  All uses changed.
2006-01-12 07:18:13 +00:00
Paul Eggert
25962cd489 (struct sha1_ctx): Use a word buffer, not a byte buffer,
so that we don't need to worry about alignment.  All uses changed.
This merges the 2005-10-28 md5 change into sha1.
2006-01-12 07:17:51 +00:00
Paul Eggert
1834ba06ac Fix commentary to match md5 better. Adjust to .h file changes. 2006-01-12 07:17:25 +00:00
Paul Eggert
3024d13d7e (__attribute__): Remove; unused. 2006-01-12 07:16:33 +00:00
Paul Eggert
7354a360be Fix commentary typos.
(alignof, UNALIGNED_P): No need for a GCC-specific version.
2006-01-12 07:16:21 +00:00
Paul Eggert
71b4960878 (BUILT_SOURCES, EXTRA_DIST, stdint.h, MOSTLYCLEANFILES):
Add gnulib snippet.
2006-01-12 07:16:07 +00:00
Paul Eggert
aa038250c3 Add stdint.h. 2006-01-12 07:15:48 +00:00
Jim Meyering
4eafb9d163 *** empty log message *** 2006-01-11 22:11:49 +00:00
Jim Meyering
50114df430 *** empty log message *** 2006-01-11 21:32:56 +00:00
Jim Meyering
aa990c11dd *** empty log message *** 2006-01-11 21:31:41 +00:00
Jim Meyering
3ff0576f2b *** empty log message *** 2006-01-11 21:29:20 +00:00
Jim Meyering
d7210c4542 Test for today's fts.c bug fix. 2006-01-11 21:29:06 +00:00
Jim Meyering
a45c0f4168 (TESTS): Add long-sloop. 2006-01-11 21:21:52 +00:00
Jim Meyering
108b46760a *** empty log message *** 2006-01-11 21:00:42 +00:00
Jim Meyering
cf6281916b (fts_stat): When following a symlink-to-directory,
don't interpret all stat-fails+lstat-succeeds as indicating a
dangling symlink.  That can also happen at least for ELOOP.
The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2006-01-11 21:00:36 +00:00
Jim Meyering
e51c87a604 Mark Joerg Sonnenberger's change as tiny. 2006-01-11 20:32:42 +00:00
Paul Eggert
b5d36033f1 * src/test.c (test_syntax_error): Append a newline. 2006-01-11 19:30:58 +00:00
Paul Eggert
bfbe450d32 (test_syntax_error): Append a newline. All callers
changed, except for the ones that didn't already append a newline.
2006-01-11 19:29:47 +00:00
Jim Meyering
f9574570b3 *** empty log message *** 2006-01-11 16:30:08 +00:00
Jim Meyering
08e4a9a00e (fts_open): Put new (2006-01-04) maxarglen declaration and uses in their
own block, so pre-c99 compilers don't object.
2006-01-11 16:29:35 +00:00
Jim Meyering
f84dc6ccfc *** empty log message *** 2006-01-11 16:19:06 +00:00
Jim Meyering
614235c849 [!_LIBC]: Include "fcntl--.h", to map open to open_safer. 2006-01-11 16:18:39 +00:00
Jim Meyering
dc15b27c50 *** empty log message *** 2006-01-11 15:25:36 +00:00
Jim Meyering
32b8a61ecf (gl_FUNC_OPENAT): Require and compile fchmodat.c.
Check for the lchmod function.
2006-01-11 15:25:30 +00:00
Jim Meyering
dc9da6bde0 *** empty log message *** 2006-01-11 13:33:03 +00:00
Jim Meyering
0e42486491 (fchmodat, fchownat): Declare.
(chmodat, lchmodat): Define convenience functions.
(chownat, lchownat): Likewise.
2006-01-11 13:32:47 +00:00
Jim Meyering
9cbd6c0366 (fchownat): New function. 2006-01-11 13:32:03 +00:00
Jim Meyering
c6749127ca (fchmodat): New file and function. 2006-01-11 13:30:31 +00:00
Jim Meyering
06df842f61 *** empty log message *** 2006-01-11 10:07:22 +00:00
Jim Meyering
d1fe298155 (OP): Remove useless space-before-TAB. 2006-01-11 10:07:13 +00:00
Jim Meyering
20f53c8aac *** empty log message *** 2006-01-11 08:22:43 +00:00
Jim Meyering
6b8b2183e7 (X2NREALLOC): Now that verify_true is no longer void,
cast its result to void, to avoid gcc's warning that
``left-hand operand of comma expression has no effect''.
(DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
2006-01-11 08:22:34 +00:00
Paul Eggert
b5284da0c0 Sync from gnulib. 2006-01-11 07:39:40 +00:00
Jim Meyering
d5dcff8362 *** empty log message *** 2006-01-10 21:48:19 +00:00
Paul Eggert
e06993903e Sync from gnulib. 2006-01-10 20:13:35 +00:00
Paul Eggert
388f158acf Update copyright year. 2006-01-10 20:05:53 +00:00
Paul Eggert
00eeaec5f2 Remove stray "lib/"s in previous change. 2006-01-10 20:01:34 +00:00
Paul Eggert
d11af4159e Sync from gnulib. 2006-01-10 17:47:56 +00:00
Jim Meyering
71520b31c0 *** empty log message *** 2006-01-10 11:55:20 +00:00
Jim Meyering
58e925ce5f Avoid the double-free (first in fts_read, second in fts_close) that
would occur when an `active' directory is made inaccessible (e.g.,
via chmod a-x) during a traversal.

(fts_read): After a failed fchdir, update sp->fts_cur
before returning.  Reproduce this failure by
mkdir -p a/b; cd a; chmod a-x . b
Reported by Stavros Passas.
2006-01-10 11:55:13 +00:00
Jim Meyering
f26f53be9c Add a test for today's fts.c fix. 2006-01-10 11:52:52 +00:00
Jim Meyering
e774de2be6 *** empty log message *** 2006-01-10 10:23:27 +00:00
Jim Meyering
6757e33c92 *** empty log message *** 2006-01-10 09:16:10 +00:00
Jim Meyering
0f07bd690c *** empty log message *** 2006-01-10 07:33:30 +00:00
Jim Meyering
c0ac40d98f Also include <stdio.h>, for Dragonfly.
Patch by Joerg Sonnenberger.
2006-01-10 07:33:22 +00:00
Jim Meyering
b6541058ce *** empty log message *** 2006-01-10 07:31:49 +00:00
Jim Meyering
f09a4ffe18 (gobble_file): Use DTTOIF only if it's defined.
This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
2006-01-10 07:31:21 +00:00
Jim Meyering
0cb6f1cc82 fix typo in comment 2006-01-09 20:32:08 +00:00
Jim Meyering
52b94c3e57 *** empty log message *** 2006-01-08 20:48:04 +00:00
Jim Meyering
28a712f205 (usage): Adjust the formatting of the entries for
%::z and %:::z (separate with two spaces, not one) so that help2man
formats them properly.  Reported by Philip Rowlands.
2006-01-08 20:45:54 +00:00
Paul Eggert
cbd0078fcf * lib-ignore.m4: New file. 2006-01-07 01:56:13 +00:00
Paul Eggert
9145f2798c * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add. 2006-01-07 01:56:01 +00:00
Paul Eggert
f17c770dfe (gl_IGNORE_UNUSED_LIBRARIES): Add. 2006-01-07 01:55:49 +00:00
Paul Eggert
56e7ad3001 Initial version. 2006-01-07 01:55:27 +00:00
Jim Meyering
55e0a76ddc *** empty log message *** 2006-01-06 16:49:15 +00:00
Jim Meyering
7e140557e9 (copyright-check): Use date +%Y in place of hard-coded 2005. 2006-01-06 16:49:10 +00:00
Jim Meyering
00d069f7d9 *** empty log message *** 2006-01-06 16:48:27 +00:00
Jim Meyering
ea20facd90 (COPYRIGHT_YEAR): Update to 2006. 2006-01-06 16:48:24 +00:00
Jim Meyering
7dcf7e3788 *** empty log message *** 2006-01-06 10:14:30 +00:00
Jim Meyering
01ab0b79a1 (rm_1): Remove static' attribute on local status'.
First off, the attribute should have been `volatile' (not static)
to avoid longjmp-related risk of clobber.  Secondly, now there is
no longer any risk of a local variable being clobbered, so there's
no need for any attribute at all.
2006-01-06 10:14:19 +00:00
Jim Meyering
de0f11596d *** empty log message *** 2006-01-05 14:31:22 +00:00
Jim Meyering
955fbf3211 Give a few functions the inline attribute.
(AD_pop_and_chdir): Use gotos to avoid some duplication.
(AD_push): Rewrite an assertion so that the entire computation
goes away when assertions are turned off.
2006-01-05 14:28:52 +00:00
Jim Meyering
4b980c0877 *** empty log message *** 2006-01-05 10:30:21 +00:00
Jim Meyering
a12500ecac Add a FIXME comment. 2006-01-05 10:30:17 +00:00
Jim Meyering
15556eed38 *** empty log message *** 2006-01-05 10:29:47 +00:00
Jim Meyering
91be6f4495 (ENOSYS) [!defined ENOSYS]: Don't define here.
It's already defined in "system.h".
2006-01-05 10:27:03 +00:00
Jim Meyering
084903a2b1 . 2006-01-04 21:06:39 +00:00
Paul Eggert
15954c3753 (tzname): Don't declare if it is already #defined. 2006-01-04 18:57:24 +00:00
Jim Meyering
72631a7b41 *** empty log message *** 2006-01-04 18:28:46 +00:00
Jim Meyering
6b9ee559f0 . 2006-01-04 18:27:03 +00:00
Jim Meyering
07fa3b9baa fix typo 2006-01-04 16:09:03 +00:00
Jim Meyering
757b8d0edd *** empty log message *** 2006-01-04 16:07:17 +00:00
Jim Meyering
8f0572299a change comment and temp file name: s/openat/fdopendir/ 2006-01-04 16:07:11 +00:00
Jim Meyering
7b22d09fba change comments and temp file name: s/openat/fdopendir/ 2006-01-04 16:06:59 +00:00
Jim Meyering
63028c863d Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).
2006-01-04 16:06:30 +00:00
Jim Meyering
0aea37a1b3 *** empty log message *** 2006-01-04 07:13:10 +00:00
Jim Meyering
27ab46340c Merge from glibc.
(fts_open): Avoid function call in MAX macro use.
2006-01-04 07:12:22 +00:00
Paul Eggert
a2fa57b24c (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
long int, not int, for nanosecond counts, so that people who are
used to POSIX struct timespec won't be surprised.
2006-01-03 23:21:38 +00:00
Jim Meyering
8692feeacc *** empty log message *** 2006-01-03 21:59:07 +00:00
Jim Meyering
39a400feeb Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).
2006-01-03 21:59:02 +00:00
Jim Meyering
035a7af4a6 *** empty log message *** 2006-01-03 14:12:21 +00:00
Jim Meyering
8e702fc759 Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).
2006-01-03 14:12:16 +00:00
Jim Meyering
b9c62b6747 correct first-line comment 2006-01-03 10:29:58 +00:00
Jim Meyering
2b9a6ee886 *** empty log message *** 2006-01-03 07:41:12 +00:00
Jim Meyering
6a845acf0f (O_DIRECTORY) [!defined O_DIRECTORY]: Define. 2006-01-03 07:41:03 +00:00
Paul Eggert
f6f906808d Make sure we can change the group of inaccessible files. 2006-01-03 06:20:25 +00:00
Paul Eggert
7126eb3216 (RC_do_ordinary_chown): New enum value.
(restricted_chown): Return it, if the file cannot be accessed due
to EPERM, or if no uid or gid are required, or if the file is
neither a directory nor a regular file.  Rewrite to avoid gotos.
(change_file_owner): Handle RC_do_ordinary_chown case.
Rewrite to avoid gotos.
2006-01-03 06:20:06 +00:00
Paul Eggert
6023a62148 (General date syntax): Invalid dates are rejected.
(Time of day items): Mention the possibility of leap seconds.
Problem reported by Dr. David Alan Gilbert.
2006-01-03 06:00:10 +00:00
Paul Eggert
d290c45ca9 Explain date %g, %G, and %V a bit better. 2006-01-03 00:48:29 +00:00
Paul Eggert
e1acba3234 Explain date %g, %G a bit better. 2006-01-03 00:46:11 +00:00
Paul Eggert
818f1e37c1 Use @acronym around "ISO" uniformly.
(Date conversion specifiers): Explain %g, %G, and %V a bit better.
2006-01-03 00:45:06 +00:00
Paul Eggert
7d9fe7fa8e (usage): Explain %g, %G, and %V a bit better. 2006-01-03 00:43:19 +00:00
Jim Meyering
ba05f7eeff *** empty log message *** 2006-01-02 21:35:00 +00:00
Jim Meyering
7f8d61f03e (set_owner): Correct a comment. 2006-01-02 21:34:53 +00:00
Jim Meyering
8298ae989a *** empty log message *** 2006-01-02 19:11:27 +00:00
Jim Meyering
f59d4713e5 (parse_options): Change warning to say that --retry
is useful `mainly' (not `only') when following by name.
Reported here: http://bugs.debian.org/273781
2006-01-02 19:11:22 +00:00
Jim Meyering
5dc67d68b6 *** empty log message *** 2006-01-02 19:10:45 +00:00
Jim Meyering
f78f184a14 (tail invocation): Say that --retry
is useful `mainly' (not `only') when following by name.
2006-01-02 19:10:39 +00:00
Paul Eggert
6aab791a58 Fix typo in previous change. 2006-01-02 07:42:35 +00:00
Paul Eggert
c0dac69808 New approach to safer chmod. 2006-01-02 07:30:27 +00:00
Paul Eggert
ab21036d6d Clarify file mode bits versus file permission bits. 2006-01-02 07:29:46 +00:00
Paul Eggert
885cd884d4 Update copyright year. 2006-01-02 07:29:24 +00:00
Paul Eggert
9c2fded343 Clarify file mode bits versus file permission bits.
(mkfifo invocation, mknod invocation): -m affects only file permission bits.
2006-01-02 07:28:38 +00:00
Paul Eggert
70efb5ac20 Document that mkfifo and mknod -m no longer set special bits. 2006-01-02 07:28:08 +00:00
Paul Eggert
bee93bd060 No longer used. 2006-01-02 07:18:30 +00:00
Paul Eggert
862fbc427b (usage): Clarify -m's operation.
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.

Undo 2005-12-19 changes.
2006-01-02 06:39:06 +00:00
Paul Eggert
4ff2e46dde Update copyright year. 2006-01-02 06:38:33 +00:00
Paul Eggert
a8c545ea74 (usage): Clarify -m's operation.
(main): If -m is given, don't invoke chmod; use umask 0 instead.
Report an error if -m asks for bits outside the 777 range.
2006-01-02 06:38:06 +00:00
Paul Eggert
51050b62c8 Include lchmod.h.
(usage): Clarify -m's operation.
(main): Use lchmod rather than chmod.  Don't use lchmod unless the
new mode contains bits outside the 777 range.
2006-01-02 06:37:36 +00:00
Paul Eggert
4aff81e69a Include lchmod.h.
(re_protect, make_dir_parents_private): Use lchmod rather than chmod.
2006-01-02 06:36:55 +00:00
Paul Eggert
faac2ccac5 Include lchmod.h.
(copy_internal): Use lchmod rather than chmod.
2006-01-02 06:36:10 +00:00
Paul Eggert
e59703a1d6 New file. 2006-01-02 06:34:32 +00:00
Paul Eggert
968bee81e8 (gl_MACROS): Require gl_FUNC_LCHMOD.
Don't require gl_CHDIR_SAFER.
2006-01-02 06:34:13 +00:00
Paul Eggert
c225633528 Include lchmod.h, lchmod.c.
(make_dir_parents): Use lchown rather than chown, and
lchmod rather than chmod.
2006-01-02 06:33:12 +00:00
Paul Eggert
c432136c3c (sort invocation): Clarify that by default a blank is a space or a tab. 2005-12-29 21:45:32 +00:00
Paul Eggert
b4c0a12e3b (sort invocation): Clarify that a blank is a space
or a tab.
2005-12-29 21:44:35 +00:00
Jim Meyering
00b8d64531 add src/system.h 2005-12-29 15:03:57 +00:00
Jim Meyering
c414f983b4 . 2005-12-28 10:27:47 +00:00
Jim Meyering
72f81e727d *** empty log message *** 2005-12-28 10:27:34 +00:00
Jim Meyering
aac8ce8261 (EXTRA_DIST): Add .x-sc_prohibit_assert_without_use. 2005-12-28 10:26:58 +00:00
Jim Meyering
04354518e1 (sc_obsolete_symbols): Prohibit use of O_NDELAY.
(sc_prohibit_assert_without_use): New rule.
(syntax-check-rules): Add it to the list.

(CVS_LIST): Define in terms of $(srcdir).
2005-12-28 10:26:10 +00:00
Jim Meyering
67e065e79d Don't include <assert.h>; it wasn't used. 2005-12-28 10:22:41 +00:00
Paul Eggert
eb330d2584 chdir-related fixes 2005-12-27 08:00:42 +00:00
Paul Eggert
3f11d67a56 (wipename): Use similar open flags to other places we open directories.
Don't bother trying to open dir for writing, since POSIX prohibits it.
2005-12-27 08:00:12 +00:00
Paul Eggert
40ea51a322 (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
| O_NOFOLLOW too, for consistency with other dir-openers.
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
(is_empty_dir): Likewise.
2005-12-27 07:59:27 +00:00
Paul Eggert
da4c548bbb (restricted_chown):
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
2005-12-27 07:59:00 +00:00
Paul Eggert
97fe820f88 (save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
2005-12-27 07:57:14 +00:00
Paul Eggert
ee7334652f (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
Fall back on chown if open failed with EACCES.
2005-12-27 07:56:33 +00:00
Paul Eggert
0d7468cabd (defined_S_IFMT): New macro.
Include stat-macros.h.
Include stdlib.h, for abort().
Don't include stdio.h or assert.h; no longer needed.
(same_file_type): Don't assume S_IFMT is defined, as POSIX
does not require this.  Don't assume S_IFCHR and S_IFBLK have
their usual sort of bit pattern.
(fchmod_new): Open with O_NOCTTY for as well, for minor
improvement on hosts where that matters.  Don't bother to assert,
since the caller (in this source file) checks the same thing.
Discard any errno from a close failure, for consistency with other
code.
2005-12-27 07:55:50 +00:00
Paul Eggert
cc4d59e9cd (diropen): Don't bother trying to open directory for write access:
POSIX says that must fail.
2005-12-27 07:55:03 +00:00
Paul Eggert
8846a6bfdd (chdir_no_follow): Don't bother trying to open directory for write
access: POSIX says that must fail.
2005-12-27 07:54:37 +00:00
Paul Eggert
a2c8ec26a4 (cdb_free): Don't bother trying to open directory
for write access: POSIX says that must fail.
(cdb_free): Open with O_NOCTTY | O_NONBLOCK as
well, for minor improvements on hosts that lack O_DIRECTORY.
2005-12-27 07:53:50 +00:00
Jim Meyering
edf69af317 (chdir_no_follow): Move declaration of local,
sb2, `down' into the scope where it is used.
Note that on some systems this function also fails when DIR
is a writable-yet-unreadable directory.
2005-12-26 18:53:58 +00:00
Jim Meyering
078800a00b *** empty log message *** 2005-12-26 18:53:46 +00:00
Paul Eggert
7cffc5f20e chdir-safer.c still needs unistd.h 2005-12-25 21:40:01 +00:00
Paul Eggert
f7a0d07623 Whoops; don't remove the include for unistd.h, since it defines fchdir. 2005-12-25 21:38:43 +00:00
Paul Eggert
11eedd84d3 chdir-safer cleanup 2005-12-25 21:35:51 +00:00
Paul Eggert
8b9f6b163a (chdir_no_follow): Don't include stdio.h, assert.h,
unistd.h, fcntl--.h; not needed.
(O_DIRECTORY): Define if not already defined.
(chdir_no_follow): Revamp describing comment to match code more
closely.  Redo use of internal vars to avoid lint complaints.
Work even if directory is writeable but not readable.
Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
don't have O_NOFOLLOW.  Use O_NONBLOCK (POSIX spelling) rather
than O_NDELAY.  Don't bother invoking fstat if open does not
dereference symlink, since the result isn't used then.
Don't assume file descriptor is positive; it might be zero
now that we no longer include fcntl--.h (we don't need fcntl--.h
since we immediately close the descriptor).
2005-12-25 21:35:38 +00:00
Paul Eggert
532cf2ac33 (FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay. 2005-12-25 21:35:21 +00:00
Jim Meyering
735fb62c0f *** empty log message *** 2005-12-25 17:34:04 +00:00
Jim Meyering
d789e78a75 (chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode). 2005-12-25 17:33:57 +00:00
Jim Meyering
f9f6078432 (TESTS): Add p-thru-slink 2005-12-23 18:17:39 +00:00
Jim Meyering
dc217ce9c2 New file. Test for today's mkdir-p.c fix. 2005-12-23 18:16:40 +00:00
Jim Meyering
7916560259 *** empty log message *** 2005-12-23 18:15:38 +00:00
Jim Meyering
5d3118175f (make_dir_parents): Use chdir_no_follow only
if we've just created the directory.
2005-12-23 18:15:33 +00:00
Jim Meyering
bdf801ef29 *** empty log message *** 2005-12-23 17:14:37 +00:00
Jim Meyering
7616f9171a *** empty log message *** 2005-12-23 12:00:37 +00:00
Jim Meyering
2eab9d93fc (chdir_no_follow): Rewrite to use fchdir even
when O_NOFOLLOW is not defined.  Suggested by Eric Blake.
2005-12-23 12:00:26 +00:00
Jim Meyering
867dbd1591 *** empty log message *** 2005-12-23 08:28:19 +00:00
Jim Meyering
bd80c2e5a7 (O_NOFOLLOW): Define, if necessary. 2005-12-23 08:28:14 +00:00
Jim Meyering
6ed15904b1 (O_NOFOLLOW): Define. 2005-12-23 08:27:44 +00:00
Jim Meyering
bda1fc0aa4 *** empty log message *** 2005-12-22 15:43:25 +00:00
Jim Meyering
23490f81f8 *** empty log message *** 2005-12-22 15:42:17 +00:00
Jim Meyering
b5bfbe2385 redirect stderr to /dev/full, too (to suppress write error diagnostic) 2005-12-22 15:40:00 +00:00
Jim Meyering
2bd65173c2 *** empty log message *** 2005-12-22 14:36:22 +00:00
Jim Meyering
b6c621211b Include "fcntl--.h" and "unistd--.h", to map open
and dup to open_safer and dup_safer, respectively.
(openat_permissive): Fix typo in comment.
2005-12-22 14:34:20 +00:00
Jim Meyering
1e1938032b . 2005-12-21 10:23:51 +00:00
Jim Meyering
3114855498 *** empty log message *** 2005-12-21 10:21:20 +00:00
Jim Meyering
9eb2e69d62 Require gl_CHDIR_SAFER. 2005-12-21 10:21:04 +00:00
Jim Meyering
05eb4556c8 . 2005-12-21 09:48:41 +00:00
Jim Meyering
a7c7b483f1 *** empty log message *** 2005-12-21 09:43:44 +00:00
Jim Meyering
2956eb272c like chdir(2), but safer, if possible 2005-12-21 09:42:36 +00:00
Jim Meyering
3108671902 *** empty log message *** 2005-12-20 14:23:25 +00:00
Jim Meyering
d0344cfc55 (RW_USR): Remove definition.
(make_dir_parents): Use S_IRWXU, now that read access is also required.

Avoid a race condition, on systems where open honors O_NOFOLLOW.

(make_dir_parents): Include chdir-safer.h.
Use chdir_no_follow in place of chdir.
2005-12-20 14:23:20 +00:00
Jim Meyering
0b7757fac4 *** empty log message *** 2005-12-20 10:28:58 +00:00
Jim Meyering
cf02d3c6f6 (make_dir_parents): Remove unnecessary casts of alloca,
since now it's guaranteed to be (void *).
2005-12-20 10:28:53 +00:00
Jim Meyering
ddb24aa9fb *** empty log message *** 2005-12-20 10:24:43 +00:00
Jim Meyering
7be64dd68f (fchmod_new): Don't try to close fd if it's < 0. 2005-12-20 10:24:37 +00:00
Jim Meyering
07d7677196 . 2005-12-19 18:21:11 +00:00
Jim Meyering
3d49eb721b . 2005-12-19 18:19:38 +00:00
Jim Meyering
a8b913cfdd (TESTS): Add mknod. 2005-12-19 18:18:57 +00:00
Jim Meyering
fa6cfcb9ce (main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each
mknod call uses a mode including at least owner-read access.

(main): When `-m MODE' is specified, exit nonzero if
the subsequent chown (or equivalent open,fchown,close) fails.
2005-12-19 18:18:03 +00:00
Jim Meyering
52893ffd2a (main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each
mkdir call uses a mode including at least owner-read access.
2005-12-19 18:17:16 +00:00
Jim Meyering
17f521adfd (main) Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown.  To do that reliably
(even with an overly restrictive umask), ensure that each mknod/mkfifo
call uses a mode including at least owner-read access.
2005-12-19 18:16:07 +00:00
Jim Meyering
e0029290b8 . 2005-12-19 18:13:00 +00:00
Jim Meyering
89276658f2 . 2005-12-19 18:12:30 +00:00
Jim Meyering
457167610f . 2005-12-19 18:05:55 +00:00
Jim Meyering
1e4cd701dc Require gl_CHMOD_SAFER. 2005-12-19 18:05:11 +00:00
Jim Meyering
5df3b1a078 *** empty log message *** 2005-12-17 13:46:34 +00:00
Jim Meyering
46f3108c99 (is_empty_dir): Open with O_NDELAY, so we don't hang, e.g., on a named pipe.
(OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
place of all uses, since it is guaranteed (system.h) to be defined.
2005-12-17 13:46:27 +00:00
Jim Meyering
eb931cda05 *** empty log message *** 2005-12-17 10:56:25 +00:00
Jim Meyering
88d381bada Add lib/acl.c. 2005-12-17 10:56:22 +00:00
Jim Meyering
26f5a6e03e *** empty log message *** 2005-12-17 10:50:04 +00:00
Jim Meyering
88c3a9be50 (stat invocation) [--printf]: Describe new option.
[--format]: Add example.  Distinguish from --printf.
Sort option descriptions.
2005-12-17 10:50:00 +00:00
Jim Meyering
c99e1d2cb6 . 2005-12-17 10:48:30 +00:00
Jim Meyering
c4a1355047 *** empty log message *** 2005-12-17 10:48:12 +00:00
Jim Meyering
2862dc7af9 *** empty log message *** 2005-12-17 10:47:37 +00:00
Jim Meyering
01a5f3830f (ls): Clarify the Alternate Access Method description.
(cp): Clarify that --preserve=mode also preserves acls.
2005-12-17 10:46:57 +00:00
Jim Meyering
7b08fdb1eb (cp_option_init): Don't set umask_kill member. 2005-12-17 10:46:23 +00:00
Jim Meyering
eee9e3d072 (cp_option_init): Don't set umask_kill member. 2005-12-17 10:45:54 +00:00
Jim Meyering
406a9d3636 (cp_option_init) [umask_kill]: Remove member. 2005-12-17 10:43:12 +00:00
Jim Meyering
fdffb6bb48 (umask_kill): With default acls, the umask is not to be applied.
Remove umask_kill, don't change the process umask, and let the kernel
apply the umask where appropriate.
(make_dir_parents_private): Fix logic for POSIX ACLs.
2005-12-17 10:40:10 +00:00
Jim Meyering
4fb20524d7 (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD, mv_LDADD, ginstall_LDADD):
On systems with an ACL library, arrange
to link with it via $(LIB_ACL), for the utilities that need it.
2005-12-17 10:37:47 +00:00
Jim Meyering
f634e88445 (get_dest_mode): Remove; it is obsolete after removing umask_kill.
(copy_reg, copy_internal): Use copy_acl and set_acl
instead of fchown/chown. Fix the logic for POSIX ACLs.
(chown_succeded): Remove; we now always copy acls and
preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
did a chown before or not.
2005-12-17 10:33:33 +00:00
Jim Meyering
e6ece7ba6c Switch back from HAVE_ACL to USE_ACL: The acl() syscall
is no requirement for ACL support; particularly, it does not exist
on systems that have POSIX ACLs.
2005-12-17 10:33:08 +00:00
Jim Meyering
3c0d9bc513 *** empty log message *** 2005-12-17 10:31:37 +00:00
Jim Meyering
4a12f5ebcf (acl_entries): Add fallback implementation for POSIX ACL
systems other than Linux.
(chmod_or_fchmod): New function: use fchmod when possible,
and chmod otherwise.
(file_has_acl): Add a POSIX ACL implementation, with a
Linux-specific subcase.
(copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
S_ISVTX from one file to another.  Fall back to fchmod/chmod when
acls are unsupported.
(set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
are unsupported.
2005-12-17 10:31:33 +00:00
Jim Meyering
9566c9c9d3 (copy_acl, set_acl): Add declarations. 2005-12-17 10:31:15 +00:00
Jim Meyering
2eb8cbd948 *** empty log message *** 2005-12-17 10:30:13 +00:00
Jim Meyering
f69fb2f533 (AC_FUNC_ACL): Add POSIX ACL and Linux-specific acl tests. 2005-12-17 10:30:09 +00:00
Paul Eggert
1833362111 remove/openat cleanup 2005-12-17 06:56:19 +00:00
Paul Eggert
25c49ccc1c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
(OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
(fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
value is now signified by whether cwd_errno is null.
(fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
pointer-to-bool to pointer-to-errno-value.  All callers changed.
(rm_1): Don't bother setting a local cwd failure flag and then
ORing it into the caller's.  Just set the caller's.
(rm): Use cwd failure errno value to print a slightly-better
diagnostic.
2005-12-17 06:55:54 +00:00
Paul Eggert
3f86aaadcf Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
"gettext.h"; either no longer needed or are guaranteed by openat.h.
(_): Remove; no longer needed.
(openat): Renamed from rpl_openat; no need for rpl_openat
since openat.h renames openat for us.
Replace most of the body with a call to openat_permissive,
to avoid duplicate code.
Port to (probably hypothetical) environments were mode_t is
wider than int.
(openat_permissive): Require mode arg, so that we can check
types better.  Put it just after flags.  Change cwd failure
indicator from pointer-to-bool to pointer-to-errno-value.
All callers changed.
Invoke openat_save_fail and/or openat_restore_fail if
cwd_errno is null, so that openat can call us.
(openat_permissive, fdopendir, fstatat, unlinkat):
Simplify errno handling to avoid some duplicate code,
as it's OK to set errno on success.
2005-12-17 06:55:32 +00:00
Paul Eggert
1c5cebe703 Revamp code so that function macros depend on
__OPENAT_PREFIX only, not also on AT_FDCWD.
(openat_ro): Remove.  Caller changed to use openat_permissive.
(openat_permissive): Now a macro, if not a function.
(openat_restore_fail, openat_save_fail): Now always functions,
since mkdirat needs them even if __OPENAT_PREFIX is defined.
2005-12-17 06:55:01 +00:00
Jim Meyering
0ae5a45fcb *** empty log message *** 2005-12-15 20:16:03 +00:00
Jim Meyering
ce79c562f6 (print_it): Properly handle a backslash at the
end of a --printf format string.  Reported by Paul Eggert.
2005-12-15 20:15:20 +00:00
Jim Meyering
41e95465a6 (print_it): Properly handle a backslash at the
end of a --printf format string.  Reported by Paul Eggert.

(end-bs): Add a test for the above.
2005-12-15 20:15:05 +00:00
Paul Eggert
c1c8e668de Fix typo in previous change 2005-12-15 19:01:00 +00:00
Paul Eggert
a025357bd6 tests/acl porting fixes 2005-12-15 18:58:47 +00:00
Paul Eggert
b7c426c0ab Port to pre-POSIX shells like Solaris 8 /bin/sh.
Don't assume /etc/passwd contains user names; use 'id' instead.
2005-12-15 18:58:20 +00:00
Paul Eggert
6dcd2807d7 Regenerate. 2005-12-15 18:24:35 +00:00
Jim Meyering
a37438984f Add Kinyarwanda (rw).
Add Croatian (hr).
2005-12-15 14:49:00 +00:00
Jim Meyering
fee8c3985a . 2005-12-15 14:48:48 +00:00
Jim Meyering
049a807bc6 . 2005-12-15 14:47:36 +00:00
Jim Meyering
6e7efd30f0 *** empty log message *** 2005-12-15 12:25:04 +00:00
Jim Meyering
5124a296ab stat: revert behavior of --format=FMT (-c)
stat: add new option: --printf=FMT
2005-12-15 12:24:54 +00:00
Jim Meyering
8768b88913 revert behavior of --format=FMT (-c)
add new option: --printf=FMT

(isodigit, octtobin, hextobin): Define.
(PRINTF_OPTION): Define.
(interpret_backslash_escapes, trailing_delim): New globals.
(usage): Document them.  Alphabetize on long option names.
(print_esc_char): New function.
(print_it): Rewrite, in order to handle backslash escapes.
(main): Handle new option.  Set globals for --format, too.
2005-12-15 12:24:30 +00:00
Jim Meyering
7383c9a1a3 (TESTS): Add stat-printf. 2005-12-15 12:23:57 +00:00
Jim Meyering
d1f5df777f Test --printf and --format. 2005-12-15 12:23:36 +00:00
Jim Meyering
2a390dea1f *** empty log message *** 2005-12-15 08:37:14 +00:00
Paul Eggert
cd42358418 Diagnose "sort -c -o FILE". 2005-12-15 00:00:02 +00:00
Paul Eggert
e18c4ff172 (incompatible_options): New function.
(check_ordering_compatibility, main): Use it.
(main): Check for -c and -o.
Don't bother with a usage message for
"sort -c a b", for consistency with other error diagnostics.
2005-12-14 23:59:23 +00:00
Paul Eggert
4382b8ce00 (incompat4): New test. 2005-12-14 23:58:20 +00:00
Paul Eggert
1dbd70442d sort now reports incompatible options. 2005-12-14 22:46:17 +00:00
Paul Eggert
56805cd202 (check_ordering_compatibility): New function.
(main): Use it.
2005-12-14 22:46:02 +00:00
Paul Eggert
ce1be021a7 (incompat1, incompat2, incompat3): New tests. 2005-12-14 22:45:29 +00:00
Jim Meyering
b0cee61e23 *** empty log message *** 2005-12-14 20:37:24 +00:00
Jim Meyering
bd78a76886 (libcoreutils_a_SOURCES): Remove fprintftime.c
and fprintftime.h.  Now they're pulled in via the .m4 file.
2005-12-14 20:37:06 +00:00
Jim Meyering
0d58d63090 *** empty log message *** 2005-12-14 20:36:20 +00:00
Jim Meyering
85fba4dc43 Require gl_FPRINTFTIME. 2005-12-14 20:36:14 +00:00
Paul Eggert
82944b0300 Undo previous change to cat.c. 2005-12-14 18:12:44 +00:00
Paul Eggert
dcc1bc1759 Undo previous change. 2005-12-14 18:09:04 +00:00
Paul Eggert
6d577b6fb4 * src/cat.c (main): Check for close (STDOUT_FILENO) failure. 2005-12-14 01:40:19 +00:00
Paul Eggert
f5e1bca49d (main): Check for close (STDOUT_FILENO) failure. 2005-12-14 01:39:46 +00:00
Paul Eggert
3463531cd0 One other stdbool.m4 change. 2005-12-14 01:17:51 +00:00
Paul Eggert
8bf7f49616 (AM_STDBOOL_H): Substitue HAVE__BOOL again, reverting
2005-11-25 change.
2005-12-14 01:17:28 +00:00
Paul Eggert
23b2b5c660 * Makefile.am (stdbool.h): Resurrect the 'sed' that goes along
with '#if !@HAVE_BOOL@".
2005-12-14 00:09:23 +00:00
Paul Eggert
a6caba2509 (stdbool.h): Resurrect the 'sed' that goes along with '#if !@HAVE_BOOL@". 2005-12-14 00:08:54 +00:00
Paul Eggert
706c4369de Sync from gnulib. 2005-12-13 23:58:55 +00:00
Paul Eggert
4170c66d45 (_Bool): Resurrect the "#if !@HAVE__BOOL@" check, to
work around compilers that have a (possibly-broken) _Bool but lack
a working <stdbool.h>.
2005-12-13 19:42:27 +00:00
Paul Eggert
eaebfec990 (AC_HEADER_STDBOOL): Check for buggy compiler that
has _Bool but mishandles _Bool |= _Bool.
2005-12-13 19:41:57 +00:00
Paul Eggert
a867264a18 Install a more-conservative approach for sort -R. 2005-12-12 22:47:57 +00:00
Paul Eggert
c5174f6fb2 (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
from rand-isaac.c.
2005-12-12 22:43:16 +00:00
Paul Eggert
b22d6cc592 (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c. 2005-12-12 22:42:58 +00:00
Paul Eggert
d2af4ddbeb (EXTRA_DIST): Add rand-isaac.c. 2005-12-12 22:42:37 +00:00
Paul Eggert
9df4b20557 (sort invocation): Clarify explanation of
--random-sort, and use a simpler example.
2005-12-12 22:42:16 +00:00
Paul Eggert
1f20820f7e Clarify sort -R. 2005-12-12 22:41:56 +00:00
Paul Eggert
6078d7175d Add src/rand-isaac.c. 2005-12-12 22:41:42 +00:00
Paul Eggert
0abb871873 Remove. All uses now simply include rand-isaac.c. 2005-12-12 22:16:30 +00:00
Paul Eggert
021921a712 Mention shred_SOURCES and sort_SOURCES, too. 2005-12-12 22:16:02 +00:00
Paul Eggert
55173eaa9e Use a more-conservative but slower approach for sort -R. 2005-12-12 22:09:56 +00:00
Paul Eggert
dee72c1194 Include rand-isaac.c rather than rand-isaac.h.
Don't include md5.h; it wasn't needed.
(struct keyfield): Rename random_hash to random, for consistency
with the other member names.  All uses changed.
(usage): Tweak wording to mention STRING for --seed option.
(short_options): Rorder for consistency with other programs.
(rand_state): Now a struct, not a pointer to one.  All uses changed.
(HASH_WORDS, HASH_SIZE): Remove.
(get_hash): Remove comments around resbuf size, since we can assume C89.
Use a "more-kosher" (but slower) approach of invoking isaac_refill.
(keycompare): Adjust to the new get_hash.
Add a FIXME.
(badfieldspec): Omit recently-introduced comment; it isn't needed.
(main): Don't set need_random simply because gkey has it set; that
doesn't necessarily mean we'll need random numbers.
Redo seeding to match new get_hash approach.
2005-12-12 22:09:27 +00:00
Paul Eggert
30e44dd014 Include rand-isaac.c rather than rand-isaac.h.
(fillrand, dopass, main): Undo previous change.
2005-12-12 22:08:50 +00:00
Paul Eggert
f7a86b7734 Revert to what used to be in shred.c, without
changing it to allow for varying numbers of words in the state.
Alter so that we include rand-isaac.c directly rather than
compiling it and linking to it.  Don't include config.h or
system.h; that's the includer's responsibility.
(ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
(isaac_step, struct irand_state):
Resurrect these, with the same defns that used to be in shred.c.
(ISAAC_SIZE, isaac_new, isaac_copy): Remove.
(isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
static again.
(struct isaac_state, isaac_refill, isaac_mix, isaac_init):
(isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
(irand_init, irand32, irand_mod):
Number of words is constant again.
2005-12-12 22:08:14 +00:00
Paul Eggert
67ee303724 (noinst_HEADERS): Remove rand-isaac.h. 2005-12-12 22:07:51 +00:00
Jim Meyering
8340fb2805 *** empty log message *** 2005-12-10 22:54:40 +00:00
Jim Meyering
09227c31dd (noinst_HEADERS): Add rand-isaac.h. 2005-12-10 22:54:31 +00:00
Jim Meyering
2a6eef20f5 *** empty log message *** 2005-12-10 22:10:59 +00:00
Jim Meyering
d5978ad190 Cleaner:
Make the local an `int' instead.
2005-12-10 22:10:53 +00:00
Jim Meyering
437a569c53 *** empty log message *** 2005-12-10 21:58:28 +00:00
Jim Meyering
dfacfaf971 Avoid shred segfault on 64-bit systems.
(isaac_refill): Don't try to negate a
local of type uint32_t.  Convert it to int32_t first.
2005-12-10 21:58:23 +00:00
Jim Meyering
3199892488 *** empty log message *** 2005-12-10 21:10:26 +00:00
Jim Meyering
2f33661051 Mention sort's new options. 2005-12-10 21:10:21 +00:00
Jim Meyering
df4dc0666d *** empty log message *** 2005-12-10 10:18:18 +00:00
Jim Meyering
41c0ee3fe4 * src/rand-isaac.h (isaac_mix): Remove declaration. 2005-12-10 10:18:10 +00:00
Jim Meyering
dbfc16effb * src/rand-isaac.c (isaac_mix): Declare to be static.
Mark all other functions as `extern' so the tight-scope
part of `make distcheck' passes once again.
* src/rand-isaac.h (isaac_mix): Remove declaration.
2005-12-10 10:18:01 +00:00
Jim Meyering
c4666a397d *** empty log message *** 2005-12-10 10:05:27 +00:00
Jim Meyering
ea947bc7f0 *** empty log message *** 2005-12-10 10:04:18 +00:00
Jim Meyering
fbaa8e9719 (get_hash): Change position of `*' in parameter type to conform with convention.
(main): Split a long line so it fits in 80 columns.
2005-12-10 10:04:12 +00:00
Jim Meyering
beb862ee9c *** empty log message *** 2005-12-10 10:02:32 +00:00
Jim Meyering
d6482a9ac2 Don't include gethrxtime.h. No longer needed. 2005-12-10 10:02:24 +00:00
Jim Meyering
a2b661352b (keycompare): Remove stray SPACE before TAB that was
causing `make distcheck' to fail.
2005-12-10 09:44:00 +00:00
Jim Meyering
e2b9d79b9c *** empty log message *** 2005-12-10 09:38:17 +00:00
Jim Meyering
d65090198c (TESTS): Add sort-rand. 2005-12-10 09:38:07 +00:00
Jim Meyering
9967cd6a63 *** empty log message *** 2005-12-10 09:37:46 +00:00
Jim Meyering
7de48ccced Add a basic test of the new options. 2005-12-10 09:37:21 +00:00
Paul Eggert
f9b90d0739 Add sort -R. 2005-12-10 09:08:55 +00:00
Paul Eggert
e076a77851 (sort invocation): Add --random-sort (-R) and --seed. 2005-12-10 08:10:20 +00:00
Paul Eggert
569c4876bc (short_options, long_options, WORDS, keycompare, main):
(usage): Add options --random-sort and --seed to implement a random
shuffle.
Include md5.h and rand-isaac.h.
(get_hash): New function.
(rand_state): New var.
(HASH_WORDS, HASH_SIZE): New macros.
2005-12-10 08:09:42 +00:00
Paul Eggert
4013c49f1b Include rand-isaac.h. Move ISAAC code to rand-isaac.c.
(fillrand, main): Adjust to the fact that the state size is now
runtime-configurable.
2005-12-10 08:09:20 +00:00
Paul Eggert
7c2beeafd7 (sort_LDADD): Add $(LIB_GETHRXTIME).
(shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
2005-12-10 08:08:52 +00:00
Paul Eggert
71bc739b35 New file, containing ISAAC code that was in shred.c.
Make state size runtime-configurable.
(isaac_new, isaac_copy): New functions.
2005-12-10 08:08:05 +00:00
Paul Eggert
a237792d66 Move ISAAC code out of shred.c. 2005-12-10 08:07:36 +00:00
Jim Meyering
078b4f861c add comments 2005-12-09 21:52:50 +00:00
Paul Eggert
4713202758 Add test for dd iflags=noatime. 2005-12-09 21:48:38 +00:00
Jim Meyering
467d73aac9 *** empty log message *** 2005-12-09 16:28:28 +00:00
Jim Meyering
99f35425a7 (usage): Mention white space vs -b and -t options.
From The Wanderer.
2005-12-09 16:28:17 +00:00
Jim Meyering
55897502a6 *** empty log message *** 2005-12-09 16:27:26 +00:00
Jim Meyering
e83af19449 *** empty log message *** 2005-12-09 16:22:27 +00:00
Jim Meyering
843efb8e3b (main): Fix misleading comment. 2005-12-09 16:22:24 +00:00
Jim Meyering
bbfe621405 . 2005-12-08 18:34:21 +00:00
Paul Eggert
8b43cfcc59 Add dd noatime. 2005-12-07 21:12:38 +00:00
Paul Eggert
88afdc99f2 (flags, usage): Add support for noatime flag. 2005-12-07 21:12:12 +00:00
Paul Eggert
cb65d67c2a (O_NOATIME): Define to 0 if not already defined. 2005-12-07 21:11:45 +00:00
Paul Eggert
f2ced93400 * coreutils.texi (dd invocation): New noatime flag. 2005-12-07 21:11:27 +00:00
Paul Eggert
0e91392981 (dd invocation): New noatime flag. 2005-12-07 21:11:14 +00:00
Paul Eggert
d17f5073fc Mention dd's new noatime flag. 2005-12-07 21:10:33 +00:00
Paul Eggert
5ea987eade * lib/stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
porting problem reported by Georg Schwarz in
<http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
* m4/stat-time.m4 (gl_STAT_TIME): Likewise.
2005-12-07 18:22:05 +00:00
Jim Meyering
c25ad39393 *** empty log message *** 2005-12-07 16:23:43 +00:00
Jim Meyering
df621389b0 (EXTRA_DIST): Add build-aux/cvsu. 2005-12-07 16:22:24 +00:00
Jim Meyering
24bf7fd4ad (CVS_LIST): Use build-aux/cvsu, now that we have our own copy of cvsu. 2005-12-07 16:10:51 +00:00
Jim Meyering
96d80f5f4a *** empty log message *** 2005-12-07 16:09:54 +00:00
Jim Meyering
db3375452d From Debian unstable: /usr/bin/cvsu. 2005-12-07 16:09:38 +00:00
Jim Meyering
88f5132b30 *** empty log message *** 2005-12-07 16:09:09 +00:00
Jim Meyering
907c710b9a *** empty log message *** 2005-12-07 08:08:15 +00:00
Jim Meyering
5dd8839716 exit-77 before the trap, not after, if we fail
to create a temporary directory on another partition.
2005-12-07 08:08:08 +00:00
Jim Meyering
45daa1a04d *** empty log message *** 2005-12-06 07:14:11 +00:00
Jim Meyering
de69f524a6 Cross-reference to dirname and readlink. 2005-12-06 07:14:04 +00:00
Jim Meyering
bed3e0c42e Cross-reference to basename and readlink. 2005-12-06 07:13:49 +00:00
Paul Eggert
19af464ef3 Mention reporters for "none" and "proc" mounts. 2005-12-05 17:46:22 +00:00
Jim Meyering
e1c945b363 *** empty log message *** 2005-12-04 23:43:55 +00:00
Jim Meyering
f517ded11a *** empty log message *** 2005-12-04 23:34:19 +00:00
Jim Meyering
c837e0038d (fchown) [!HAVE_FCHOWN]: Define fchown(...) to -1.
(set_owner, preserve_author): New functions, factored out of copy_reg.
(copy_reg): Use them.
(copy_internal): Use them here, too.
From Andreas Gruenbacher.
2005-12-04 23:34:14 +00:00
Jim Meyering
5e36a5a28f *** empty log message *** 2005-12-04 22:00:18 +00:00
Jim Meyering
6a33c69c49 (EXPECTED_ERRNO): Add ENOSYS, for Solaris 8.
Paul Eggert reported that unlink/rmdir vs. e.g., /proc/self/fd/N/FILE
fails with ENOSYS.  This makes openat revert to using save-cwd.c
functions in that case.
2005-12-04 22:00:14 +00:00
Jim Meyering
9333b3a359 *** empty log message *** 2005-12-04 09:58:40 +00:00
Jim Meyering
f390052b80 (usage): Say what happens with two or more arguments. 2005-12-04 09:58:34 +00:00
Jim Meyering
ca88a482a5 *** empty log message *** 2005-12-03 23:24:51 +00:00
Jim Meyering
a936ac291c (print_uptime): Move decl of local `upsecs' into scope where it's used. 2005-12-03 23:24:46 +00:00
Jim Meyering
b3e300393e . 2005-12-03 23:19:58 +00:00
Jim Meyering
e12e1864fc *** empty log message *** 2005-12-03 22:24:31 +00:00
Jim Meyering
b867d3fcfb *** empty log message *** 2005-12-03 22:23:40 +00:00
Jim Meyering
08a0a7291f (long_options): Change the name of each undocumented, for-
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
2005-12-03 22:23:23 +00:00
Jim Meyering
43233c319e (long_opts): Change the name of each undocumented, for-
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
2005-12-03 22:23:09 +00:00
Jim Meyering
616fc42b4f Update uses of undocumented, for- testing-only --presume* options
to start with `---'.
2005-12-03 22:16:24 +00:00
Paul Eggert
448d523897 Mention change to jm-macros.m4. 2005-12-02 18:35:33 +00:00
Paul Eggert
6d28d2c738 (gl_MACROS): Adjust to renaming of gl_SOCKLEN_T to gl_TYPE_SOCKLEN_T. 2005-12-02 18:35:19 +00:00
Paul Eggert
48f08b4f53 Fix typo in previous log entry. 2005-12-02 18:23:42 +00:00
Paul Eggert
feb302b9f2 * (gl_TYPE_SOCKLEN_T): Renamed from gl_SOCKLEN_T.
Use implementation from Albert Chin, with some
comments/corrections by Stepan Kasal and myself.
2005-12-02 18:22:10 +00:00
Jim Meyering
e4f62b9fcf *** empty log message *** 2005-12-02 07:49:12 +00:00
Paul Eggert
76bebf24a5 Import from gnulib. 2005-12-02 00:42:52 +00:00
Paul Eggert
b3c0bca1f8 (gl_REGEX): Check whether off_t can be used in a switch
statement, to work around an HP-UX 10.20 compiler bug reported by
Peter O'Gorman.
2005-12-02 00:29:02 +00:00
Jim Meyering
82ff869140 *** empty log message *** 2005-11-30 17:42:36 +00:00
Jim Meyering
be3ef12b92 Add a comment about cvsu. 2005-11-30 17:42:33 +00:00
Jim Meyering
46679371cb *** empty log message *** 2005-11-30 13:05:08 +00:00
Jim Meyering
ea2a4f2658 (gl_FUNC_OPENAT): Require openat-priv.h. 2005-11-30 13:05:03 +00:00
Jim Meyering
798f577bec Include openat-priv.h.
Remove definitions of macros defined therein.
2005-11-30 13:04:26 +00:00
Jim Meyering
07c80bab50 Define macros used by mkdirat.c and openat.c. 2005-11-30 13:03:21 +00:00
Jim Meyering
48a8638c23 *** empty log message *** 2005-11-30 12:40:12 +00:00
Jim Meyering
29a3f2f810 (mkdirat): Declare. 2005-11-30 12:40:09 +00:00
Jim Meyering
3f23bf599c *** empty log message *** 2005-11-30 12:39:30 +00:00
Jim Meyering
2e72b76fd3 (mkdirat): New file and function. 2005-11-30 12:39:14 +00:00
Jim Meyering
76b8c64505 *** empty log message *** 2005-11-30 12:38:05 +00:00
Jim Meyering
7214c0bf70 (gl_FUNC_OPENAT): Require and compile mkdirat.c. 2005-11-30 12:38:02 +00:00
Paul Eggert
fc0fa751c4 Log today's changes. 2005-11-26 07:53:39 +00:00
Paul Eggert
7c69f05221 (df invocation): Document treatment of dummy file
systems better.
2005-11-26 07:52:43 +00:00
Paul Eggert
1e20020bb8 (ME_DUMMY): "none" and "proc" file systems are dummies
too.
2005-11-26 07:52:11 +00:00
Paul Eggert
e9c8be100e (show_point): Ignore inaccessible file systems.
(usage): -a includes dummy file systems, not size-0 file systems.
2005-11-26 07:51:45 +00:00
Paul Eggert
bb14284481 df updates for "none", "proc", inaccessible file systems. 2005-11-26 07:51:27 +00:00
Paul Eggert
45ad3543a9 Include <limits.h>.
(dev_from_mount_options)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
New function.  It no longer assumes "dev=" has the System V meaning
on Linux (since it doesn't).  It also parses "dev=" more carefully.
(read_file_system_list)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
dev= in that case.
2005-11-26 07:43:50 +00:00
Paul Eggert
9b539d8634 (unsigned_long_long_int): Renamed from ulonglong_t,
to avoid collision with POSIX name space.  All uses changed.
2005-11-26 07:29:48 +00:00
Paul Eggert
128bc21842 (MOSTLYCLEANFILES): Clean stdbool.h-t, not stdbool.ht. 2005-11-26 06:58:34 +00:00
Paul Eggert
b7fa297fa5 (stdbool.h): Fix typo in previous change. 2005-11-26 06:55:22 +00:00
Paul Eggert
dedcfff69c (stdbool.h): Just copy stdbool_.h; no need to sed any more. 2005-11-26 06:54:17 +00:00
Paul Eggert
e05c20ea7a no longer needed.
(gl_STDBOOL_H): New macro, from gnulib.
(AC_HEADER_STDBOOL): Sync with gnulib.
2005-11-26 06:37:52 +00:00
Paul Eggert
6771c1b415 Simplify greatly, under the assumption that these
days most people use C99-compatible compilers to debug, so it's
not worth worrying about catering to older compilers for that.
This works around some porting problems with HP-UX compilers.
(false, true) [defined __BEOS__]: Don't #undef; no longer needed.
(_Bool): typedef to bool if C++ or BeOS, and #define to signed char
otherwise.
2005-11-26 06:37:31 +00:00
Paul Eggert
c63680e87b (gettime) [!defined OK_TO_USE_1S_CLOCK]:
Report an error at compile-time if only a 1-second nominal clock
resolution is found.
2005-11-26 06:30:35 +00:00
Jim Meyering
1b7e4389dc *** empty log message *** 2005-11-24 17:25:11 +00:00
Jim Meyering
f85b578dbb (EXTRA_DIST): Add acl to the list. 2005-11-24 17:25:08 +00:00
Jim Meyering
2678a248bb Add `$0: ' prefix to diagnostics. 2005-11-24 17:24:36 +00:00
Jim Meyering
f36a979ac9 *** empty log message *** 2005-11-24 13:42:08 +00:00
Jim Meyering
5ee3356ed3 *** empty log message *** 2005-11-24 13:42:04 +00:00
Jim Meyering
f8f2c8b7b1 Add this:
^lib/buffer-lcm\.c$
2005-11-24 09:04:34 +00:00
Paul Eggert
211d43d85e Improve performance a bit with src/copy.c. 2005-11-24 06:50:11 +00:00
Paul Eggert
25719a3315 Improve performance a bit by optimizing away
unnecessary system calls and going to a block size of at least
8192 (on normal hosts, anyway).  This improved performance 5% on my
Debian stable host (2.4.27 kernel, x86, copying from root
ext3 file system to itself).
Include "buffer-lcm.h".
(copy_reg): Omit last argument.  All callers changed.
Use xmalloc to allocate rather than trusting alloca
(which is unwise with large block sizes).
Declare locals more locally, if possible.
Use uintptr_t words instead of int words, for a bit more speed
when looking for null blocks on 64-bit hosts.
Optimize away reads of zero bytes on regular files.
In the typical case, insist on 8 KiB buffers, at least.
Avoid unnecessary extra call to fstat when checking for sparse files.
Avoid now-unnecessary cast to off_t, and "0L".
Avoid unnecessary test of *new_dst when checking for same owner
and group.
2005-11-24 06:49:44 +00:00
Paul Eggert
757d7a8eb5 Add buffer-lcm. 2005-11-24 06:49:10 +00:00
Paul Eggert
ef774a082b (libcoreutils_a_SOURCES): Add buffer-lcm.c, buffer-lcm.h. 2005-11-24 06:48:55 +00:00
Paul Eggert
79eb35c4e5 Initial version 2005-11-24 06:48:36 +00:00
Paul Eggert
325619eb0d Initial version, from diffutils 2005-11-24 06:48:03 +00:00
Jim Meyering
1aab378857 tweak grammar in comments 2005-11-23 13:36:48 +00:00
Jim Meyering
694b9b330a *** empty log message *** 2005-11-23 13:35:15 +00:00
Jim Meyering
e8609798de (fdopendir): Don't change errno when returning non-NULL. 2005-11-23 13:35:09 +00:00
Paul Eggert
1000eb18b6 (rm): Don't assume C99 for-loop syntax. 2005-11-23 04:52:48 +00:00
Jim Meyering
32034e05b7 whoops. Add back decl/definition of n_lengths. 2005-11-22 21:12:28 +00:00
Jim Meyering
8f092ad8e8 *** empty log message *** 2005-11-22 21:03:43 +00:00
Jim Meyering
f076895070 (AD_push): Remove debugging cruft. 2005-11-22 21:03:36 +00:00
Jim Meyering
5ff678924e tweak comments 2005-11-22 20:05:48 +00:00
Jim Meyering
5db92fc43c *** empty log message *** 2005-11-22 16:23:21 +00:00
Jim Meyering
43f9368331 . 2005-11-22 16:00:04 +00:00
Jim Meyering
6e4cda39d3 *** empty log message *** 2005-11-22 15:59:38 +00:00
Jim Meyering
8c1debf168 Add lib/euidaccess-stat.c. 2005-11-22 15:59:35 +00:00
Jim Meyering
66878248f6 . 2005-11-22 15:33:39 +00:00
Jim Meyering
b5373161d0 Rewrite. Now, this module is reentrant on systems
that provide openat (Solaris), and on systems like Linux+procfs
where our openat emulation code is reentrant.  This also fixes a
few low-probability leaks and eliminates some code that could,
in very unusual circumstances, cause rm() (via a callee) to exit.
2005-11-22 15:33:26 +00:00
Jim Meyering
e76200e6fa *** empty log message *** 2005-11-22 15:32:30 +00:00
Jim Meyering
bc3d6c6e81 Put copyright dates all on one line so the
emacs function that updates them works properly.
2005-11-22 15:32:20 +00:00
Jim Meyering
8d8739a0c5 *** empty log message *** 2005-11-22 15:08:13 +00:00
Jim Meyering
ad1df12ba2 (rm): Change expected diagnostic, cannot open directory' to cannot remove',
to align with new version of rm.
2005-11-22 15:08:09 +00:00
Jim Meyering
901835b8bf *** empty log message *** 2005-11-22 15:06:38 +00:00
Jim Meyering
bf1de05827 Ensure that rm now continues removing entries even after certain types of failure. 2005-11-22 15:06:30 +00:00
Jim Meyering
d0a109b244 *** empty log message *** 2005-11-22 15:04:55 +00:00
Jim Meyering
b8616748f2 Rewrite. Now, this module is reentrant on systems
that provide openat (Solaris), and on systems like Linux+procfs
where our openat emulation code is reentrant.  This also fixes a
few low-probability leaks and eliminates some code that could,
in very unusual circumstances, cause rm() (via a callee) to exit.
2005-11-22 15:04:51 +00:00
Jim Meyering
9c14365b2a *** empty log message *** 2005-11-22 14:53:55 +00:00
Jim Meyering
d591c30293 (openat_permissive): Declare.
(openat_ro): Define.
2005-11-22 14:53:47 +00:00
Jim Meyering
2fa54245e1 (EXPECTED_ERRNO): New macro.
(openat_permissive): New function -- used in remove.c rewrite.
(all functions): Set errno just before returning, only if there
was an actual failure.
Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2005-11-22 14:52:48 +00:00
Jim Meyering
026769d1ce add ^lib/euidaccess-stat\.c$ 2005-11-21 22:59:36 +00:00
Jim Meyering
2f6048508c *** empty log message *** 2005-11-20 18:54:09 +00:00
Jim Meyering
a2895948e9 Remove spurious space-before-TAB. 2005-11-20 18:52:15 +00:00
Jim Meyering
b99b6ac9ff *** empty log message *** 2005-11-20 14:07:13 +00:00
Jim Meyering
8b0e637515 (gl_EUIDACCESS_STAT): New file/macro. 2005-11-20 14:07:09 +00:00
Jim Meyering
75e3f2ecf2 *** empty log message *** 2005-11-20 09:10:35 +00:00
Jim Meyering
800af65fec . 2005-11-20 08:52:08 +00:00
Jim Meyering
18673b9f2d *** empty log message *** 2005-11-20 08:51:38 +00:00
Jim Meyering
e88132fa06 New file, mostly from euidaccess.c. 2005-11-20 08:51:10 +00:00
Jim Meyering
c0c83656d2 *** empty log message *** 2005-11-20 08:28:05 +00:00
Jim Meyering
6ec2bc2d61 Require gl_EUIDACCESS_STAT. 2005-11-20 08:26:38 +00:00
Jim Meyering
a1343d67f2 tweak grammar in a comment 2005-11-19 07:49:10 +00:00
Jim Meyering
fd907a33bd . 2005-11-18 23:12:06 +00:00
Paul Eggert
c7c0e0b0ed * configure.ac (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC. 2005-11-18 23:03:34 +00:00
Paul Eggert
1314a5e7d3 (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
we get a standard-conforming compiler.  This relies on the new
m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
m4/c.m4 can go away with Autoconf 2.60 comes out.
2005-11-18 23:03:11 +00:00
Paul Eggert
efe0b59c14 * c.m4: New file. 2005-11-18 23:02:48 +00:00
Paul Eggert
761440da1b New file, to work around bugs in AIX cc.
Problem reported by James Lemley.  This file can go away
after Autoconf 2.60 comes out.
2005-11-18 23:02:32 +00:00
Paul Eggert
b9267a07a8 * configure.ac (AM_PROG_CC_C_O): Add. 2005-11-18 19:46:19 +00:00
Paul Eggert
a6a99fdf5d (AM_PROG_CC_C_O): Add. Needed for CVS Automake.
Problem reported by Eric Blake.
2005-11-18 19:45:42 +00:00
Jim Meyering
a46640e980 s/filesystem/file system/ in a comment 2005-11-17 21:17:35 +00:00
Jim Meyering
4ace21e534 s/filesystem/file system/ 2005-11-17 21:17:28 +00:00
Jim Meyering
4b4233be05 *** empty log message *** 2005-11-17 20:17:53 +00:00
Jim Meyering
ca7cafb093 (AD_mark_helper): Make a char *' parameter const'.
(AD_mark_current_as_unremovable): Likewise, but for a local.
(rm_1): Likewise.
2005-11-17 20:17:47 +00:00
Jim Meyering
8ee6b05308 . 2005-11-17 20:05:46 +00:00
Jim Meyering
dfae63e27b *** empty log message *** 2005-11-17 20:03:14 +00:00
Jim Meyering
d80dfec1d6 remove commented-out lines 2005-11-17 19:53:07 +00:00
Jim Meyering
e663408a22 Let traps handle removing temporary directories. 2005-11-17 19:52:08 +00:00
Jim Meyering
b02d160c35 *** empty log message *** 2005-11-17 19:08:01 +00:00
Jim Meyering
422bcecd8a (XFAIL_TESTS): Add acl. 2005-11-17 19:06:55 +00:00
Jim Meyering
c5eaca325d (XFAIL_TESTS): Add acl. 2005-11-17 19:06:28 +00:00
Jim Meyering
43acd2b833 (TESTS): Add acl. 2005-11-17 18:38:14 +00:00
Jim Meyering
da2a1139b0 (TESTS): Add acl. 2005-11-17 18:37:47 +00:00
Jim Meyering
66f47a91d1 no need to do `cd $pwd; rm -rf $tmp'; the traps handle that 2005-11-17 18:24:41 +00:00
Jim Meyering
c9b1de9d5e split long line 2005-11-17 18:23:18 +00:00
Jim Meyering
e58e148e51 New tests, from Andreas Gruenbacher. 2005-11-17 18:21:31 +00:00
Jim Meyering
42bfe5a874 New tests, from Andreas Gruenbacher. 2005-11-17 18:21:11 +00:00
Jim Meyering
29eb8e66c2 *** empty log message *** 2005-11-17 18:19:12 +00:00
Jim Meyering
97de3a32b6 (basename_is_dot_or_dotdot): Correct wording in comment. 2005-11-17 12:28:34 +00:00
Jim Meyering
f360c113d5 *** empty log message *** 2005-11-17 12:28:27 +00:00
Paul Eggert
95c4014913 (tail invocation): Say that the obsolete form uses exactly one
option and at most one file.
2005-11-16 22:45:12 +00:00
Paul Eggert
9c0540b548 Improve quality of ln's diagnostics. 2005-11-16 22:33:37 +00:00
Paul Eggert
24ce72f635 (do_link, usage): Improve quality of ln's diagnostics.
(do_link): Don't use alloca on a buffer of unbounded size.
2005-11-16 22:32:45 +00:00
Paul Eggert
ace5616c61 (ln invocation): ln -v now outputs lines only for successful links. 2005-11-16 22:32:16 +00:00
Paul Eggert
114492b826 Improve quality of ln's diagnostics. 2005-11-16 22:31:44 +00:00
Jim Meyering
0278065f3f . 2005-11-16 09:31:07 +00:00
Jim Meyering
db604d8e8a *** empty log message *** 2005-11-16 09:30:25 +00:00
Jim Meyering
9a233da2ab Accommodate HPUX. It appears to fail with EACCES rather than EPERM.
Reported by Peter O'Gorman here:
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
2005-11-16 09:29:32 +00:00
Paul Eggert
8645d522c0 Don't bother with #pragma STDC FENV_ACCESS ON, as
coreutils no longer futzes with rounding modes.
2005-11-15 18:30:28 +00:00
Jim Meyering
12fc258f9f *** empty log message *** 2005-11-15 18:03:26 +00:00
Jim Meyering
087fd33c32 *** empty log message *** 2005-11-15 17:21:12 +00:00
Jim Meyering
53d4c7bf09 *** empty log message *** 2005-11-15 07:24:45 +00:00
Jim Meyering
db5eb389ad Use #if !, not #ifndef, for AC_CHECK_DECLS. 2005-11-14 14:51:24 +00:00
Jim Meyering
6b869921fa *** empty log message *** 2005-11-14 14:51:21 +00:00
Jim Meyering
8d9ddc0c12 *** empty log message *** 2005-11-14 11:07:18 +00:00
Jim Meyering
f0afe32b84 (sort): Mention consequences of today's mkstemp-safer.c fix. 2005-11-14 10:54:07 +00:00
Jim Meyering
be5f6397eb *** empty log message *** 2005-11-14 10:53:58 +00:00
Jim Meyering
ab792811f5 . 2005-11-14 08:17:35 +00:00
Jim Meyering
a0d4d9ab95 (Mode Structure): Capitalize two sentences in an
enumerated list and fix a typo.  From Aaron Hawley.
2005-11-13 18:57:17 +00:00
Jim Meyering
fdbc317e46 *** empty log message *** 2005-11-13 18:57:03 +00:00
Jim Meyering
f4b8a25cb5 *** empty log message *** 2005-11-13 15:17:23 +00:00
Jim Meyering
3275aebb6a (announcement): Use new option and key. 2005-11-13 15:17:18 +00:00
Jim Meyering
233f9cae0c (gpg_key_ID): Define. 2005-11-13 15:17:00 +00:00
Jim Meyering
719d884ff9 Accept new option, --gpg-key-id=ID and
emit a blurb telling how to use the .sig files.
2005-11-13 15:16:40 +00:00
Jim Meyering
ff9382628e remove inadvertently committed hunk (use of new --gpg-key-id option) 2005-11-13 15:08:50 +00:00
Jim Meyering
315d88ac83 *** empty log message *** 2005-11-13 15:06:47 +00:00
Jim Meyering
b1fa77721e (EXTRA_DIST): Add .x-sc_require_config_h here, too. 2005-11-13 15:06:43 +00:00
Jim Meyering
9f9747fc1e New file listing exceptions to the above rule.
Some are legit, others are simply grandfathered in.
2005-11-13 15:06:05 +00:00
Jim Meyering
28c7ac000b *** empty log message *** 2005-11-13 15:05:51 +00:00
Jim Meyering
68943d27f8 Require that most .c files include <config.h>.
(sc_require_config_h): New rule.
(syntax-check-rules): Add it.
2005-11-13 15:05:45 +00:00
Jim Meyering
13e06b3243 *** empty log message *** 2005-11-13 14:07:11 +00:00
Jim Meyering
dcd8aa97f2 Include <config.h>, required for possible replacement of mkstemp. 2005-11-13 14:07:06 +00:00
Jim Meyering
353d44df02 . 2005-11-12 19:11:27 +00:00
Jim Meyering
d81b50dc88 Update from gnulib. 2005-11-12 19:11:17 +00:00
Jim Meyering
3fd87d8e73 *** empty log message *** 2005-11-12 10:16:50 +00:00
Jim Meyering
716377a20a *** empty log message *** 2005-11-12 10:06:34 +00:00
Jim Meyering
108429b83f Emulate openat-family functions using Linux's procfs, if possible.
Idea and some code from Ulrich Drepper's glibc changes.

(BUILD_PROC_NAME): New macro.
Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
(rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
before falling back on save_cwd and restore_cwd.
(fdopendir, fstatat, unlinkat): Likewise.
2005-11-12 10:06:29 +00:00
Jim Meyering
af3cabbf7f s/expensive/very expensive/ in a comment. 2005-11-12 08:54:17 +00:00
Jim Meyering
fd13239884 remove now-unused file 2005-11-12 08:39:27 +00:00
Jim Meyering
8f0753ece7 *** empty log message *** 2005-11-12 08:36:52 +00:00
Jim Meyering
38a1bfa703 . 2005-11-12 08:29:35 +00:00
Jim Meyering
2b46dc5403 *** empty log message *** 2005-11-11 17:16:30 +00:00
Jim Meyering
c0943d140a *** empty log message *** 2005-11-11 17:16:01 +00:00
Jim Meyering
f1126d2639 Mention `readlink -f' bug fix in 5.3.0 news.
Mention new readlink options in `New features' section.
2005-11-11 17:15:06 +00:00
Jim Meyering
7fdc7d4df9 *** empty log message *** 2005-11-10 23:20:09 +00:00
Jim Meyering
e5475103aa (fstatat, unlinkat): Perform the syscall directly,
skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2005-11-10 23:20:05 +00:00
Paul Eggert
3afe2cd61c (gl_PREREQ_GETHRXTIME): Don't require AC_HEADER_TIME
or gettimeofday; no longer needed.
2005-11-10 20:21:07 +00:00
Paul Eggert
4c9fae6b88 gethrxtime now uses gettime 2005-11-10 20:20:51 +00:00
Paul Eggert
9d9e6430a3 Fix comment 2005-11-10 20:20:31 +00:00
Paul Eggert
163141255f Include "timespec.h" rather than the sys/time / time
business.
(gethrxtime) [! (HAVE_NANOUPTIME
|| (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
|| HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
our own approximation.
2005-11-10 20:20:20 +00:00
Paul Eggert
14f7ef9d17 gethrxtime now uses gettime 2005-11-10 20:20:02 +00:00
Jim Meyering
aad084f10f Use /dev/full if possible for descriptor 0 -- like glibc now does.
Fall back on /dev/null if opening /dev/full fails.
2005-11-09 20:53:41 +00:00
Jim Meyering
c5ad46e57f *** empty log message *** 2005-11-08 21:11:00 +00:00
Jim Meyering
8b5df58140 Merge in changes from b5_9x branch. 2005-11-08 21:10:52 +00:00
Paul Eggert
2aa901dadd ls now defaults to --time-style='locale', which in turn acts
like --time-style='posix-long-iso' if the locale settings are messed up.
2005-11-08 21:00:10 +00:00
Paul Eggert
6837183d42 (decode_switches): ls now defaults to --time-style='locale', which in
turn acts like --time-style='posix-long-iso' if the locale settings
are messed up.
2005-11-08 20:59:49 +00:00
Paul Eggert
9391b55213 (Formatting file timestamps): ls now defaults to
--time-style='locale', which in turn acts like
--time-style='posix-long-iso' if the locale settings are messed up.
2005-11-08 20:59:19 +00:00
Paul Eggert
de4224e5df ls now defaults to --time-style='locale'. 2005-11-08 20:58:57 +00:00
Jim Meyering
47d8cac561 *** empty log message *** 2005-11-08 08:20:04 +00:00
Jim Meyering
4c60a9a964 s/expensive/very expensive/ in a comment. 2005-11-08 08:19:57 +00:00
Jim Meyering
ce8f6d2bab *** empty log message *** 2005-11-07 21:42:30 +00:00
Jim Meyering
6d73e34764 *** empty log message *** 2005-11-07 21:42:26 +00:00
Jim Meyering
1ab59b0b84 (usage): Fix descriptions of --sort, --time. 2005-11-07 21:42:23 +00:00
Jim Meyering
59eb233924 *** empty log message *** 2005-11-07 21:39:40 +00:00
Jim Meyering
4413276c24 *** empty log message *** 2005-11-05 09:35:16 +00:00
Jim Meyering
a8d0fd4c1b Include filenamecat.c.
(FILE_BASENAME_CONCAT): Remove.
(do_link): Remove last arg DEST_IS_DIR.  All callers changed.
(main): Use file_name_concat, base_name, and strip_trailing_slashes
instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
the use of alloca.
2005-11-05 09:34:57 +00:00
Jim Meyering
fc7d5aa98a . 2005-11-04 10:15:01 +00:00
Jim Meyering
2c428e4487 . 2005-11-04 10:14:53 +00:00
Jim Meyering
e239238882 mention the du bug fix 2005-11-04 10:10:54 +00:00
Jim Meyering
3b9f405a99 *** empty log message *** 2005-11-04 10:10:36 +00:00
Jim Meyering
33dd08b37b *** empty log message *** 2005-11-04 10:08:54 +00:00
Jim Meyering
933576b440 (process_file): Don't overflow for files of size >= 2^31
on systems with stat.st_blocks of a signed 32-bit type.
This bug causes trouble on some AIX 5.1 systems.
Report and trivial patch from Paul Townsend:
<http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
2005-11-04 10:08:51 +00:00
Jim Meyering
cf18eb7ca4 fix typo in comment 2005-11-04 10:02:36 +00:00
Jim Meyering
ae7a1142ac *** empty log message *** 2005-11-04 09:58:29 +00:00
Jim Meyering
33c6233c8d Mark this test as `very-expensive' 2005-11-04 09:56:38 +00:00
Jim Meyering
58e8de7c4d mark this as a very-expensive test 2005-11-04 09:54:59 +00:00
Jim Meyering
63e0e4288b (TESTS): Add 2g. 2005-11-04 09:54:15 +00:00
Jim Meyering
8227fec80a Test for a bug that bites at least on AIX 5.1 systems. 2005-11-04 09:53:17 +00:00
Jim Meyering
149f1bbd10 just like expensive, but `very' 2005-11-04 09:52:09 +00:00
Jim Meyering
302043681f (EXTRA_DIST): Add very-expensive. 2005-11-04 09:51:42 +00:00
Paul Eggert
4b2069b57f rm -d no longer has any effect, and we plan to remove it (and maybe ln -d). 2005-11-02 21:56:49 +00:00
Paul Eggert
b38883ea2f (usage): Don't mention rm -d. 2005-11-02 21:53:20 +00:00
Paul Eggert
ce1d20289c (rm_option_init): Don't initialize unlink_dirs member, which went away. 2005-11-02 21:52:33 +00:00
Paul Eggert
11fc9bca5f (struct rm_options): Remove unlink_dirs. 2005-11-02 21:51:57 +00:00
Paul Eggert
784e24b06b (rm invocation): Don't mention --directory (-d). 2005-11-02 21:51:35 +00:00
Paul Eggert
162a2d69bc Mention that rm -d and maybe ln -d are scheduled for
removal in 2006.
2005-11-02 21:51:16 +00:00
Jim Meyering
8a64a8b127 *** empty log message *** 2005-11-02 21:29:32 +00:00
Jim Meyering
d8d9b43921 Fix typo in comment: s/fileutils/coreutils. 2005-11-02 21:29:28 +00:00
Jim Meyering
186bf114dd *** empty log message *** 2005-11-02 20:45:24 +00:00
Jim Meyering
812db65afa Redirect stderr to /dev/null so the
M+N records in/out don't pollute `make check' output.
2005-11-02 20:44:59 +00:00
Jim Meyering
ad1faa0f28 *** empty log message *** 2005-11-02 20:37:10 +00:00
Jim Meyering
a49c7ccfe1 (sk-seek4): New test, to exercise the bug
fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
2005-11-02 20:36:36 +00:00
Jim Meyering
83743fc715 Accept a new type of input specifier: IN_PIPE,
to indicate that the input file should be piped into the command
under test (via `cat FILE | $prog ...').
2005-11-02 20:35:52 +00:00
Jim Meyering
e0b652c488 . 2005-11-02 10:04:14 +00:00
Jim Meyering
f626cd65cc *** empty log message *** 2005-11-02 09:58:43 +00:00
Jim Meyering
588df316d9 (remove_entry): Emit a better diagnostic when rm
(without -r) fails to remove a directory on a non-Linux system.
This change affects only newer Solaris systems (with priv_*
functions like priv_allocset).  Reported by Keith Thompson.
2005-11-02 09:47:39 +00:00
Jim Meyering
4db5b5cf11 test for today's fix 2005-11-02 09:38:38 +00:00
Jim Meyering
4df4047d35 (TESTS): Add dir-nonrecur. 2005-11-02 09:38:16 +00:00
Paul Eggert
4b15886f93 "touch 0101000000" now operates as POSIX 1002.1-2001 requires. 2005-11-01 23:43:38 +00:00
Paul Eggert
473a0d6209 Add y2000 test. 2005-11-01 23:42:57 +00:00
Paul Eggert
a2bacbdc9c (main): Pass PDS_PRE_2000 to posixtime. 2005-11-01 23:42:36 +00:00
Paul Eggert
71fa8dc28e (PDS_PRE_2000): New macro. 2005-11-01 23:42:16 +00:00
Paul Eggert
1a0a832ac8 (year): Arg is now syntax_bits rather than allow_century.
All usages changed.  Reject dates outside the range 1969-1999 if
PDS_PRE_2000 is used.
2005-11-01 23:41:56 +00:00
Paul Eggert
d6fa12c0f9 (touch invocation): The old usage works only for 1969-1999 now. 2005-11-01 23:41:33 +00:00
Paul Eggert
fd449d30a8 "touch 0101000000" now operates as POSIX 1003.1-2001 requires. 2005-11-01 23:41:13 +00:00
Paul Eggert
0287c32733 "tail -c 2 FILE" now operates as POSIX 1003.1-2001 requires. 2005-11-01 23:06:32 +00:00
Paul Eggert
407fb46c87 (c-2, c-2-minus, c2, c2-minus): New tests.
(test_vector): Add special cases for _POSIX2_VERSION, and
regularize the old ones a bit.
2005-11-01 23:05:52 +00:00
Paul Eggert
99f09784cc (parse_obsolete_option): Implement fix for "tail -c 2 FILE". 2005-11-01 23:05:29 +00:00
Paul Eggert
4fb9c70faf (tail invocation): Describe obsolete usages
like "tail -2" more precisely.
2005-11-01 23:05:00 +00:00
Paul Eggert
18eb295ec4 tail -c 2 FILE now operates as POSIX 1002.1-2001 requires. 2005-11-01 23:04:37 +00:00
Paul Eggert
a53513f142 * src/dd.c (skip): Fix off-by-one error. 2005-10-31 08:39:36 +00:00
Paul Eggert
91f8e15bff (skip): Fix off-by-one error reported by Theodoros V. Kalamatianos. 2005-10-31 08:39:14 +00:00
Paul Eggert
15d4c70e08 Trivial changes to support SCO systems. 2005-10-30 23:05:16 +00:00
Paul Eggert
a504db1780 (gl_FUNC_CHDIR_LONG): Check for MAXPATHLEN as well as PATH_MAX.
Revamp wording and local variables to suggest the intended function of
the PATH_MAX check.
2005-10-30 23:04:55 +00:00
Paul Eggert
3103c9009b (gl_FUNC_FPENDING): Correct check for SCO systems,
where __ptr is null when no I/O is pending.
2005-10-30 23:04:17 +00:00
Paul Eggert
a54170c2a0 Fix porting problems reported by Theodoros V. Kalamatianos. 2005-10-30 21:46:00 +00:00
Paul Eggert
9b700d84f7 * tests/mkdir/p-3: Require that the test be run as non-root. 2005-10-30 21:45:45 +00:00
Paul Eggert
d9b19cac60 Require that the test be run as non-root. 2005-10-30 21:44:53 +00:00
Paul Eggert
9c9083d9a7 [defined HAVE_CONFIG_H]: Include <config.h>, so that large files can be opened. 2005-10-30 21:44:31 +00:00
Paul Eggert
9fb982e150 (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
Don't assume that futimes failing means we must fail.
2005-10-30 21:32:02 +00:00
Paul Eggert
b90c07efd8 (__getcwd): Don't assume that system calls after readdir
leave errno alone.  Problem reported by Dmitry V. Levin.
2005-10-30 01:31:32 +00:00
Paul Eggert
5648577df0 (savedir): Don't assume that xrealloc etc. leave errno alone. 2005-10-28 23:06:42 +00:00
Paul Eggert
cada888edd src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
boundary between DEST and SOURCE in the result.
2005-10-28 22:17:27 +00:00
Paul Eggert
50a6da201b (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
boundary between DEST and SOURCE in the result.
2005-10-28 22:17:00 +00:00
Jim Meyering
f6d480b0a7 *** empty log message *** 2005-10-27 19:44:45 +00:00
Jim Meyering
cc7c372176 *** empty log message *** 2005-10-27 16:27:15 +00:00
Jim Meyering
84131ca42b (main) [!O_BINARY]: Changed default read mode
back to text, to sync with documentation and for backwards compatibility.
2005-10-27 16:27:04 +00:00
Jim Meyering
9793cca908 Add these: sha224sum sha256sum sha384sum sha512sum 2005-10-26 21:46:24 +00:00
Jim Meyering
1828ebcc26 *** empty log message *** 2005-10-25 13:50:30 +00:00
Jim Meyering
c30dcb08eb . 2005-10-25 13:47:38 +00:00
Jim Meyering
55b84cf932 *** empty log message *** 2005-10-25 12:03:56 +00:00
Jim Meyering
47af602add *** empty log message *** 2005-10-25 12:00:55 +00:00
Jim Meyering
7a3af1eb39 (other-wr): Add an explicit test for
the dircolors bug (NULL-dereference) fixed yesterday.
2005-10-25 12:00:51 +00:00
Jim Meyering
91795f6fa2 (tac_file): When determining whether a file is seekable,
also test whether it is a tty.  Using only the lseek-based test would
give a false positive on Solaris.  Reported by Peter Fales.
2005-10-24 16:07:36 +00:00
Jim Meyering
b9165cb373 *** empty log message *** 2005-10-24 16:07:28 +00:00
Jim Meyering
8578313a4a . 2005-10-24 13:44:58 +00:00
Jim Meyering
0938dcec7b *** empty log message *** 2005-10-24 13:42:28 +00:00
Jim Meyering
075b283689 (TESTS): Add p-slashdot. 2005-10-24 13:42:21 +00:00
Jim Meyering
e082e26ce0 New test, for "mkdir -p" failure. 2005-10-24 13:42:02 +00:00
Jim Meyering
f169968735 (TESTS): Add d-slashdot. 2005-10-24 13:41:41 +00:00
Jim Meyering
465b852e3b New test, for "install -d" failure. 2005-10-24 13:41:17 +00:00
Jim Meyering
e928445598 *** empty log message *** 2005-10-24 13:36:03 +00:00
Jim Meyering
e8871a9516 (make_dir_parents): Like the code above it, don't rely
on mkdir failing with a particular errno value (EEXIST).
Based on a patch by Dmitry V. Levin.
2005-10-24 13:35:59 +00:00
Jim Meyering
30bf08a3da rename array_cardinality to array_len 2005-10-24 10:39:46 +00:00
Jim Meyering
d038ef379e *** empty log message *** 2005-10-24 10:22:19 +00:00
Jim Meyering
b8cedd257a (make_dir_parents): Make the preceding fix a little
more robust, e.g., when the final component is created as a non-
directory by another process just before `mkdir -p's final mkdir.
2005-10-24 10:22:10 +00:00
Jim Meyering
946e7dc930 *** empty log message *** 2005-10-24 10:03:51 +00:00
Jim Meyering
5b427ce7c3 A command like `mkdir -p nonexistent/.' would create the
directory but exit nonzero with a diagnostic.  This could also be
triggered with a non-`.' component, e.g., in a race with another
process running the same `mkdir -p nonexistent/sub' command.

(make_dir_parents): Handle the case of an existing final component.
Reported by Matthias Andree here:
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
2005-10-24 10:03:47 +00:00
Jim Meyering
ce44b29901 *** empty log message *** 2005-10-24 09:55:13 +00:00
Jim Meyering
295bdba02c (ls_codes): Add missing comma.
Anonymous report and patch from
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
2005-10-24 09:55:00 +00:00
Jim Meyering
b648b4af3d Add a compile-time assertion that the slack_codes
and ls_codes arrays have the same number of elements.  This would
have prevented the above-fixed bug.
2005-10-24 09:43:01 +00:00
Jim Meyering
4005639856 *** empty log message *** 2005-10-24 09:01:15 +00:00
Jim Meyering
91c0fe6767 (Makefile): Remove stray po-directories argument. 2005-10-24 09:01:02 +00:00
Jim Meyering
bc8ada5325 *** empty log message *** 2005-10-24 08:17:00 +00:00
Jim Meyering
5c0879b3ca Update from gettext cvs (0.15). 2005-10-24 08:13:39 +00:00
Jim Meyering
84aca29abf *** empty log message *** 2005-10-24 07:28:57 +00:00
Jim Meyering
57d5938b17 * src/expand.c (parse_tab_stops): Add comment to make this function
identical to the one in unexpand.c.

* src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
identical to the one in expand.c.
2005-10-24 07:28:39 +00:00
Jim Meyering
48e6b74278 *** empty log message *** 2005-10-24 07:18:25 +00:00
Jim Meyering
315b42ce8e (next_file): Don't assume fopen cannot return stdin. 2005-10-24 07:18:18 +00:00
Jim Meyering
d0889c6d10 . 2005-10-23 20:48:56 +00:00
Jim Meyering
d3a1d47934 *** empty log message *** 2005-10-23 16:05:32 +00:00
Jim Meyering
aa2165429c Document SHA-1 and SHA-2 utlities. 2005-10-23 16:05:26 +00:00
Jim Meyering
b7d83f310d *** empty log message *** 2005-10-23 16:01:21 +00:00
Jim Meyering
708c4e6682 . 2005-10-23 16:00:59 +00:00
Jim Meyering
79999f2e85 *** empty log message *** 2005-10-23 16:00:25 +00:00
Jim Meyering
f0b2494fa6 *** empty log message *** 2005-10-23 15:59:09 +00:00
Jim Meyering
441c8bd865 from David Madore 2005-10-23 15:58:59 +00:00
Jim Meyering
00ba9322af Remove no-longer-relevant comment. 2005-10-23 15:55:30 +00:00
Jim Meyering
e2cfa48b0f from David Madore 2005-10-23 15:53:55 +00:00
Jim Meyering
d294610a58 *** empty log message *** 2005-10-23 15:47:07 +00:00
Jim Meyering
c5795228dd test scripts from David Madore 2005-10-23 15:46:39 +00:00
Jim Meyering
1ad9207ebb (TESTS): Add new sha224sum, sha256sum, sha384sum, sha512sum test scripts
here rather that each in its own directory.
2005-10-23 15:46:14 +00:00
Jim Meyering
ac3fa5399b Add new sha* programs. 2005-10-23 15:37:53 +00:00
Jim Meyering
b6b139e070 *** empty log message *** 2005-10-23 15:37:04 +00:00
Jim Meyering
d45f1b2d27 Add gl_SHA256 and gl_SHA512. 2005-10-23 15:37:00 +00:00
Jim Meyering
2c91d95619 . 2005-10-23 15:36:49 +00:00
Jim Meyering
ce9b73cda4 *** empty log message *** 2005-10-23 15:36:09 +00:00
Jim Meyering
123571ad4d Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
Add their names to the list.
2005-10-23 15:31:44 +00:00
Jim Meyering
1974bccc56 (digest_check, main): Use ptr_align rather than
a dangerous pointer-value-to-`unsigned' cast.
2005-10-23 15:29:25 +00:00
Jim Meyering
5528d926f6 *** empty log message *** 2005-10-23 15:25:19 +00:00
Jim Meyering
c999d42c57 New file, used to build sha* programs from md5sum.c. 2005-10-23 15:25:14 +00:00
Jim Meyering
3b63180c8c (sha224sum, sha256sum, sha384sum, sha512sum): Rules for compiling sha-2 utilities
(noinst_HEADERS): Remove checksum.h.
2005-10-23 15:23:56 +00:00
Jim Meyering
61fa9f0cfe Provide framework for computing sha-2 hashes. 2005-10-23 15:22:02 +00:00
Jim Meyering
e849be6c8b *** empty log message *** 2005-10-23 15:18:48 +00:00
Jim Meyering
f4b517cb6d add sha-2 .x files 2005-10-23 15:18:13 +00:00
Jim Meyering
0ebfe3cf4b (dist_man_MANS): Add the corresponding .1 names.
(sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
2005-10-23 15:17:41 +00:00
Jim Meyering
426b5f6752 *** empty log message *** 2005-10-23 14:32:25 +00:00
Jim Meyering
4d895ec806 (million-a): Add the "million a's" test (one of the FIPS test vectors). 2005-10-23 14:32:18 +00:00
Jim Meyering
7ac64b812e . 2005-10-23 14:19:22 +00:00
Jim Meyering
b5c354ca15 *** empty log message *** 2005-10-23 10:42:16 +00:00
Jim Meyering
9db8ccf72a *** empty log message *** 2005-10-23 10:41:50 +00:00
Jim Meyering
7fc7e01a25 Use 6.0-cvs as the version string. 2005-10-23 10:41:18 +00:00
Jim Meyering
d5e98be935 . 2005-10-22 21:10:03 +00:00
Jim Meyering
b2bbe32f13 . 2005-10-22 20:59:27 +00:00
Jim Meyering
67e7f7d858 . 2005-10-22 18:15:06 +00:00
Jim Meyering
14a27f617b *** empty log message *** 2005-10-22 18:13:04 +00:00
Jim Meyering
8aa50018a0 Remove -cvs suffix from version string. 2005-10-22 18:12:57 +00:00
Jim Meyering
27ad9d14e9 *** empty log message *** 2005-10-22 18:12:23 +00:00
Jim Meyering
d0df944db9 *** empty log message *** 2005-10-22 18:11:07 +00:00
Jim Meyering
c3d97a0aa6 . 2005-10-20 14:30:53 +00:00
Jim Meyering
971b478896 *** empty log message *** 2005-10-20 14:29:41 +00:00
Jim Meyering
23d83ccba1 Mention this chmod fix as well as the dircolors one. 2005-10-20 14:29:38 +00:00
Jim Meyering
d87b9dfa10 (TESTS): Add octal. 2005-10-20 14:27:03 +00:00
Jim Meyering
eaecbde30d New file, to exercise today's lib/modechange.c fix. 2005-10-20 14:24:29 +00:00
Jim Meyering
1e12a6ad1e *** empty log message *** 2005-10-20 14:20:41 +00:00
Jim Meyering
a4667affc0 (mode_compile): Reject an invalid mode string that
starts with an octal digit.  From Andreas Gruenbacher.
2005-10-20 14:20:34 +00:00
Jim Meyering
7aff553950 . 2005-10-19 07:37:10 +00:00
Jim Meyering
dee664c8bb (append_quoted): Quote ' correctly.
Problem reported by Eric Blake.
2005-10-19 07:32:14 +00:00
Jim Meyering
21735a5358 *** empty log message *** 2005-10-19 07:32:04 +00:00
Jim Meyering
36faf23911 *** empty log message *** 2005-10-19 07:30:58 +00:00
Jim Meyering
276ecc89de (quote): Add test for the above fix. 2005-10-19 07:30:48 +00:00
Jim Meyering
388bf87b8d *** empty log message *** 2005-10-18 09:20:32 +00:00
Jim Meyering
efad655ef4 Add a comment explaining (probably) why this
test fails on OpenBSD 3.2 when run in an NFS-mounted directory.
2005-10-18 09:14:36 +00:00
Jim Meyering
9353affeec *** empty log message *** 2005-10-17 15:23:21 +00:00
Jim Meyering
b09b33285a Use 5.92-cvs as the version string. 2005-10-17 15:23:17 +00:00
Jim Meyering
1f4f154e46 (my-distcheck): Depend on
$(release_archive_dir)/$(prev-tgz) here, so that if it's missing
we fail earlier.
2005-10-17 06:58:46 +00:00
Jim Meyering
b3665517eb . 2005-10-16 22:17:31 +00:00
Jim Meyering
9cfc53bf54 now it's the 17th 2005-10-16 22:07:00 +00:00
Jim Meyering
2bff118a36 typo 2005-10-16 21:01:48 +00:00
Jim Meyering
9c2e9b49d1 . 2005-10-16 12:28:06 +00:00
Jim Meyering
0652d12852 whoops. Don't put $$today inside single quotes. 2005-10-16 11:00:22 +00:00
Jim Meyering
8fe2b26799 *** empty log message *** 2005-10-16 10:58:02 +00:00
Jim Meyering
a7ffedd708 (VERSION_REGEXP): New variable.
(news-date-check, changelog-check): Use tighter regular expressions.
2005-10-16 10:57:58 +00:00
Jim Meyering
2487210cb4 remove -cvs suffix 2005-10-16 10:38:40 +00:00
Jim Meyering
f0e03c732d *** empty log message *** 2005-10-16 10:36:02 +00:00
Jim Meyering
7baaad040a . 2005-10-16 10:35:27 +00:00
Jim Meyering
284a97768e *** empty log message *** 2005-10-16 10:24:57 +00:00
Jim Meyering
dba603f83a Mention the `mkdir -p' bug fix. 2005-10-16 10:24:41 +00:00
Jim Meyering
2c12c963b1 Remove -cvs suffix from version string. For 5.91. 2005-10-16 09:51:04 +00:00
Jim Meyering
9385c40824 *** empty log message *** 2005-10-16 09:50:13 +00:00
Jim Meyering
d948c0308a (Top, General output formatting, dir invocation):
(vdir invocation): Don't document the old v and d commands.
2005-10-16 07:27:04 +00:00
Jim Meyering
13d8990203 *** empty log message *** 2005-10-16 07:26:42 +00:00
Jim Meyering
7fdc81ede5 *** empty log message *** 2005-10-15 15:23:36 +00:00
Jim Meyering
05da3cb908 *** empty log message *** 2005-10-15 15:01:28 +00:00
Jim Meyering
2fa2315d0c (usage): Undocument deprecated --idle (-i) option. 2005-10-15 15:01:22 +00:00
Jim Meyering
e418d03571 (who invocation): Remove documentation for deprecated --idle (-i). 2005-10-15 14:59:17 +00:00
Jim Meyering
c6ee1b3a32 . 2005-10-15 10:23:47 +00:00
Jim Meyering
b54de31c76 . 2005-10-15 10:21:39 +00:00
Jim Meyering
999a43859a *** empty log message *** 2005-10-15 10:15:56 +00:00
Jim Meyering
15e97882ff (main): Remove --link -l options.
You can use --dereference (-L) instead.
2005-10-15 10:15:48 +00:00
Jim Meyering
f90df192b4 (parse_options): Remove --allow-missing option.
You can use --retry instead.
2005-10-15 10:15:34 +00:00
Jim Meyering
69dc13717a (usage): Document -m, once again.
(main): Warn about use of deprecated long options: --kilobytes and --megabytes.
2005-10-15 10:14:13 +00:00
Jim Meyering
4ecdd8ce4c (decode_switches): Warn about the deprecated --kilobytes option. 2005-10-15 09:56:21 +00:00
Jim Meyering
9624dcd0ee (main): Warn about the deprecated --kilobytes option. 2005-10-15 09:56:03 +00:00
Jim Meyering
a7164e425a *** empty log message *** 2005-10-15 08:34:53 +00:00
Jim Meyering
22449f0d02 (du invocation): Document du's -m option, now that we've decided to keep it. 2005-10-15 08:34:48 +00:00
Jim Meyering
5e3bd56977 *** empty log message *** 2005-10-13 20:12:15 +00:00
Jim Meyering
03e3b41e75 Avoid a few overfull/underfull hboxes. 2005-10-13 20:12:10 +00:00
Jim Meyering
e08cff1ba5 *** empty log message *** 2005-10-13 20:06:11 +00:00
Jim Meyering
146465b816 Sync from gnulib. 2005-10-13 20:06:07 +00:00
Paul Eggert
2ec133706a (make_dir_parents): Don't report an error if an
intermediate directory is in a read-only file system.
2005-10-13 19:05:13 +00:00
Jim Meyering
71a4b4865c *** empty log message *** 2005-10-13 14:16:23 +00:00
Jim Meyering
757e44d875 Document dircolors change of 2005-09-05. 2005-10-13 14:16:19 +00:00
Jim Meyering
898e531c01 *** empty log message *** 2005-10-13 14:12:58 +00:00
Jim Meyering
74583cd9fb (.x.1): Remove temp directory first. 2005-10-13 14:12:51 +00:00
Jim Meyering
76890ff048 *** empty log message *** 2005-10-08 09:06:16 +00:00
Jim Meyering
40bf0efd47 (rpl_openat): Use the promoted type (int), not mode_t,
as second argument to va_arg.  Otherwise, some versions of gcc
warn that `if this code is reached, the program will abort'.
2005-10-08 09:05:08 +00:00
Jim Meyering
f754c25d4c *** empty log message *** 2005-10-07 22:07:36 +00:00
Jim Meyering
82ee4b140c Merge from gnulib.
(SIZE_MAX): New macro, if not already defined.
2005-10-07 22:07:27 +00:00
Jim Meyering
a9ede5e986 . 2005-10-07 19:42:03 +00:00
Jim Meyering
8f8a513667 *** empty log message *** 2005-10-07 19:30:26 +00:00
Jim Meyering
cb16682ede revert last change 2005-10-07 19:29:44 +00:00
Paul Eggert
bff08feb9b * stdbool.m4 (AC_HEADER_STDBOOL): Add an "#ifdef __xlc__" test. 2005-10-07 18:53:41 +00:00
Paul Eggert
25041cf0f9 (AC_HEADER_STDBOOL): Add an "#ifdef __xlc__" test,
since yesterday's attempt didn't work.
2005-10-07 18:53:20 +00:00
Paul Eggert
b17333e415 Redo previous change to sort.c. 2005-10-07 18:48:55 +00:00
Paul Eggert
4778617abc (sortlines_temp): Redo previous change, since I'm no longer confident
that the m4/stdbool.m4 patch suffices.
2005-10-07 18:48:28 +00:00
Paul Eggert
a0d42f7861 Generalize the patch for the AIX bool bug. 2005-10-06 16:42:22 +00:00
Paul Eggert
cb797070ce (AC_HEADER_STDBOOL): Check that bool
promotes to int, not unsigned int, to catch the AIX 5.3
compiler bug.
2005-10-06 16:40:36 +00:00
Paul Eggert
38ffebe4ac (sortlines_temp): Undo previous change, since
today's change to m4/stdbool.m4 should catch it.
2005-10-06 16:40:13 +00:00
Jim Meyering
028b5117d4 *** empty log message *** 2005-10-06 14:12:52 +00:00
Jim Meyering
e1cd990287 *** empty log message *** 2005-10-06 14:06:54 +00:00
Jim Meyering
84f1db3726 rm: add support for a -I option, like that from FreeBSD's rm. 2005-10-06 14:06:51 +00:00
Jim Meyering
132aaa2eac Add a comment to go with the last change. 2005-10-05 18:56:29 +00:00
Jim Meyering
b185a8b904 *** empty log message *** 2005-10-05 18:53:59 +00:00
Jim Meyering
111bac9943 (sortlines_temp): Declare temporary as `int' rather
than `bool' to work around AIX 5.3 compiler bug in 64-bit mode.
2005-10-05 18:53:55 +00:00
Jim Meyering
3614c42902 *** empty log message *** 2005-10-05 14:54:20 +00:00
Jim Meyering
05e1975d08 (libcoreutils_a_DEPENDENCIES): Remove definition.
Once it's gone, automake generates an equivalent one.
2005-10-05 14:54:17 +00:00
Jim Meyering
d3b8165328 Merge from gnulib. 2005-10-05 09:09:33 +00:00
Jim Meyering
df2b4d3451 *** empty log message *** 2005-10-05 09:09:27 +00:00
Jim Meyering
ed558df65b *** empty log message *** 2005-10-04 15:51:25 +00:00
Jim Meyering
4dffc10f08 Merge from gnulib.
Include sys/types.h before other headers.
2005-10-04 15:51:20 +00:00
Jim Meyering
2928a59fe5 . 2005-10-03 16:13:06 +00:00
Jim Meyering
70a7e357d6 *** empty log message *** 2005-10-03 12:12:21 +00:00
Jim Meyering
c7676c0b6b (MAX_N_FACTORS): Define in terms of sizeof (uintmax_t)
rather than hard-coding to 128.  From Thomas M.Ott.
2005-10-03 12:12:14 +00:00
Jim Meyering
314397e7c5 *** empty log message *** 2005-10-03 12:11:49 +00:00
Paul Eggert
ca7be84526 Import getdelim.c from gnulib (to fix unused var warnings) then
apply the following fixes:
Include getdelim.h first.  Include <limits.h>.
(SSIZE_MAX): New macro, if not already defined.
(getdelim): Fix buffer overrun on 64-bit hosts with lines longer
than 2 GiB.
2005-10-02 22:49:49 +00:00
Jim Meyering
fbc02ac784 *** empty log message *** 2005-10-02 10:09:18 +00:00
Jim Meyering
1cf46dda93 (gl_FUNC_CHDIR_LONG): Compare $gl_have_path...
against `yes', rather than just testing for nonempty.
2005-10-02 10:09:14 +00:00
Jim Meyering
e7d6dd7451 *** empty log message *** 2005-10-02 06:29:31 +00:00
Jim Meyering
b0dcbf34a5 (sc_unmarked_diagnostics): Search only cvs-controlled files. 2005-10-02 06:29:26 +00:00
Jim Meyering
286411fd74 *** empty log message *** 2005-10-02 06:28:15 +00:00
Jim Meyering
8653e104a3 Add lib/euidaccess-stat.c. 2005-10-02 06:28:12 +00:00
Jim Meyering
994ae8ed47 Add .x-sc_unmarked_diagnostics. 2005-10-02 06:27:32 +00:00
Jim Meyering
e470936662 *** empty log message *** 2005-10-02 06:27:09 +00:00
Jim Meyering
e102280994 . 2005-10-02 06:22:00 +00:00
Jim Meyering
1f022b6b96 Include sys/types.h for sys/socket.h, on FreeBSD and Darwin. 2005-10-01 11:59:08 +00:00
Jim Meyering
a2a3fc0ac7 *** empty log message *** 2005-10-01 11:58:50 +00:00
Jim Meyering
adcbbb9946 . 2005-10-01 09:51:00 +00:00
Jim Meyering
22c2d2efaf *** empty log message *** 2005-10-01 09:50:09 +00:00
Jim Meyering
4a6b465285 *** empty log message *** 2005-10-01 09:49:40 +00:00
Jim Meyering
8050751a86 Protect #include's of sys/socket.h and netdb.h.
Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
AI_* and EAI_* definitions.  Protect function declarations.
2005-10-01 09:49:36 +00:00
Jim Meyering
e1170f4d9e *** empty log message *** 2005-10-01 09:49:14 +00:00
Jim Meyering
614623a670 (gl_PREREQ_GETADDRINFO): Use AC_GNU_SOURCE,
GNU declares only getaddrinfo as an (POSIX) extension.
Check for sys/types.h, sys/socket.h, and netdb.h too,
needed by getaddrinfo.h.
Check if getaddrinfo, freeaddrinfo and gai_strerror are
declared by the POSIX headers.
Check if struct addrinfo is declared.
2005-10-01 09:49:09 +00:00
Jim Meyering
5c8ecd2831 Add a test for this:
(main): Don't stop processing arguments upon the first invalid one.
2005-10-01 08:02:09 +00:00
Jim Meyering
9c06ae5cff *** empty log message *** 2005-10-01 08:01:40 +00:00
Jim Meyering
46f0e13d5b *** empty log message *** 2005-10-01 08:01:30 +00:00
Jim Meyering
157712c3cb (main): Don't stop processing arguments upon the first invalid one. 2005-10-01 08:01:25 +00:00
Jim Meyering
5664caead1 . 2005-10-01 07:44:04 +00:00
Jim Meyering
18794c7464 *** empty log message *** 2005-10-01 06:54:15 +00:00
Jim Meyering
b364a72c6b (gl_GETADDRINFO): Look for getservbyname in these
libraries [inet nsl socket xnet].  Nelson Beebe reported that with
native cc on Solaris 7, getaddrinfo.c requires -lsocket.
2005-10-01 06:54:11 +00:00
Jim Meyering
f9c10dab98 *** empty log message *** 2005-09-30 15:21:26 +00:00
Jim Meyering
9b1facc61f (gl_FUNC_OPENAT): Check for fdopendir. 2005-09-30 15:21:19 +00:00
Jim Meyering
03866dcfb9 (fdopendir): Do not define if HAVE_FDOPENDIR. 2005-09-30 15:19:47 +00:00
Jim Meyering
5230885d13 (fdopendir): Do not define if HAVE_FDOPENDIR.
Remove AT_FDCWD test.
Do not consume the fd unless successful.
2005-09-30 15:19:24 +00:00
Jim Meyering
e94c88d4a2 Use 5.91-cvs as the version string. 2005-09-30 05:46:48 +00:00
Paul Eggert
85f86d456d * src/dd.c (main): Don't assume size_t has the same width as unsigned long. 2005-09-30 05:07:49 +00:00
Paul Eggert
86b4df4f0d (main): Don't assume size_t has the same width
as unsigned long.  Problem reported by Eric Blake.
2005-09-30 05:07:11 +00:00
Paul Eggert
a93720f8ac Clarify "tail - f" example. 2005-09-30 04:50:48 +00:00
Jim Meyering
89e6ed115f . 2005-09-29 18:10:25 +00:00
1613 changed files with 77408 additions and 553791 deletions

View File

@@ -1,10 +0,0 @@
.kludge-stamp
Makefile
THANKS-to-translators
autom4te.cache
config.cache
config.h
config.log
config.status
config.status.lineno
stamp-h1

7
.gitattributes vendored Normal file
View File

@@ -0,0 +1,7 @@
*.texi* diff=texinfo
# Put something like the following e.g., in your ~/.gitconfig file
# # Include proper "function name" string in diffs of texinfo.
# # Derived from the regexp in emacs' lisp/add-log.el.
# [diff "texinfo"]
# funcname = "^@node[ \t][ \t]*\\([^,][^,]*\\)"

74
.gitignore vendored Normal file
View File

@@ -0,0 +1,74 @@
*.I[12]
*.[EIOX]
*.o
*/.deps
*~
.gdb-history
.kludge-stamp
.tarball-version
.version
ABOUT-NLS
ChangeLog
GNUmakefile
ID
INSTALL
Makefile
Makefile.in
TAGS
THANKS-to-translators
aclocal.m4
autom4te.cache
build-aux/.gitignore
build-aux/compile
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/mdate-sh
build-aux/missing
build-aux/texinfo.tex
build-aux/ylwrap
config.cache
config.h
config.hin
config.log
config.status
configure
coreutils-*.tar.bz2
coreutils-*.tar.bz2.sig
coreutils-*.tar.gz
coreutils-*.tar.gz.sig
coreutils-*.tar.lzma
coreutils-*.tar.lzma.sig
gnulib-tests
lib/.cvsignore
lib/.gitignore
lib/arpa
lib/binary-io.h
lib/charset.alias
lib/configmake.h
lib/libcoreutils.a
lib/printf.c
lib/progname.c
lib/progname.h
lib/selinux
lib/uniwidth
m4/.cvsignore
m4/.gitignore
maint.mk
man/*.1
po/*.gmo
po/*.po
po/.gitignore
po/.reference
po/LINGUAS
po/Makefile.in
po/Makevars
po/POTFILES
po/checksums
po/coreutils.pot
po/stamp-po
src/version.c
src/version.h
stamp-h1
tests/*/*.log

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "gnulib"]
path = gnulib
url = git://git.sv.gnu.org/gnulib.git

View File

@@ -1 +1 @@
5.3.0
8.0

View File

@@ -1,3 +1,20 @@
# Suppress valgrind diagnostics we don't care about.
# Copyright (C) 2003, 2004, 2006-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
{
libc_dl_open
Memcheck:Cond
@@ -30,3 +47,54 @@
sigaction(act)
fun:__libc_sigaction
}
{
libc_expand_dynamic_string_token
Memcheck:Cond
fun:strlen
fun:expand_dynamic_string_token
obj:*
obj:*
obj:*
obj:*
obj:*
}
{
libc__dl_new_object
Memcheck:Cond
fun:strlen
fun:_dl_new_object
obj:*
obj:*
obj:*
obj:*
}
{
libc_fillin_rpath
Memcheck:Cond
fun:strlen
fun:fillin_rpath
}
{
libc-getpwuid-leak
Memcheck:Leak
fun:malloc
fun:nss_parse_service_list
fun:__nss_database_lookup
obj:*
obj:*
fun:getpwuid_r@@GLIBC_2.2.5
fun:getpwuid
fun:getuser
fun:format_user_width
fun:gobble_file
fun:main
}
{
utimensat-NULL
Memcheck:Param
utimensat(filename)
fun:futimens
fun:gl_futimens
fun:main
}

1
.x-sc_GPL_version Normal file
View File

@@ -0,0 +1 @@
^build-aux/check\.mk$

View File

@@ -0,0 +1 @@
build-aux/cvsu

View File

@@ -1,7 +1,5 @@
ChangeLog
Makefile.maint
NEWS
config-log
po/
src/df.c
src/stat.c
tests/misc/df-P

View File

@@ -1,5 +1 @@
ChangeLog*
Makefile.maint
config.hin
configure
m4/jm-macros.m4
ChangeLog

1
.x-sc_po_check Normal file
View File

@@ -0,0 +1 @@
^gl/

2
.x-sc_program_name Normal file
View File

@@ -0,0 +1,2 @@
gl/lib/randint.c
lib/euidaccess-stat.c

View File

@@ -1,7 +1 @@
^configure$
ChangeLog
^lib/mktime\.c$
^lib/getloadavg\.c$
^lib/euidaccess\.c$
^lib/group-member\.c$
^Makefile\.maint$
^lib/euidaccess-stat\.c$

View File

@@ -0,0 +1,4 @@
src/system.h
tests/du/2g
old/fileutils/ChangeLog-1997
ChangeLog-2005

1
.x-sc_prohibit_strcmp Normal file
View File

@@ -0,0 +1 @@
ChangeLog

View File

@@ -0,0 +1,6 @@
^GNUMakefile$
Makefile\.am$
\.mk$
^tests/pr/
ChangeLog.*
^man/help2man$

9
.x-sc_require_config_h Normal file
View File

@@ -0,0 +1,9 @@
^lib/buffer-lcm\.c$
^src/false\.c$
^src/lbracket\.c$
^src/ls-dir\.c$
^src/ls-ls\.c$
^src/ls-vdir\.c$
^src/tac-pipe\.c$
^src/uname-arch\.c$
^src/uname-uname\.c$

View File

@@ -0,0 +1,9 @@
^lib/buffer-lcm\.c$
^src/false\.c$
^src/lbracket\.c$
^src/ls-dir\.c$
^src/ls-ls\.c$
^src/ls-vdir\.c$
^src/tac-pipe\.c$
^src/uname-arch\.c$
^src/uname-uname\.c$

View File

@@ -8,3 +8,4 @@ m4/lib-ld.m4
m4/lib-prefix.m4
m4/po.m4
aclocal.m4
src/c99-to-c89.diff

3
.x-sc_system_h_headers Normal file
View File

@@ -0,0 +1,3 @@
^src/libstdbuf\.c$
^src/system\.h$
^src/copy\.h$

View File

@@ -1,5 +1 @@
^tests/pr/
Makefile\.in$
^config-log/
^build-aux/texinfo\.tex$
\.gdb-history$

View File

@@ -0,0 +1,2 @@
^lib/xstrtol\.h$
^build-aux/cvsu$

View File

@@ -1,14 +1,13 @@
^build-aux/config.guess
^configure
^lib/alloca.c
^lib/fileblocks.c
^lib/fts.c
^lib/getdate.c
^lib/getloadavg.c
^lib/gettext.h
^lib/getusershell.c
^lib/mbswidth.c
^lib/readutmp.h
^lib/strtod.c
^lib/xstrtol.c
^m4/
^tests/misc/pwd-unreadable-parent

716
ABOUT-NLS
View File

@@ -1,716 +0,0 @@
Notes on the Free Translation Project
*************************************
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all
together, so that will gradually become able to speak many languages.
A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
Quick configuration advice
==========================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
INSTALL Matters
===============
Some packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is _not_ required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will respectively bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
Translating Teams
=================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of December
2003. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files am az be bg ca cs da de el en en_GB eo es
+-------------------------------------------+
a2ps | [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | |
ap-utils | |
bash | [] [] [] [] |
batchelor | |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] |
bluez-pin | [] [] |
clisp | |
clisp | [] [] [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
darkstat | [] () [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] [] |
fetchmail | [] () [] [] [] [] |
fileutils | [] [] [] |
findutils | [] [] [] [] [] [] [] |
flex | [] [] [] [] |
fslint | |
gas | [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] [] |
gettext | [] [] [] [] [] |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] [] [] [] |
gliv | |
glunarclock | [] [] |
gnubiff | [] |
gnucash | [] () [] [] |
gnucash-glossary | [] () [] |
gnupg | [] () [] [] [] [] |
gpe-aerial | [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | [] [] |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () () |
gramadoir | [] |
grep | [] [] [] [] [] [] |
gretl | [] |
gtick | () |
hello | [] [] [] [] [] [] |
id-utils | [] [] |
indent | [] [] [] [] |
jpilot | [] [] [] |
jtag | |
jwhois | [] |
kbd | [] [] [] [] [] |
latrine | () |
ld | [] [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] [] |
libiconv | [] [] [] [] [] |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lingoteach_lessons | () () |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] |
man-db | [] () [] [] () |
minicom | [] [] [] |
mysecretdiary | [] [] [] |
nano | [] () [] [] [] |
nano_1_0 | [] () [] [] [] |
opcodes | [] |
parted | [] [] [] [] [] |
ptx | [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] |
sed | [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | |
sharutils | [] [] [] [] [] [] |
silky | () |
skencil | [] () [] |
sketch | [] () [] |
soundtracker | [] [] [] |
sp | [] |
tar | [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] |
tin | () () |
tuxpaint | [] [] [] [] [] [] [] |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] |
xchat | [] [] [] [] |
xfree86_xkb_xml | [] |
xpad | [] |
+-------------------------------------------+
am az be bg ca cs da de el en en_GB eo es
0 0 8 3 37 38 56 73 15 1 5 12 64
et fa fi fr ga gl he hr hu id is it ja
+----------------------------------------+
a2ps | [] [] [] () |
aegis | |
ant-phone | |
anubis | [] |
ap-utils | [] |
bash | [] [] |
batchelor | [] |
bfd | [] |
binutils | [] [] |
bison | [] [] [] [] |
bluez-pin | [] [] [] [] [] |
clisp | |
clisp | [] |
coreutils | [] [] [] [] [] [] |
cpio | [] [] [] |
darkstat | () [] [] [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] [] [] |
flex | [] [] |
fslint | |
gas | [] |
gawk | [] [] [] |
gbiff | |
gcal | [] |
gcc | [] |
gettext | [] [] |
gettext-examples | [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gliv | () |
glunarclock | [] [] [] [] |
gnubiff | |
gnucash | () [] |
gnucash-glossary | [] |
gnupg | [] [] [] [] [] [] [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] [] [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | [] [] |
gpe-edit | [] [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] |
gprof | [] [] |
gpsdrive | () [] () () |
gramadoir | [] |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] |
gtick | [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
indent | [] [] [] [] [] [] [] [] [] |
jpilot | [] () |
jtag | |
jwhois | [] [] [] [] |
kbd | [] |
latrine | |
ld | [] |
libc | [] [] [] [] [] |
libgpewidget | [] [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] |
lingoteach_lessons | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] [] [] [] |
man-db | () () |
minicom | [] [] [] [] |
mysecretdiary | [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] [] [] [] |
rpm | |
screem | |
scrollkeeper | [] |
sed | [] [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] [] |
shared-mime-info | [] |
sharutils | [] [] [] [] [] |
silky | [] () |
skencil | [] |
sketch | [] |
soundtracker | [] [] [] [] |
sp | [] () |
tar | [] [] [] [] [] [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tuxpaint | [] [] [] [] [] [] [] [] |
util-linux | [] [] [] [] () [] |
vorbis-tools | [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] |
xchat | [] [] [] |
xfree86_xkb_xml | |
xpad | [] |
+----------------------------------------+
et fa fi fr ga gl he hr hu id is it ja
21 1 25 86 24 24 8 10 38 31 1 23 32
ko lg lt lv ms nb nl nn no pl pt pt_BR ro
+-------------------------------------------+
a2ps | () [] [] () () [] [] |
aegis | () () |
ant-phone | [] [] |
anubis | [] [] [] [] [] |
ap-utils | [] () [] |
bash | [] [] |
batchelor | [] |
bfd | [] |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] [] [] |
clisp | |
clisp | [] |
coreutils | [] |
cpio | [] [] [] [] [] |
darkstat | [] [] [] [] |
diffutils | [] [] [] [] |
e2fsprogs | [] |
enscript | [] [] [] |
error | [] [] [] |
fetchmail | [] [] () |
fileutils | [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] |
fslint | [] [] |
gas | |
gawk | [] [] [] |
gbiff | [] [] |
gcal | |
gcc | |
gettext | [] [] [] |
gettext-examples | [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] |
gliv | [] [] [] |
glunarclock | [] [] [] |
gnubiff | |
gnucash | [] [] () |
gnucash-glossary | [] [] |
gnupg | [] |
gpe-aerial | [] [] [] |
gpe-beam | [] [] [] |
gpe-calendar | [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] |
gprof | [] [] |
gpsdrive | () () () [] |
gramadoir | [] |
grep | [] [] [] [] |
gretl | |
gtick | [] [] |
hello | [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] |
jpilot | () () |
jtag | |
jwhois | [] [] [] [] |
kbd | [] [] [] |
latrine | [] |
ld | |
libc | [] [] [] [] [] |
libgpewidget | [] [] [] |
libiconv | [] [] [] [] |
lifelines | |
lilypond | |
lingoteach | |
lingoteach_lessons | |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] |
man-db | [] |
minicom | [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] |
sed | [] [] [] |
sh-utils | [] |
shared-mime-info | [] |
sharutils | [] |
silky | |
skencil | [] [] |
sketch | [] [] |
soundtracker | |
sp | |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] |
tin | |
tuxpaint | [] [] [] [] [] [] [] [] [] |
util-linux | [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] |
wget | [] [] |
xchat | [] [] |
xfree86_xkb_xml | [] |
xpad | [] [] |
+-------------------------------------------+
ko lg lt lv ms nb nl nn no pl pt pt_BR ro
12 0 1 2 12 10 60 4 4 38 25 35 76
ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
+-------------------------------------------+
a2ps | [] [] [] [] [] | 16
aegis | () | 0
ant-phone | | 2
anubis | [] [] [] | 9
ap-utils | () | 3
bash | [] | 9
batchelor | | 2
bfd | [] [] | 6
binutils | [] [] [] | 7
bison | [] [] [] | 14
bluez-pin | [] [] [] | 13
clisp | | 0
clisp | | 5
coreutils | [] [] [] [] [] | 16
cpio | [] [] [] | 14
darkstat | [] [] [] () () | 12
diffutils | [] [] [] [] | 22
e2fsprogs | [] [] | 5
enscript | [] [] [] | 12
error | [] [] [] | 15
fetchmail | [] [] [] | 11
fileutils | [] [] [] [] [] [] | 17
findutils | [] [] [] [] [] [] [] | 29
flex | [] [] [] | 13
fslint | | 2
gas | [] | 3
gawk | [] [] | 12
gbiff | | 3
gcal | [] [] | 4
gcc | [] | 4
gettext | [] [] [] [] [] [] | 16
gettext-examples | [] [] [] [] | 11
gettext-runtime | [] [] [] [] [] [] [] [] [] | 21
gettext-tools | [] [] [] [] [] [] | 14
gimp-print | [] [] | 10
gliv | | 3
glunarclock | [] [] [] [] | 13
gnubiff | | 1
gnucash | [] [] [] | 9
gnucash-glossary | [] [] [] | 8
gnupg | [] [] [] [] | 17
gpe-aerial | [] [] | 7
gpe-beam | [] [] | 8
gpe-calendar | [] [] [] [] [] | 13
gpe-clock | [] [] [] [] | 10
gpe-conf | [] [] [] | 9
gpe-contacts | [] [] [] [] | 11
gpe-edit | [] [] [] [] [] [] | 12
gpe-go | [] | 5
gpe-login | [] [] [] [] [] [] | 13
gpe-ownerinfo | [] [] [] [] [] | 13
gpe-sketchbook | [] [] [] | 9
gpe-su | [] [] [] [] | 10
gpe-taskmanager | [] [] [] [] | 10
gpe-timesheet | [] [] [] [] [] | 12
gpe-today | [] [] [] [] [] [] | 13
gpe-todo | [] [] [] [] [] | 12
gphoto2 | [] [] [] | 11
gprof | [] [] | 9
gpsdrive | [] [] | 4
gramadoir | | 3
grep | [] [] [] [] [] | 26
gretl | | 2
gtick | [] | 5
hello | [] [] [] [] [] | 33
id-utils | [] [] [] | 12
indent | [] [] [] [] [] | 21
jpilot | [] [] [] [] [] | 9
jtag | [] | 1
jwhois | () () [] [] | 11
kbd | [] [] | 11
latrine | | 1
ld | [] [] | 5
libc | [] [] [] [] | 20
libgpewidget | [] [] [] [] | 13
libiconv | [] [] [] [] [] [] [] [] [] | 27
lifelines | [] | 2
lilypond | [] | 3
lingoteach | | 2
lingoteach_lessons | () | 0
lynx | [] [] [] [] | 14
m4 | [] [] [] | 15
mailutils | [] | 5
make | [] [] [] [] | 16
man-db | [] | 5
minicom | [] | 11
mysecretdiary | [] [] | 10
nano | [] [] [] [] [] | 17
nano_1_0 | [] [] [] [] | 17
opcodes | [] [] | 6
parted | [] [] [] | 15
ptx | [] [] [] | 22
python | | 0
radius | [] | 4
recode | [] [] [] [] | 20
rpm | [] [] [] | 7
screem | [] [] | 2
scrollkeeper | [] [] [] [] | 15
sed | [] [] [] [] [] [] | 23
sh-utils | [] [] [] | 14
shared-mime-info | [] [] | 4
sharutils | [] [] [] [] [] | 17
silky | () | 2
skencil | [] | 6
sketch | [] | 6
soundtracker | [] [] | 9
sp | [] | 3
tar | [] [] [] [] [] | 24
texinfo | [] [] [] [] | 14
textutils | [] [] [] [] [] | 16
tin | | 1
tuxpaint | [] [] [] [] [] | 29
util-linux | [] [] [] | 15
vorbis-tools | [] | 8
wastesedge | | 0
wdiff | [] [] [] [] | 18
wget | [] [] [] [] [] [] [] [] | 23
xchat | [] [] [] [] [] | 14
xfree86_xkb_xml | [] [] [] [] [] [] | 8
xpad | | 4
+-------------------------------------------+
51 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
120 domains 59 42 16 25 81 0 56 12 1 10 21 22 1260
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If December 2003 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites. The most
up-to-date matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
Using `gettext' in new packages
===============================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.

55
AUTHORS
View File

@@ -1,34 +1,37 @@
Here are the names of the programs in this package,
each followed by the name(s) of its author(s).
basename: FIXME unknown
cat: Torbjorn Granlund, Richard M. Stallman
arch: David MacKenzie, Karel Zak
base64: Simon Josefsson
basename: David MacKenzie
cat: Torbjörn Granlund, Richard M. Stallman
chcon: Russell Coker, Jim Meyering
chgrp: David MacKenzie, Jim Meyering
chmod: David MacKenzie, Jim Meyering
chown: David MacKenzie, Jim Meyering
chroot: Roland McGrath
cksum: Q. Frank Xia
comm: Richard Stallman, David MacKenzie
cp: Torbjorn Granlund, David MacKenzie, Jim Meyering
comm: Richard M. Stallman, David MacKenzie
cp: Torbjörn Granlund, David MacKenzie, Jim Meyering
csplit: Stuart Kemp, David MacKenzie
cut: David Ihnat, David MacKenzie, Jim Meyering
cut: David M. Ihnat, David MacKenzie, Jim Meyering
date: David MacKenzie
dd: Paul Rubin, David MacKenzie, Stuart Kemp
df: Torbjorn Granlund, David MacKenzie, Paul Eggert
dir: Richard Stallman, David MacKenzie
df: Torbjörn Granlund, David MacKenzie, Paul Eggert
dir: Richard M. Stallman, David MacKenzie
dircolors: H. Peter Anvin
dirname: David MacKenzie, Jim Meyering
du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
echo: FIXME unknown
du: Torbjörn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
echo: Brian Fox, Chet Ramey
env: Richard Mlynarik, David MacKenzie
expand: David MacKenzie
expr: Mike Parker
expr: Mike Parker, James Youngman, Paul Eggert
factor: Paul Rubin
false: Jim Meyering
fmt: Ross Paterson
fold: David MacKenzie
ginstall: David MacKenzie
groups: David MacKenzie
groups: David MacKenzie, James Youngman
head: David MacKenzie, Jim Meyering
hostid: Jim Meyering
hostname: Jim Meyering
@@ -38,11 +41,12 @@ kill: Paul Eggert
link: Michael Stone
ln: Mike Parker, David MacKenzie
logname: FIXME: unknown
ls: Richard Stallman, David MacKenzie
md5sum: Ulrich Drepper, Scott Miller
ls: Richard M. Stallman, David MacKenzie
md5sum: Ulrich Drepper, Scott Miller, David Madore
mkdir: David MacKenzie
mkfifo: David MacKenzie
mknod: David MacKenzie
mktemp: Jim Meyering
mv: Mike Parker, David MacKenzie, Jim Meyering
nice: David MacKenzie
nl: Scott Bartram, David MacKenzie
@@ -54,18 +58,25 @@ pinky: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
pr: Pete TerMaat, Roland Huebner
printenv: David MacKenzie, Richard Mlynarik
printf: David MacKenzie
ptx: F. Pinard
ptx: François Pinard
pwd: Jim Meyering
readlink: Dmitry V. Levin
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
rmdir: David MacKenzie
runcon: Russell Coker
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller
sha1sum: Ulrich Drepper, Scott Miller, David Madore
sha224sum: Ulrich Drepper, Scott Miller, David Madore
sha256sum: Ulrich Drepper, Scott Miller, David Madore
sha384sum: Ulrich Drepper, Scott Miller, David Madore
sha512sum: Ulrich Drepper, Scott Miller, David Madore
shred: Colin Plumb
shuf: Paul Eggert
sleep: Jim Meyering, Paul Eggert
sort: Mike Haertel, Paul Eggert
split: Torbjorn Granlund, Richard M. Stallman
split: Torbjörn Granlund, Richard M. Stallman
stat: Michael Meskes
stdbuf: Pádraig Brady
stty: David MacKenzie
su: David MacKenzie
sum: Kayvan Aghaiepour, David MacKenzie
@@ -74,19 +85,25 @@ tac: Jay Lepreau, David MacKenzie
tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering
tee: Mike Parker, Richard M. Stallman, David MacKenzie
test: Kevin Braunsdorf, Matthew Bradburn
timeout: Pádraig Brady
touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith
tr: Jim Meyering
true: Jim Meyering
truncate: Pádraig Brady
tsort: Mark Kettenis
tty: David MacKenzie
uname: David MacKenzie
unexpand: David MacKenzie
uniq: Richard Stallman, David MacKenzie
uniq: Richard M. Stallman, David MacKenzie
unlink: Michael Stone
uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
users: Joseph Arceneaux, David MacKenzie
vdir: Richard Stallman, David MacKenzie
vdir: Richard M. Stallman, David MacKenzie
wc: Paul Rubin, David MacKenzie
who: Joseph Arceneaux, David MacKenzie, Michael Stone
whoami: Richard Mlynarik
yes: David MacKenzie
;; Local Variables:
;; coding: utf-8
;; End:

848
COPYING
View File

@@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
TERMS AND CONDITIONS
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
0. Definitions.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"This License" refers to version 3 of the GNU General Public License.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
A "covered work" means either the unmodified Program or a work based
on the Program.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Source Code.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
The Corresponding Source for a work in source code form is that
same work.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Revised Versions of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
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 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -304,37 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,3 +1,730 @@
2005-12-27 Jim Meyering <jim@meyering.net>
* Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
(sc_prohibit_assert_without_use): New rule.
(syntax-check-rules): Add it to the list.
* .x-sc_prohibit_assert_without_use: New empty file.
* Makefile.am (EXTRA_DIST): Add it.
* Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
* cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
Don't include <assert.h>; it wasn't used.
2005-12-26 Paul Eggert <eggert@cs.ucla.edu>
* src/chown-core.c (restricted_chown):
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
* src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
| O_NOFOLLOW too, for consistency with other dir-openers.
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
(is_empty_dir): Likewise.
* src/shred.c (wipename): Likewise. Don't bother trying to open
dir for writing, since POSIX prohibits it.
2005-12-22 Jim Meyering <jim@meyering.net>
* tests/help-version: Redirect stderr to /dev/full, to suppress
write error diagnostic.
2005-12-19 Jim Meyering <jim@meyering.net>
* src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
Avoid a minor race condition when `-m MODE' is specified, by using
open, fchown, and close rather than just chown. To do that reliably --
even with an overly restrictive umask -- ensure that each mkdir,
mknod and mkfifo call uses a mode including at least owner-read access.
* src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
the subsequent chown (or equivalent open,fchown,close) fails.
* tests/misc/mknod: New tests.
* tests/misc/Makefile.am (TESTS): Add mknod.
2005-12-17 Jim Meyering <jim@meyering.net>
* src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
e.g., on a named pipe.
(OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in
place of all uses, since it is guaranteed (system.h) to be defined.
2005-12-05 Andreas Gruenbacher <agruen@suse.de>
Add POSIX ACL support
* src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
is no requirement for ACL support; particularly, it does not exist
on systems that have POSIX ACLs.
* src/copy.h (cp_option_init) [umask_kill]: Remove member.
* src/cp.c (umask_kill): With default acls, the umask is not to be
applied. Remove umask_kill, don't change the process umask, and let
the kernel apply the umask where appropriate.
* src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
* src/copy.c (get_dest_mode): Remove; it is obsolete after removing
umask_kill.
(copy_reg, copy_internal): Use copy_acl and set_acl
instead of fchown/chown. Fix the logic for POSIX ACLs.
(chown_succeded): Remove; we now always copy acls and
preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
did a chown before or not.
* src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
to link with it via $(LIB_ACL), for the utilities that need it.
2005-12-16 Paul Eggert <eggert@cs.ucla.edu>
* src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
(OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
(fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
value is now signified by whether cwd_errno is null.
(fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
pointer-to-bool to pointer-to-errno-value. All callers changed.
(rm_1): Don't bother setting a local cwd failure flag and then
ORing it into the caller's. Just set the caller's.
(rm): Use cwd failure errno value to print a slightly-better
diagnostic.
2005-12-15 Jim Meyering <jim@meyering.net>
* src/stat.c (print_it): Properly handle a backslash at the
end of a --printf format string. Reported by Paul Eggert.
* tests/misc/stat-printf (end-bs): Add a test for the above.
2005-12-15 Paul Eggert <eggert@cs.ucla.edu>
* tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
Don't assume /etc/passwd contains user names; use 'id' instead.
2005-12-15 Jim Meyering <jim@meyering.net>
stat: revert behavior of --format=FMT (-c)
stat: add new option: --printf=FMT
* NEWS: Mention this.
* src/stat.c (isodigit, octtobin, hextobin): Define.
(PRINTF_OPTION): Define.
(interpret_backslash_escapes, trailing_delim): New globals.
(usage): Document them. Alphabetize on long option names.
(print_esc_char): New function.
(print_it): Rewrite, in order to handle backslash escapes.
(main): Handle new option. Set globals for --format, too.
* tests/misc/stat-printf: Test --printf and --format.
* tests/misc/Makefile.am (TESTS): Add stat-printf.
2005-12-14 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: sort now reports incompatible options.
* src/sort.c (incompatible_options, check_ordering_compatibility):
New functions.
(main): Use them. Don't bother with a usage message for
"sort -c a b", for consistency with other error diagnostics.
* tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
New tests.
* src/cat.c (main): Undo previous change. close_stdout already
does the check, so the previous change wasn't necessary.
2005-12-13 Paul Eggert <eggert@cs.ucla.edu>
* src/cat.c (main): Check for close (STDOUT_FILENO) failure.
2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
Install a more-conservative approach for sort -R. It's the
same basic idea as the existing code, except it uses the full ISAAC
approach (called the "more kosher" approach in the existing comments).
This makes "sort -R" quite a bit slower (about a factor of 2 on my
little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
better to be conservative here at first, and review any performance
improvements carefully.
* .x-sc_require_config_h: Add src/rand-isaac.c.
* src/rand-isaac.h: Remove. All uses now simply include rand-isaac.c.
* src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
(shred_SOURCES, sort_SOURCES): Remove.
(EXTRA_DIST): Add rand-isaac.c.
* src/rand-isaac.c: Revert to what used to be in shred.c, without
changing it to allow for varying numbers of words in the state.
Alter so that we include rand-isaac.c directly rather than
compiling it and linking to it. Don't include config.h or
system.h; that's the includer's responsibility.
Omit functions that are specific to shred.
(ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
(isaac_step, struct irand_state):
Resurrect these, with the same defns that used to be in shred.c.
(ISAAC_SIZE, isaac_new, isaac_copy): Remove.
(isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
static again.
(struct isaac_state, isaac_refill, isaac_mix, isaac_init):
(isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
(irand_init, irand32, irand_mod):
Number of words is constant again.
(struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
* src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
* src/sort.c: Likewise.
* src/shred.c (fillrand, dopass, main): Undo previous change.
(struct irand_state, irand_init, irand32, irand_mod): Moved back here,
from rand-isaac.c.
* src/sort.c: Don't include md5.h; it wasn't needed.
(struct keyfield): Rename random_hash to random, for consistency
with the other member names. All uses changed.
(usage): Tweak wording to mention STRING for --seed option.
(short_options): Rorder for consistency with other programs.
(rand_state): Now a struct, not a pointer to one. All uses changed.
(HASH_WORDS, HASH_SIZE): Remove.
(get_hash): Remove comments around resbuf size, since we can assume C89.
Use a "more-kosher" (but slower) approach of invoking isaac_refill.
(keycompare): Adjust to the new get_hash.
Add a FIXME.
(badfieldspec): Omit recently-introduced comment; it isn't needed.
(main): Don't set need_random simply because gkey has it set; that
doesn't necessarily mean we'll need random numbers.
Redo seeding to match new get_hash approach.
2005-12-10 Jim Meyering <jim@meyering.net>
* src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
Avoid shred segfault on 64-bit systems.
* src/rand-isaac.c (isaac_refill): Don't try to negate a
local of type uint32_t. Make the local an `int' instead.
* NEWS: Mention sort's new options.
* src/rand-isaac.c (isaac_mix): Declare to be static.
Mark all other functions as `extern' so the tight-scope
part of `make distcheck' passes once again.
* src/rand-isaac.h (isaac_mix): Remove declaration.
* src/sort.c (get_hash): Change position of `*' in parameter
type to conform with convention.
(main): Split a long line so it fits in 80 columns.
(keycompare): Remove stray SPACE before TAB that was
causing `make distcheck' to fail.
* src/shred.c: Don't include gethrxtime.h. No longer needed.
* tests/misc/sort-rand: New file: basic tests for the new options.
* tests/misc/Makefile.am (TESTS): Add sort-rand.
2005-12-10 Frederik Eaton <frederik@ofb.net>
* src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
(shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
* src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
Make state size runtime-configurable.
(isaac_new, isaac_copy): New functions.
* src/rand-isaac.h: New file.
* src/shred.c: Include rand-isaac.h. Move ISAAC code to rand-isaac.c.
(fillrand, main): Adjust to the fact that the state size is now
runtime-configurable.
* src/sort.c (short_options, long_options, WORDS, keycompare, main):
(usage): Add options --random-sort and --seed to implement a random
shuffle.
Include md5.h and rand-isaac.h.
(get_hash): New function.
(rand_state): New var.
(HASH_WORDS, HASH_SIZE): New macros.
2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
* tests/dd/misc: Add test for dd iflags=noatime.
2005-12-09 Jim Meyering <jim@meyering.net>
* src/sort.c (usage): Mention white space vs -b and -t options.
From The Wanderer.
2005-12-09 Eric Blake <ebb9@byu.net>
* src/test.c (main): Fix misleading comment.
2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Mention dd's new noatime flag.
* src/system.h (O_NOATIME): Define to 0 if not already defined.
* src/dd.c (flags, usage): Add support for noatime flag.
2005-12-07 Jim Meyering <jim@meyering.net>
Distribute the cvsu script, used only by `make syntax-check'.
* Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
* Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
distribute a copy of this script.
* .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
* tests/mv/acl: exit-77 before the trap, not after, if we fail
to create a temporary directory on another partition.
From Andreas Gruenbacher.
2005-12-06 Tomas Pospisek <tpo@sourcepole.ch> (tiny change)
* man/basename.x: Cross-reference to dirname and readlink.
* man/dirname.x: Cross-reference to basename and readlink.
2005-12-05 Andreas Gruenbacher
* src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
(set_owner, preserve_author): New functions, factored out of copy_reg.
(copy_reg): Use them.
(copy_internal): Use them here, too.
2005-12-04 Jim Meyering <jim@meyering.net>
* src/sleep.c (usage): Say what happens with two or more arguments.
Suggested by Justin Pryzby.
* src/uptime.c (print_uptime): Move decl of `upsecs' into scope
where it's used.
2005-12-03 Jim Meyering <jim@meyering.net>
* src/rm.c (long_opts): Change the name of each undocumented, for-
testing-only option to start with `-', so that it cannot render
ambiguous any prefix it happens to share with some other option name.
Problem reported by Eric Blake.
* src/head.c (long_options): Likewise.
* src/tail.c (long_options): Likewise.
* tests/misc/head-elide-tail: Update uses of undocumented, for-
testing-only --presume* options to start with `---'.
* tests/rm/dangling-symlink: Likewise.
* tests/rm/dir-no-w: Likewise.
* tests/rm/isatty: Likewise.
2005-11-30 Jim Meyering <jim@meyering.net>
* Makefile.maint: Add a comment about cvsu.
2005-11-25 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: df updates for "none", "proc", inaccessible file systems.
* src/df.c (show_point): Ignore inaccessible file systems.
(usage): -a includes dummy file systems, not size-0 file systems.
* src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
to avoid collision with POSIX name space. All uses changed.
2005-11-24 Jim Meyering <jim@meyering.net>
* tests/Makefile.am (EXTRA_DIST): Add acl to the list.
* tests/acl: Add `$0: ' prefix to diagnostics.
* .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
2005-11-23 Paul Eggert <eggert@cs.ucla.edu>
* src/copy.c: Improve performance a bit by optimizing away
unnecessary system calls and going to a block size of at least
8192 (on normal hosts, anyway). This improved performance 5% on my
Debian stable host (2.4.27 kernel, x86, copying from root
ext3 file system to itself).
Include "buffer-lcm.h".
(copy_reg): Omit last argument. All callers changed.
Use xmalloc to allocate rather than trusting alloca
(which is unwise with large block sizes).
Declare locals more locally, if possible.
Use uintptr_t words instead of int words, for a bit more speed
when looking for null blocks on 64-bit hosts.
Optimize away reads of zero bytes on regular files.
In the typical case, insist on 8 KiB buffers, at least.
Avoid unnecessary extra call to fstat when checking for sparse files.
Avoid now-unnecessary cast to off_t, and "0L".
Avoid unnecessary test of *new_dst when checking for same owner
and group.
2005-11-22 Paul Eggert <eggert@cs.ucla.edu>
* src/remove.c (rm): Don't assume C99 for-loop syntax.
2005-11-22 Jim Meyering <jim@meyering.net>
* src/remove.c (AD_push): Remove debugging cruft.
* tests/rm/unread2 (rm): Change expected diagnostic,
`cannot open directory' to `cannot remove', to align with
new version of rm.
* tests/rm/rm2: Ensure that rm now continues removing entries
even after certain types of failure.
* src/remove.c: Rewrite. Now, this module is reentrant on systems
that provide openat (Solaris), and on systems like Linux+procfs
where our openat emulation code is reentrant. This also fixes a
few low-probability leaks and eliminates some code that could,
in very unusual circumstances, cause rm() (via a callee) to exit.
* NEWS: Mention this.
* configure.ac: Put copyright dates all on one line so the
emacs function that updates them works properly.
2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
* configure.ac (AM_PROG_CC_C_O): Add. Needed for CVS Automake.
Problem reported by Eric Blake.
(AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
we get a standard-conforming compiler. This relies on the new
m4/c.m4 file. Note that it's a bit tricky, since c.m4 doesn't
define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
m4/c.m4 can go away with Autoconf 2.60 comes out.
2005-11-17 Jim Meyering <jim@meyering.net>
* src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
(AD_mark_current_as_unremovable): Likewise, but for a local.
(rm_1): Likewise.
* tests/mv/acl: Let traps handle removing temporary directories.
Expect acl-related tests to fail, until the corresponding
patches are committed.
* tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
* tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
ACL tests, from Andreas Gruenbacher.
* tests/acl, tests/mv/acl, tests/cp/acl: New files.
* tests/mv/Makefile.am (TESTS): Add acl.
* tests/cp/Makefile.am (TESTS): Add acl.
* src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
2005-11-16 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Improve quality of ln's diagnostics.
* src/ln.c (do_link, usage): Likewise.
(do_link): Don't use alloca on a buffer of unbounded size.
2005-11-16 Jim Meyering <jim@meyering.net>
* tests/cp/fail-perm: Accommodate HPUX. It appears to fail
with EACCES rather than EPERM. Reported by Peter O'Gorman here:
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
This also affects AIX 4.3.3, according to Ralf Wildenhues, in
http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
2005-11-14 Jim Meyering <jim@meyering.net>
* NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
2005-11-13 Jim Meyering <jim@meyering.net>
* announce-gen: Accept new option, --gpg-key-id=ID and
emit a blurb telling how to use the .sig files.
* Makefile.cfg (gpg_key_ID): Define.
* Makefile.maint (announcement): Use new option and key.
Require that most .c files include <config.h>.
* Makefile.maint (sc_require_config_h): New rule.
(syntax-check-rules): Add it.
* .x-sc_require_config_h: New file listing exceptions to the
above rule. Some are legit, others are simply grandfathered in.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
2005-11-12 Jim Meyering <jim@meyering.net>
* src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
2005-11-11 Jim Meyering <jim@meyering.net>
* NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
Mention new readlink options in 5.3.0's `New features' section.
Spotted by Thomas Hood.
2005-11-08 Jim Meyering <jim@meyering.net>
* NEWS: Merge in changes from b5_9x branch.
2005-11-08 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: ls now defaults to --time-style='locale', which in turn acts
like --time-style='posix-long-iso' if the locale settings are messed up.
* src/ls.c (decode_switches): Implement this.
2005-11-08 Jim Meyering <jim@meyering.net>
* tests/du/2g: s/expensive/very expensive/ in a comment.
From Paul Townsend.
2005-10-17 Eric Blake <ebb9@byu.net>
* src/ls.c (usage): Fix descriptions of --sort, --time.
Reported by Vitaly A. Ostanin.
2005-11-04 Paul Eggert <eggert@cs.ucla.edu>
* src/ln.c: Include filenamecat.c.
(FILE_BASENAME_CONCAT): Remove.
(do_link): Remove last arg DEST_IS_DIR. All callers changed.
(main): Use file_name_concat, base_name, and strip_trailing_slashes
instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids
the use of alloca.
2005-11-04 Jim Meyering <jim@meyering.net>
* src/du.c (process_file): Don't overflow for files of size >= 2^31
on systems with stat.st_blocks of a signed 32-bit type.
This bug causes trouble on some AIX 5.1 systems.
Report and trivial patch from Paul Townsend:
<http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
* NEWS: Mention this.
* tests/du/2g: New (very-expensive) test for the above-fixed bug.
* tests/du/Makefile.am (TESTS): Add it here.
* tests/very-expensive: New file.
* tests/Makefile.am (EXTRA_DIST): Add it here.
* tests/cp/perm: Mark this test as `very-expensive', too.
2005-11-02 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Mention that rm -d and maybe ln -d are scheduled for
removal in 2006.
* src/remove.h (struct rm_options): Remove unlink_dirs. All uses
removed.
* src/rm.c (usage): Don't mention rm -d.
2005-11-02 Jim Meyering <jim@meyering.net>
* tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
From Andreas Schwab.
* tests/dd/unblock-sync: Redirect stderr to /dev/null so the
`M+N records in/out' lines don't pollute `make check' output.
* tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
fixed on 2005-10-31. This test uses the new, IN_PIPE specifier.
* tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
to indicate that the input file should be piped into the command
under test (via `cat FILE | $prog ...').
* src/remove.c (remove_entry): Emit a better diagnostic when rm
(without -r) fails to remove a directory on a non-Linux system.
This change affects only newer Solaris systems (with priv_*
functions like priv_allocset). Reported by Keith Thompson.
* tests/rm/dir-nonrecur: New file/test for the above fix.
* tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
2005-11-01 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
POSIX 1002.1-2001 requires.
* src/tail.c (parse_obsolete_option): Implement this.
Problem reported by Vincent Lefevre.
* src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
* tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
(test_vector): Add special cases for _POSIX2_VERSION, and
regularize the old ones a bit.
* tests/touch/obsolescent: Add y2000 test.
2005-10-31 Paul Eggert <eggert@cs.ucla.edu>
* src/dd.c (skip): Fix off-by-one error reported by
Theodoros V. Kalamatianos.
2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
* tests/mkdir/p-3: Require that the test be run as non-root.
Problem and trivial fix reported by Theodoros V. Kalamatianos.
2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
* src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
boundary between DEST and SOURCE in the result.
2005-10-26 Dmitry V. Levin <ldv@altlinux.org>
* src/md5sum.c (main) [!O_BINARY]: Changed default read mode
back to text, to sync with documentation and for backwards
compatibility.
2005-10-25 Jim Meyering <jim@meyering.net>
* tests/dircolors/simple (other-wr): Add an explicit test for
the dircolors bug (NULL-dereference) fixed yesterday.
2005-10-24 Jim Meyering <jim@meyering.net>
* src/tac.c (tac_file): When determining whether a file is seekable,
also test whether it is a tty. Using only the lseek-based test would
give a false positive on Solaris. Reported by Peter Fales.
2005-10-24 Dmitry V. Levin <ldv@altlinux.org>
* tests/install/d-slashdot: New test, for "install -d" failure.
* tests/install/Makefile.am (TESTS): Add d-slashdot.
* tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
* tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
2005-10-24 Jim Meyering <jim@meyering.net>
* src/dircolors.c (ls_codes): Add missing comma.
Anonymous report and patch from
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
* src/dircolors.c: Add compile-time assertion that the slack_codes
and ls_codes arrays have the same number of elements. This would
have prevented the above-fixed bug.
* src/expand.c (parse_tab_stops): Add a comment to make this function
identical to the one in unexpand.c.
* src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
identical to the one in expand.c.
* src/expand.c (next_file): Don't assume fopen cannot return stdin.
2005-10-23 Jim Meyering <jim@meyering.net>
* src/md5sum.c (digest_check, main): Use ptr_align rather than
a dangerous pointer-value-to-`unsigned' cast.
* NEWS: mention the new sha* programs.
* AUTHORS: Add new sha* programs.
2005-08-28 David Madore <david.madore@ens.fr>
Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
* README: Add their names to the list.
* src/md5sum.c: Provide framework for computing sha-2 hashes.
* src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
Rules for compiling sha-2 utilities
(noinst_HEADERS): Remove checksum.h.
* man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
New files.
* man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
(sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
* tests/misc/sha224sum, tests/misc/sha256sum: New files.
* tests/misc/sha384sum, tests/misc/sha512sum: New files.
* tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
sha384sum, sha512sum test scripts here rather that each in its
own directory.
2005-08-28 David Madore <david.madore@ens.fr>
* tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
of the FIPS test vectors).
2005-10-23 Jim Meyering <jim@meyering.net>
* configure.ac: Use 6.0-cvs as the version string.
* NEWS: Adjust accordingly.
2005-10-22 Jim Meyering <jim@meyering.net>
* Version 5.92.
* configure.ac: Remove -cvs suffix from version string.
* NEWS: Add today's date.
* tests/mkdir/writable-under-readonly: New test, neither run
nor distributed via tarballs.
2005-10-20 Jim Meyering <jim@meyering.net>
* tests/chmod/octal: New file/test, to exercise today's
lib/modechange.c fix.
* tests/chmod/Makefile.am (TESTS): Add octal.
* NEWS: Mention this chmod fix as well as the dircolors one.
2005-10-18 Paul Eggert <eggert@cs.ucla.edu>
* src/dircolors.c (append_quoted): Quote ' correctly.
Problem reported by Eric Blake.
2005-10-19 Jim Meyering <jim@meyering.net>
* tests/dircolors/simple (quote): Add test for the above fix.
2005-10-18 Jim Meyering <jim@meyering.net>
* tests/chgrp/basic: Add a comment explaining (probably) why this
test fails on OpenBSD 3.2 when run in an NFS-mounted directory.
2005-10-17 Jim Meyering <jim@meyering.net>
* configure.ac: Use 5.92-cvs as the version string.
* NEWS: Adjust accordingly.
* Makefile.maint (my-distcheck): Depend on
$(release_archive_dir)/$(prev-tgz) here, so that if it's missing
we fail earlier.
2005-10-16 Jim Meyering <jim@meyering.net>
* Version 5.91.
* Makefile.maint (VERSION_REGEXP): New variable.
(news-date-check, changelog-check): Use tighter regular expressions.
* configure.ac: Remove -cvs suffix from version string.
* NEWS: Add today's date.
* NEWS: Mention the `mkdir -p' bug fix.
2005-10-15 Jim Meyering <jim@meyering.net>
* src/who.c (usage): Undocument deprecated --idle (-i) option.
* src/df.c (main): Warn about the deprecated --kilobytes option.
* src/ls.c (decode_switches): Likewise.
* src/du.c (usage): Document -m, once again.
(main): Warn about use of deprecated long options:
--kilobytes and --megabytes.
* src/tail.c (parse_options): Remove --allow-missing option.
You can use --retry instead.
* src/stat.c (main): Remove --link -l options.
You can use --dereference (-L) instead.
2005-09-30 Eric Blake <ebb9@byu.net> (tiny change)
* man/Makefile.am (.x.1): Remove temp directory first.
* NEWS: Document dircolors change of 2005-09-05.
2005-10-07 Paul Eggert <eggert@cs.ucla.edu>
* src/sort.c (sortlines_temp): Redo previous change, since I'm
no longer confident that the m4/stdbool.m4 patch suffices.
2005-10-06 Paul Eggert <eggert@cs.ucla.edu>
* src/sort.c (sortlines_temp): Undo previous change, since
today's change to m4/stdbool.m4 should catch it.
2005-10-06 Jim Meyering <jim@meyering.net>
* TODO: rm: add support for a -I option, like that from FreeBSD's.
2005-10-05 Jim Meyering <jim@meyering.net>
* src/sort.c (sortlines_temp): Declare temporary as `int' rather
than `bool' to work around AIX 5.3 compiler bug in 64-bit mode.
From James Lemley.
2005-10-03 Jim Meyering <jim@meyering.net>
* src/factor.c (MAX_N_FACTORS): Define in terms of sizeof (uintmax_t)
rather than hard-coding to 128. From Thomas M.Ott.
2005-10-02 Jim Meyering <jim@meyering.net>
* Makefile.maint (sc_unmarked_diagnostics):
Search only cvs-controlled files.
* .x-sc_unmarked_diagnostics: New file.
* Makefile.am (EXTRA_DIST): Add it.
2005-10-01 Jim Meyering <jim@meyering.net>
* src/factor.c (main): Don't stop processing arguments upon
the first invalid one. Suggestion from Eric Blake
* tests/factor/basic: Add a test for this.
2005-09-30 Jim Meyering <jim@meyering.net>
* configure.ac: Use 5.91-cvs as the version string.
* NEWS: Adjust accordingly.
2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
* src/dd.c (main): Don't assume size_t has the same width
as unsigned long. Problem reported by Eric Blake.
* NEWS: Clarify "tail - f" example.
2005-09-29 Jim Meyering <jim@meyering.net>
* Version 5.90.
@@ -10878,3 +11605,12 @@
textutils, and sh-utils.
* Makefile.am: Likewise.
* src/Makefile.am: Likewise.
-----
Copyright (C) 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice
and this notice are preserved.

4040
ChangeLog-2006 Normal file

File diff suppressed because it is too large Load Diff

4022
ChangeLog-2007 Normal file

File diff suppressed because it is too large Load Diff

379
ChangeLog-2008 Normal file
View File

@@ -0,0 +1,379 @@
2008-12-16 Jim Meyering <meyering@redhat.com>
NB: ChangeLog files are no longer manually maintained.
See HACKING for details.
2008-02-07 Jim Meyering <meyering@redhat.com>
We *do* need two different version files.
One for tarball-only, the other to be updated any time we
get a new value of $(VERSION).
* Makefile.am (dist-hook): Create .tarball-version in dist tarball.
* GNUmakefile (_curr-ver): Make git-version-gen use it.
* .gitignore: Ignore it.
Fix a typo in description of size suffixes: s/GB/G/.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Spotted by Bert Wesarg.
* NEWS [6.9.90]: Mention the added feature that head, od, split and
tail now accept the standard size suffixes (kB, M, MB, G, GB, and
so on for T, P, Y, Z, and Y) on arguments to selected options.
2008-02-06 Steven Schubiger <schubiger@gmail.com>
mkdir, split: write --verbose output to stdout, not stderr.
* src/mkdir.c (verbose_output): New function.
(announce_mkdir): Use it.
* src/split.c (usage): Update.
* src/split.c (cwrite): Write to stdout, not stderr.
* doc/coreutils.texi (split invocation): Remove the mention
of --verbose output being printed to stderr.
* tests/mkdir/p-v: Redirect stdout, not stderr.
* tests/misc/split-a: Likewise.
* NEWS: Mention this change.
* TODO: Remove this item.
2008-02-04 Jim Meyering <meyering@redhat.com>
* Makefile.maint (announcement): Remove stale comment.
2008-02-02 Jim Meyering <meyering@redhat.com>
Clarify a comment.
* tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL.
2008-01-31 Bob Proulx <bob@proulx.com>
Improve wording of date and time man page.
* man/date.x: Improve compact description of the --date=STRING.
* man/touch.x: Likewise.
Suggested by A. Costa.
2008-01-31 Jim Meyering <meyering@redhat.com>
Remove alignment constraint from the sha*_read_ctx functions.
* lib/sha256.c (set_uint32): New function.
(sha256_read_ctx, sha224_read_ctx): Use it.
* lib/sha512.c (set_uint64): New function.
(sha512_read_ctx, sha384_read_ctx): Use it.
* lib/sha256.h: Remove warning about alignment constraint.
* lib/sha512.h: Likewise.
Prompted by similar changes in gnulib's sha1 and md[45] modules.
Adapt to new version of vc-list-files.
* tests/check.mk (vc_exe_in_TESTS): Adapt to new constraint
that vc-list-files be run only from $(top_srcdir).
Pull vc-list-files from gnulib.
* bootstrap.conf (gnulib_modules): Add vc-list-files.
* build-aux/vc-list-files: Remove file.
Improve the cp/parent-perm test.
* tests/cp/parent-perm: Also check that perms of existing dest
dirs are changed to match those of corresponding src dir
2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
Don't modify argv in dd due to ',' in arguments.
* src/dd.c: Include quotearg.h.
(operand_matches): New function.
(parse_symbols, operand_is): Use it.
(parse_symbols): 1st arg is now const pointer. Don't modify it.
msgid arg is now just the message, not a format.
(scanargs): Add some 'const's to check for problems like the above.
2008-01-30 Jim Meyering <meyering@redhat.com>
* src/c99-to-c89.diff: Adjust remove.c offsets, again.
Now that system.h defines is_empty_dir, include "openat.h".
* src/system.h: Include "openat.h" here, ...
* src/chcon.c: ... not here.
* src/chmod.c: Likewise.
* src/chown-core.c: Likewise.
* src/remove.c: Likewise.
* src/c99-to-c89.diff: Adjust remove.c offsets.
Improve "rmdir --ignore-fail-on-non-empty"
* src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty,
suppress a diagnostic also for other errno values, which can arise
with read-only media or when the parent directory has the immutable
attribute (set via chattr +i).
(errno_may_be_empty, ignorable_failure): New functions.
* src/remove.c (is_empty_dir): Move function to ...
* src/system.h (is_empty_dir): ...here, and make it inline.
Suggested by Josselin Mouette in <http://bugs.debian.org/363011>
via Bob Proulx.
* NEWS: Mention the improvement.
2008-01-29 Paul Eggert <eggert@cs.ucla.edu>
Don't modify argv in dd.
* src/dd.c (operand_is): New function.
(scanargs): Use it so that we don't need to modify argv, as a nicety.
Problem reported by Adam Goode in
<http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00264.html>.
2008-01-29 Jim Meyering <meyering@redhat.com>
* Makefile.am (BUILT_SOURCES): Ensure that .version exists.
Reported by Bob Proulx.
2008-01-29 Bob Proulx <bob@proulx.com>
Improve the man pages of --date=STRING for 'date' and 'touch'.
* man/date.x: Add a compact description of the --date=STRING.
* man/touch.x: Likewise.
Reported by A. Costa in http://bugs.debian.org/363011
2008-01-29 Michael Stone <mstone@debian.org>
Improve the description of when dd outputs its final statistics.
* doc/coreutils.texi (dd invocation): Say that dd prints stats
upon normal termination and upon SIGINT.
2008-01-29 Jim Meyering <meyering@redhat.com>
Avoid "make distcheck" failure: newly-created man/*.1 files not removed
* Makefile.am (EXTRA_DIST): Add .version.
(.version): New rule.
(dist-hook): Don't create $(distdir)/.version here, now that it's
being distributed.
* man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
(../VERSION): Remove rule.
* GNUmakefile (dummy): Create .version, not VERSION.
Add an extra "...:= $(shell..." statement to ensure that
.version exists even when the preceding code is not run.
* .gitignore: Remove both .version and VERSION.
ls: don't segfault on files in /proc with an old libselinux
* src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15
whereby getfilecon returns 0 yet sets the context to NULL.
Reported by Jan Moringen via Michael Stone in
http://bugs.debian.org/463043
* tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault.
* tests/ls/proc-selinux-segfault: Test for the above fix.
* NEWS: Mention the fix.
2008-01-26 Jim Meyering <meyering@redhat.com>
Work around Darwin9's set-GID-like group ownership inheritance.
This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
* tests/cp/preserve-gid: Accept a group ID of 0, as well.
Reported by Elias Pipping.
Emit "info coreutils 'PROG invocation'" into the man page,
rather than just "info PROG". The latter would often fail
or simply display the man page.
* man/help2man: Change the template.
Prompted by http://bugs.debian.org/399684
chcon: correct description of --no-dereference (-h) option.
* src/chcon.c (usage): Remove invalid reference to lchown.
Reported by Göran Uddeborg.
Ensure that each version string change propagates to man pages.
* man/Makefile.am (common_dep): Don't depend on configure.ac for
version changes. Instead, depend on ../VERSION.
(../VERSION): New rule.
* Makefile.am (DISTCLEANFILES): Define.
* GNUmakefile: Update ./VERSION.
* .gitignore: List VERSION.
Reported by Sven Joachim.
Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1)
* tests/cp/preserve-gid: Set group as well as owner on ".".
Reported by Elias Pipping.
Improve a warning about non-portable "mv" usage.
* doc/coreutils.texi (mv invocation): Adjust the warning: moving a
dir-symlink-specified-with-a-trailing-slash works in a surprising
manner only on some systems. Reported by Tomas Pospisek in
http://bugs.debian.org/343652.
2008-01-26 Mike Frysinger <vapier@gentoo.org>
* src/dircolors.hin (TERM): Add jfbterm.
2008-01-23 Jim Meyering <meyering@redhat.com>
Clean up build-related rules.
* Makefile.cfg (gnulib_dir): Update comment.
* Makefile.maint (announcement) [cl_date, utc_date]: Don't set
now-unused variables.
* TODO: Update the note on getgrouplist.
2008-01-23 Zvi Har'El <rl@math.technion.ac.il>
Add a ";", so "make install" works with --enable-install-program=su.
* src/Makefile.am (install_su): Add a semicolon. (tiny change)
2008-01-23 Jim Meyering <meyering@redhat.com>
Avoid misinterpreting mgetgroups failure in running root-only tests.
* src/setuidgid.c (main): Don't misinterpret as size_t an error
return from mgetgroups. Reported by Theodoros V. Kalamatianos.
* README: Remove/convert a few stray mentions of CVS.
2008-01-22 Jim Meyering <meyering@redhat.com>
Require automake-1.10.1, for its support of dist-lzma.
* configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1.
Version 6.10.
* NEWS: Record release date.
* README-hacking: Update to reflect existence of automake-1.10.1.
2008-01-18 Jim Meyering <meyering@redhat.com>
Update README.
* README: Remove a note about failing tests on SunOS 4.
On Mac OS 10.5.1 (Darwin 9.1), you'll need --disable-acl.
(Running tests as root): Recommend using "check-root", not "check".
2008-01-17 Jim Meyering <meyering@redhat.com>
Do not define-away __attribute__ when __STRICT_ANSI__ is set.
* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
It has been unnecessary since approximately gcc-2.6, and now, leaving
it would cause gcc -Werror -ansi to fail to compile csplit.c.
* gl/lib/randread.c (__attribute__): Likewise.
2008-01-16 Jim Meyering <meyering@redhat.com>
* NEWS: Mention the configure.ac fix.
* TODO: Add an introduction.
Remove a few entries. Update a few others.
2008-01-13 Jim Meyering <meyering@redhat.com>
Remove each output redirection target before writing to it.
* tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_,
in case they exist beforehand and are not writable.
* build-aux/check.mk (am__check_pre): Likewise, remove $@-t.
2008-01-13 Elias Pipping <pipping@gentoo.org>
* configure.ac: Correct a non-portable use of sed.
2008-01-12 Mike Frysinger <vapier@gentoo.org>
* src/dircolors.hin (image formats): Add the .svg suffix.
2008-01-12 Jim Meyering <meyering@redhat.com>
Use new version of announce-gen.
* Makefile.maint (announcement): Remove use of the
--gnulib-snapshot-time-stamp option.
Use new --gnulib-version option instead.
(gnulib-version): New variable.
2008-01-11 Jim Meyering <meyering@redhat.com>
* Version 6.9.92.
* tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
Suggestions from James Youngman and Pádraig Brady in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227
2008-01-10 Jim Meyering <meyering@redhat.com>
* README-hacking: Add Git to the list of required tools.
2008-01-08 Paul Eggert <eggert@cs.ucla.edu>
Fix a minor race condition when using cp -p --parents.
* src/cp.c (make_dir_parents_private): If stat fails on the parent
directory, do not add it to the list of directories whose modes
might need fixing later. Also, do not bother invoking 'stat'
unless the stat results might be needed later.
2008-01-08 Jim Meyering <meyering@redhat.com>
parent-perm: avoid a bizarre test failure.
* tests/cp/parent-perm: Accommodate the situation in which
chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.
Remove uses of now-undefined Makefile variable.
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
2008-01-07 Jim Meyering <meyering@redhat.com>
cp (but not copy.c): plug a small leak.
* src/cp.c (do_copy) [--parents]: Free the attribute list.
Make a racy test failure less likely to happen.
* tests/misc/tty-eof: Uncomment a debug "warn".
This change happens to make this test far less likely to fail.
With that statement commented out, this test would fail about
20% of the time on my desktop. Now, it's gone 100 iterations
in a row with no failure.
* NEWS: Mention the cp bug fix.
2008-01-07 Jan Blunck <jblunck@suse.de>
cp --parents: don't use uninitialized memory when restoring permissions
* src/cp.c (make_dir_parents_private): Always stat each source
directory, in case its permissions are required in re_protect,
when setting permissions of a just-created destination directory.
2008-01-07 Jim Meyering <meyering@redhat.com>
cp: add a test for today's bug fix.
* tests/cp/parent-perm: New script. Test today's change.
Based on reproducer from Jan Blunck.
* tests/cp/Makefile.am (TESTS): Add parent-perm.
2008-01-06 Jim Meyering <meyering@redhat.com>
touch: add a test for today's change.
* tests/touch/now-owned-by-other: New script. Test today's change.
* tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
* tests/Makefile.am (all_t): Add td, a new root-only test.
(td): New target.
* NEWS: Mention the improvement.
2008-01-06 Paul Eggert <eggert@cs.ucla.edu>
touch: ignore "-d now" option, when appropriate
* src/touch.c (main): Treat "-d now" as if it were absent, if
neither -a nor -m is specified. Problem reported by Dan Jacobson in:
http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
2008-01-05 Jim Meyering <meyering@redhat.com>
Avoid tr case-conversion failure in some locales.
* src/tr.c (skip_construct): New function.
(main): When processing a pair of case-converting classes, don't
iterate through the elements of each [:upper:] or [:lower:] class.
Reported by Gerald Pfeifer in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
* tests/tr/Test.pm [tolower-F]: New test for the above fix.
[upcase-xtra, dncase-xtra]: New tests, for a related code path.
* NEWS: Mention the tr bug fix.
2008-01-02 Jim Meyering <jim@meyering.net>
* .gitignore: Ignore lzma-compressed files, too.
Update copyright date.
* tests/sample-test: Likewise.
* doc/coreutils.texi: Likewise.
-----
Copyright (C) 2008-2009 Free Software Foundation, Inc.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice
and this notice are preserved.

View File

@@ -1,58 +0,0 @@
# Having a separate GNUmakefile lets me `include' the dynamically
# generated rules created via Makefile.maint as well as Makefile.maint itself.
# This makefile is used only if you run GNU Make.
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
# Copyright (C) 2001, 2003 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
# the Free Software Foundation; either version 2 of the License, 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Systems where /bin/sh is not the default shell need this. The $(shell)
# command below won't work with e.g. stock DOS/Windows shells.
ifeq ($(wildcard /bin/s[h]),/bin/sh)
SHELL = /bin/sh
else
# will be used only with the next shell-test line, then overwritten
# by a configured-in value
SHELL = sh
endif
have-Makefile := $(shell test -f Makefile && echo yes)
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
ifeq ($(have-Makefile),yes)
# Make tar archive easier to reproduce.
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
include Makefile
include $(srcdir)/Makefile.cfg
include $(srcdir)/Makefile.maint
else
all:
@echo There seems to be no Makefile in this directory.
@echo "You must run ./configure before running \`make'."
@exit 1
endif
# Tell version 3.79 and up of GNU make to not build goals in this
# directory in parallel. This is necessary in case someone tries to
# build multiple targets on one command line.
.NOTPARALLEL:

491
HACKING Normal file
View File

@@ -0,0 +1,491 @@
Coreutils Contribution Guidelines
Prerequisites
=============
You will need the "git" version control tools.
On Fedora-based systems, do "yum install git".
On Debian-based ones install the "git-core" package.
Then run "git --version". If that says it's older than
version 1.4.4, then you'd do well to get a newer version.
At worst, just download the latest stable release from
http://git.or.cz/ and build from source.
For details on building the programs in this package, see
the file, README-hacking.
Use the latest upstream sources
===============================
Base any changes you make on the latest upstream sources.
You can get a copy of the latest with this command:
git clone git://git.sv.gnu.org/coreutils
That downloads the entire repository, including revision control history
dating back to 1991. The repository (the part you download, and which
resides in coreutils/.git) currently weighs in at about 30MB. So you
don't want to download it more often than necessary. Once downloaded,
you can get incremental updates by running one of these commands from
inside your new coreutils/ directory:
If you have made *no* changes:
git pull
If you *have* made changes and mistakenly committed them to "master",
do the following to put your changes on a private branch, "br", and
to restore master to its unmodified (relative-to-upstream) state:
git checkout -b br
git checkout master
git reset --hard origin
Then "git pull" should work.
*Before* you commit changes
===========================
In this project, we much prefer patches that automatically record
authorship. That is important not just to give credit where due, but
also from a legal standpoint (see below). To create author-annotated
patches with git, you must first tell git who you are. That information
is best recorded in your ~/.gitconfig file. Edit that file, creating
it if needed, and put your name and email address in place of these
example values:
[user]
name = Joe X. User
email = joe.user@example.com
Your first commit: the quick and dirty way
==========================================
First of all, realize that to "commit" a change in git is a purely
local operation. It affects only the local repository (the .git/ dir)
in your current coreutils/ hierarchy.
To try this out, modify a file or two. If you create a new file, you'll
need to tell git about it with "git add new-file.c". Commit all changes
with "git commit -a". That prompts you for a log message, which should
include a one-line summary, a blank line, and ChangeLog-style entries
for all affected files. More on that below.
Once your change is committed, you can create a proper patch that includes
a log message and authorship information as well as any permissions
changes. Use this command to save that single, most-recent change set:
git format-patch --stdout -1 > DIFF
The trouble with this approach is that you've just checked in a change
(remember, it's only local) on the "master" branch, and that's where new
changes would normally appear when you pull the latest from "upstream".
When you "pull" from a remote repository to get the latest, your local
changes on "master" may well induce conflicts. For this reason, you
may want to keep "master" free of any local changes, so that you can
use it to track unadulterated upstream sources.
However, if your cloned directory is for a one-shot patch submission and
you're going to remove it right afterwards, then this approach is fine.
Otherwise, for a more sustainable (and more generally useful, IMHO)
process, read on about "topic" branches.
Make your changes on a private "topic" branch
=============================================
So you checked out coreutils like this:
git clone git://git.sv.gnu.org/coreutils
Now, cd into the coreutils/ directory and run:
git checkout -b my-topic
That creates the my-topic branch and puts you on it.
To see which branch you're on, type "git branch".
Right after the clone, you were on "master" (aka the trunk).
To get back to the trunk, do this:
git checkout master
Note 1:
Be careful to run "git pull" only when on the "master" branch,
not when on a branch. With newer versions of git, you can't cause
trouble if you forget, so this is a good reason to ensure you're
using 1.5.3.1 or newer.
Note 2:
It's best not to try to switch from one branch to another if
you have pending (uncommitted) changes. Sometimes it works,
sometimes the checkout will fail, telling you that your local
modifications conflict with changes required to switch branches.
However, in any case, you will *not* lose your uncommitted changes.
Anyhow, get back onto your just-created branch:
git checkout my-topic
Now, modify some file and commit it:
git commit some-file.c
Personally, no matter what package I'm working on, I find it useful to
put the ChangeLog entries *only* in the commit log, initially, unless
I plan to commit/push right away. Otherwise, I tend to get unnecessary
merge conflicts with each rebase (see below). In coreutils, I've gone
a step further, and no longer maintain an explicit ChangeLog file in
version control. Instead, in a git working directory, you can view
ChangeLog information via "git log". However, each distribution tarball
does include a ChangeLog file that is automatically generated from the
git logs.
So, you've committed a change. But it's only in your local repository,
and only on your "my-topic" branch. Let's say you wait a day, and
then see that someone else changed something and pushed it to the
public repository. Now, you want to update your trunk and "rebase"
your changes on the branch so that they are once again relative to the
tip of the trunk. Currently, your branch is attached to the trunk at
the next-to-last change set.
First: update the trunk from the public repo:
[you've first made sure that "git diff" produces no output]
git checkout master
git pull
Now, return to your branch, and "rebase" relative to trunk (master):
git checkout my-topic
git rebase master
If there are no conflicts, this requires no more work from you.
However, let's say there was one in ChangeLog, since you didn't
follow my advice and modified it anyway.
git rebase will tell you there was a conflict and in which
file, and instruct you to resolve it and then resume with
"git rebase --continue" once that's done.
So you resolve as usual, by editing ChangeLog (which has the
usual conflict markers), then type "git rebase --continue".
That will fail, with a diagnostic telling you to mark
the file as "conflict resolved" by doing this:
git add ChangeLog
Then, finally, you can proceed (possibly onto more conflict resolution,
if there are conflicts in other files):
git rebase --continue
Once it finishes, your changes on the branch are now relative to
the tip of the trunk.
Now use git format-patch, as above.
Amending the most recent change on your private branch
======================================================
Let's say you've just committed a change on your private
branch, and then realize that something about it is not right.
It's easy to adjust:
edit your files # this can include running "git add NEW" or "git rm BAD"
git commit --amend -a
git format-patch --stdout -1 > your-branch.diff
That replaces the most recent change-set with the revised one.
Coreutils-specific:
No more ChangeLog files
=======================
Do not modify any of the ChangeLog files in coreutils. Starting in
2008, the policy changed. Before, we would insert the exact same text
(or worse, sometimes slightly differing) into both the ChangeLog file
and the commit log. Now we put that information only in the commit log,
and generate the top-level ChangeLog file from logs at "make dist" time.
As such, there are strict requirements on the form of the commit log
messages.
Commit log requirements
=======================
Your commit log should always start with a one-line summary, the second
line should be blank, and the remaining lines are usually ChangeLog-style
entries for all affected files. However, it's fine -- even recommended --
to write a few lines of prose describing the change, when the summary
and ChangeLog entries don't give enough of the big picture. Omit the
leading TABs that you're used to seeing in a "real" ChangeLog file, but
keep the maximum line length at 72 or smaller, so that the generated
ChangeLog lines, each with its leading TAB, will not exceed 80 columns.
As for the ChangeLog-style content, please follow these guidelines:
http://www.gnu.org/software/guile/changelogs/guile-changelogs_3.html
Try to make the summary line fit one of the following forms:
program_name: change-description
prog1, prog2: change-description
doc: change-description
tests: change-description
build: change-description
maint: change-description
Use SPACE-only indentation in all[*] files
==========================================
We use space-only indentation in nearly all files.
If you use Emacs and your coreutils working directory name matches,
this code enables the right mode:
;; In coreutils, indent with spaces everywhere (not TABs).
;; Exceptions: Makefile and ChangeLog modes.
(add-hook 'find-file-hook '(lambda ()
(if (and buffer-file-name
(string-match "/coreutils\\>" (buffer-file-name))
(not (string-equal mode-name "Change Log"))
(not (string-equal mode-name "Makefile")))
(setq indent-tabs-mode nil))))
[*] Makefile and ChangeLog files are exempt, of course.
[FIXME: suggest vim syntax to do same thing, if it can be done safely.
Most distros now "set nomodeline" by default for a good reason. ]
Send patches to the address listed in --help output
===================================================
Please follow the guidelines in the "Sending your patches." section of
git's own SubmittingPatches:
http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/SubmittingPatches
Add documentation
=================
If you add a feature or change some user-visible aspect of a program,
document it. If you add an option, document it both in --help output
(i.e., in the usage function that generates the --help output) and in
doc/*.texi. The man pages are generated from --help output, so
you shouldn't need to change anything under man/. User-visible changes
are usually documented in NEWS, too.
When writing prose (documentation, comments, log entries), use an
active voice, not a passive one. I.e., say "print the frobnozzle",
not "the frobnozzle will be printed".
Please add comments per the GNU Coding Standard:
http://www.gnu.org/prep/standards/html_node/Comments.html
Minor syntactic preferences
===========================
[I hesitate to write this one down, because it appears to be an
acquired taste, at least for native-English speakers. It seems odd
(if not truly backwards) to nearly anyone who doesn't have a strong
mathematics background and perhaps a streak of something odd in their
character ;-) ]
In writing arithmetic comparisons, use "<" and "<=" rather than
">" and ">=". For some justification, read this:
http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
const placement:
Write "Type const *var", not "const Type *var".
FIXME: dig up justification
Be nice to translators
======================
Don't change translatable strings if you can avoid it.
If you must rearrange individual lines (e.g., in multi-line --help
strings), extract and create new strings, rather than extracting
and moving into existing blocks. This avoids making unnecessary
work for translators.
Add tests
==========
Nearly every significant change must be accompanied by a test suite
addition that exercises it. If you fix a bug, add at least one test that
fails without the patch, but that succeeds once your patch is applied.
If you add a feature, add tests to exercise as much of the new code
as possible. Note to run tests/misc/newtest in isolation you can do:
(cd tests && make check TESTS=misc/newtest VERBOSE=yes)
There are hundreds of tests in the tests/ directories. You can use
tests/sample-test as a template, or one of the various Perl-based ones
in tests/misc.
If writing tests is not your thing, don't worry too much about it,
but do provide scenarios, input/output pairs, or whatever, along with
examples of running the tool to demonstrate the new or changed feature,
and someone else will massage that into a test (writing portable tests
can be a challenge).
Copyright assignment
====================
If your change is significant (i.e., if it adds more than ~10 lines),
then you'll have to have a copyright assignment on file with the FSF.
Since that involves first an email exchange between you and the FSF,
and then the exchange (FSF to you, then back) of an actual sheet of paper
with your signature on it, and finally, some administrative processing
in Boston, the process can take a few weeks.
The forms to choose from are in gnulib's doc/Copyright/ directory.
If you want to assign a single change, you should use the file,
doc/Copyright/request-assign.changes:
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.changes;hb=HEAD
If you would like to assign past and future contributions to a project,
you'd use doc/Copyright/request-assign.future:
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.future;hb=HEAD
You may make assignments for up to four projects at a time.
In case you're wondering why we bother with all of this, read this:
http://www.gnu.org/licenses/why-assign.html
Run "make syntax-check", or even "make distcheck"
================================================
Making either of those targets runs many integrity and
project-specific policy-conformance tests. For example, the former
ensures that you add no trailing blanks and no uses of certain deprecated
functions. The latter performs all "syntax-check" tests, and also
ensures that the build completes with no warnings when using a certain
set of gcc -W... options. Don't even bother running "make distcheck"
unless you have a reasonably up to date installation including recent
versions of gcc and the linux kernel, and modern GNU tools.
Ensure that your changes are indented properly.
===============================================
Format the code the way GNU indent does.
In a file with the "indent-tabs-mode: nil" directive at the end,
running "indent --no-tabs" should induce no change.
With other files, there will be some existing differences.
Try not to add any more.
Avoid trailing white space
==========================
You may notice that the only trailing blanks in coreutils'
version-controlled files are in a single directory: tests/pr,
which contains expected output from various invocations of pr.
Do not add any more trailing blanks anywhere. While "make syntax-check"
will alert you if you slip up, it's better to nip any problem in the
bud, as you're typing. A good way to help you adapt to this rule is
to configure your editor to highlight any offending characters in the
files you edit. If you use Emacs, customize its font-lock mode (FIXME:
provide more detail) or try one of its whitespace packages. This appears
to be the one that will end up in emacs 23:
http://www.emacswiki.org/emacs/WhiteSpace
[that page says its version also works with emacs 21 and 22]
If you use vim, add this to ~/.vimrc:
let c_space_errors=1
highlight RedundantSpaces ctermbg=red guibg=red
match RedundantSpaces /\s\+$\| \+\ze\t/
Git can help too, by stopping you from committing any change that would
add trailing blanks. The example pre-commit hook contains code to check
for trailing whitespace and spaces before tabs; enable it by moving it
to the right place and making sure it is executable:
mv .git/hooks/pre-commit.sample .git/hooks/pre-commit
With a repository created by git-1.5.6 or older, use this command:
chmod +x .git/hooks/pre-commit
To manually check for whitespace errors before committing, you can use
git diff --check
Git also has some settings to enable suitable internal whitespace checks.
See the manpage for git-apply for details.
-------------------------------------------
Miscellaneous useful git commands
=================================
* gitk: give a graphical view of the revision graph of the current branch
* gitk --all: same, but display all branches
* git log: to get most of the same info in text form
* git log -p: same as above, but with diffs
* git log -p SOME_FILE: same as above, but limit to SOME_FILE
* git log -p -2 SOME_FILE: same as above, but print only two deltas
* git log -p -1: print the most recently committed change set
* git format-patch --stdout -1 > FILE: output the most recently committed
change set, in a format suitable to be submitted and/or applied via
"git am FILE".
* git reset --soft HEAD^: Commit the delta required to restore
state to the revision just before HEAD (i.e., next-to-last).
* git rebase -i master: run this from on a branch, and it gives
you an interface with which you can reorder and modify arbitrary
change sets on that branch.
* if you "misplace" a change set, i.e., via git reset --hard ..., so that
it's no longer reachable by any branch, you can use "git fsck" to find
its SHA1 and then tag it or cherry-pick it onto an existing branch.
For example, run this:
git fsck --lost-found HEAD && cd .git/lost-found/commit \
&& for i in *; do git show $i|grep SOME_IDENTIFYING_STRING \
&& echo $i; done
The "git fsck ..." command creates the .git/lost-found/... hierarchy
listing all unreachable objects. Then the for loop
print SHA1s for commits that match via log or patch.
For example, say that found 556fbb57216b119155cdda824c98dc579b8121c8,
you could run "git show 556fbb57216b119" to examine the change set,
or "git checkout -b found 556fbb5721" to give it a branch name.
Finally, you might run "git checkout master && git cherry-pick 556fbb5721"
to put that change on the tip of "master".
-------------------------------------------
Finding things to do
====================
If you don't know where to start, check out the TODO file for projects
that look like they're at your skill-/interest-level. Another good
option is always to improve tests. You never know what you might
uncover when you improve test coverage, and even if you don't find
any bugs your contribution is sure to be appreciated.
A good way to quickly assess current test coverage is to use "lcov"
to generate HTML coverage reports. Follow these steps:
# configure with coverage information
./configure CFLAGS="-g -fprofile-arcs -ftest-coverage"
make
# run whatever tests you want, i.e.:
make check
# run lcov
lcov -t coreutils -q -d lib -b lib -o lib.lcov -c
lcov -t coreutils -q -d src -b src -o src.lcov -c
# generate HTML from the output
genhtml -p `pwd` -t coreutils -q --output-directory lcov-html *.lcov
Then just open the index.html file (in the generated lcov-html directory)
in your favorite web browser.
========================================================================
Copyright (C) 2009 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.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the ``GNU Free
Documentation License'' file as part of this distribution.

229
INSTALL
View File

@@ -1,229 +0,0 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@@ -1,37 +1,90 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
# Make coreutils. -*-Makefile-*-
SUBDIRS = lib src doc man po tests
EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
.kludge-stamp .prev-version THANKS-to-translators THANKStt.in \
.x-sc_space_tab .x-sc_sun_os_names \
.x-sc_file_system .x-sc_obsolete_symbols \
.x-sc_useless_cpp_parens \
.x-sc_no_if_have_config_h \
announce-gen \
m4/ChangeLog \
old/fileutils/ChangeLog \
old/fileutils/ChangeLog-1997 \
old/sh-utils/ChangeLog \
old/sh-utils/ChangeLog.0 \
old/textutils/ChangeLog \
old/fileutils/NEWS \
old/sh-utils/NEWS \
old/textutils/NEWS
# Copyright (C) 1990, 1993-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
ALL_RECURSIVE_TARGETS =
SUBDIRS = lib src doc man po tests gnulib-tests
changelog_etc = \
ChangeLog-2005 \
ChangeLog-2006 \
ChangeLog-2007 \
ChangeLog-2008 \
build-aux/ChangeLog-2007 \
build-aux/update-copyright \
doc/ChangeLog-2007 \
lib/ChangeLog-2007 \
m4/ChangeLog-2007 \
old/fileutils/ChangeLog \
old/fileutils/ChangeLog-1997 \
old/fileutils/NEWS \
old/sh-utils/ChangeLog \
old/sh-utils/ChangeLog.0 \
old/sh-utils/NEWS \
old/textutils/ChangeLog \
old/textutils/NEWS \
po/ChangeLog-2007
syntax_check_exceptions = \
.x-sc_GPL_version \
.x-sc_error_message_uppercase \
.x-sc_file_system \
.x-sc_obsolete_symbols \
.x-sc_po_check \
.x-sc_program_name \
.x-sc_prohibit_atoi_atof \
.x-sc_prohibit_stat_st_blocks \
.x-sc_prohibit_strcmp \
.x-sc_prohibit_tab_based_indentation \
.x-sc_require_config_h \
.x-sc_require_config_h_first \
.x-sc_space_tab \
.x-sc_sun_os_names \
.x-sc_system_h_headers \
.x-sc_trailing_blank \
.x-sc_unmarked_diagnostics \
.x-sc_useless_cpp_parens
EXTRA_DIST = \
$(changelog_etc) \
$(syntax_check_exceptions) \
.prev-version \
.version \
.vg-suppressions \
THANKS-to-translators \
THANKStt.in \
bootstrap \
bootstrap.conf \
build-aux/cvsu \
cfg.mk \
dist-check.mk \
gl/modules/getloadavg.diff \
maint.mk
ALL_RECURSIVE_TARGETS += install-root
install-root:
cd src && $(MAKE) $@
ACLOCAL_AMFLAGS = -I m4
# Some tests always need root privileges, others need them only sometimes.
ALL_RECURSIVE_TARGETS += check-root
check-root:
cd tests && $(MAKE) $@
dist-hook:
test -x $(srcdir)/build-aux/install-sh
distcheck-hook:
$(MAKE) my-distcheck
cd tests && $(MAKE) $@ SUBDIRS=
# Just prior to distribution, ...
# transform the automake-generated rule that runs `rm -f rm'.
@@ -40,17 +93,56 @@ distcheck-hook:
# in the shell's search path that running `rm' would run the `rm'
# executable in the current directory.
# Similarly, adjust the clean-binPROGRAMS rule.
rm_subst = \
s!(rm -f (rm|\$$\(bin_PROGRAMS\)))$$!$$1 > /dev/null 2>&1 || /bin/$$1!
.kludge-stamp: $(srcdir)/src/Makefile.in
perl -pi -e '$(rm_subst)' $(srcdir)/src/Makefile.in
touch $@
s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
BUILT_SOURCES = .version
.version:
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
# See the rm_subst comment for details.
dist-hook: gen-ChangeLog
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
gen_start_date = 2008-02-08
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since=$(gen_start_date) > $(distdir)/cl-t; \
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
ALL_RECURSIVE_TARGETS += distcheck-hook
distcheck-hook: check-ls-dircolors
$(MAKE) my-distcheck
$(MAKE) taint-distcheck
DISTCLEANFILES = VERSION
MAINTAINERCLEANFILES = THANKS-to-translators
THANKS-to-translators: po/LINGUAS THANKStt.in
( \
$(AM_V_GEN)( \
cat $(srcdir)/THANKStt.in; \
for lang in `cat po/LINGUAS`; do \
echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \
for lang in `cat $(srcdir)/po/LINGUAS`; do \
echo http://translationproject.org/team/$$lang.html; \
done; \
) > $@-tmp && mv $@-tmp $@
# Ensure that the sets of two-letter codes in ls.c and dircolors.c
# remain in sync.
.PHONY: check-ls-dircolors
check-ls-dircolors:
$(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
$(srcdir)/src/dircolors.c \
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
$(srcdir)/src/ls.c \
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
test "$$dc" = "$$ls"

View File

@@ -1,51 +0,0 @@
# Customize Makefile.maint. -*- makefile -*-
# Copyright (C) 2003, 2004, 2005 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
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Use alpha.gnu.org for alpha and beta releases.
# Use ftp.gnu.org for major releases.
gnu_ftp_host-alpha = alpha.gnu.org
gnu_ftp_host-beta = alpha.gnu.org
gnu_ftp_host-major = ftp.gnu.org
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
url_dir_list = \
ftp://$(gnu_rel_host)/gnu/coreutils
# Files to update automatically.
wget_files = \
$(srcdir)/build-aux/config.guess \
$(srcdir)/build-aux/config.sub \
$(srcdir)/build-aux/texinfo.tex
# Of the above, texinfo.tex is out of date,
# and the other two are not available.
wget_files =
cvs_files = \
$(srcdir)/build-aux/elisp-comp \
$(srcdir)/build-aux/depcomp \
$(srcdir)/build-aux/mdate-sh \
$(srcdir)/build-aux/missing \
$(srcdir)/build-aux/install-sh \
$(srcdir)/build-aux/mkinstalldirs
# $(srcdir)/src/ansi2knr.c
local_updates = wget-update cvs-update
# Tests not to run.
local-checks-to-skip =

View File

@@ -1,816 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.hin \
$(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL NEWS THANKS TODO build-aux/ChangeLog \
build-aux/config.guess build-aux/config.rpath \
build-aux/config.sub build-aux/depcomp build-aux/install-sh \
build-aux/mdate-sh build-aux/missing build-aux/mkinstalldirs \
build-aux/texinfo.tex
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/afs.m4 \
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \
$(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/assert.m4 \
$(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \
$(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/basename.m4 \
$(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \
$(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \
$(top_srcdir)/m4/canon-host.m4 \
$(top_srcdir)/m4/canonicalize.m4 \
$(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \
$(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \
$(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/closeout.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/cycle-check.m4 \
$(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \
$(top_srcdir)/m4/diacrit.m4 $(top_srcdir)/m4/dirfd.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
$(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fd-reopen.m4 \
$(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \
$(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \
$(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \
$(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \
$(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \
$(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \
$(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
$(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getdelim.m4 \
$(top_srcdir)/m4/getgroups.m4 $(top_srcdir)/m4/gethostname.m4 \
$(top_srcdir)/m4/gethrxtime.m4 $(top_srcdir)/m4/getline.m4 \
$(top_srcdir)/m4/getndelim2.m4 $(top_srcdir)/m4/getopt.m4 \
$(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/getpass.m4 \
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \
$(top_srcdir)/m4/gettimeofday.m4 \
$(top_srcdir)/m4/getugroups.m4 \
$(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \
$(top_srcdir)/m4/group-member.m4 \
$(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash-pjw.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/host-os.m4 \
$(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/intmax_t.m4 \
$(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \
$(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \
$(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \
$(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchown.m4 \
$(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/linebuffer.m4 $(top_srcdir)/m4/link-follow.m4 \
$(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/long-options.m4 \
$(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \
$(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/md5.m4 \
$(top_srcdir)/m4/memcasecmp.m4 $(top_srcdir)/m4/memchr.m4 \
$(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memcoll.m4 \
$(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \
$(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
$(top_srcdir)/m4/memset.m4 $(top_srcdir)/m4/mkdir-p.m4 \
$(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \
$(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \
$(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/nanosleep.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/obstack.m4 \
$(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/openat.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \
$(top_srcdir)/m4/physmem.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \
$(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \
$(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \
$(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \
$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
$(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/rmdir-errno.m4 \
$(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/root-dev-ino.m4 \
$(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \
$(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \
$(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
$(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/settime.m4 \
$(top_srcdir)/m4/sha1.m4 $(top_srcdir)/m4/sig2str.m4 \
$(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/socklen.m4 \
$(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
$(top_srcdir)/m4/st_dm_mode.m4 $(top_srcdir)/m4/stat-macros.m4 \
$(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h.m4 \
$(top_srcdir)/m4/stdio-safer.m4 \
$(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strcspn.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \
$(top_srcdir)/m4/stripslash.m4 $(top_srcdir)/m4/strndup.m4 \
$(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \
$(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strstr.m4 \
$(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtoimax.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \
$(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \
$(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/strverscmp.m4 \
$(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
$(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/uint32_t.m4 \
$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/uintptr_t.m4 \
$(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
$(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
$(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
$(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
$(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
$(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
$(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
$(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xfts.m4 \
$(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \
$(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xstrtod.m4 \
$(top_srcdir)/m4/xstrtoimax.m4 $(top_srcdir)/m4/xstrtol.m4 \
$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/m4/yesno.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALLOCA_H = @ALLOCA_H@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EOVERFLOW = @EOVERFLOW@
EXEEXT = @EXEEXT@
FNMATCH_H = @FNMATCH_H@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_H = @GETOPT_H@
GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
GREP = @GREP@
HAVE__BOOL = @HAVE__BOOL@
HELP2MAN = @HELP2MAN@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
KMEM_GROUP = @KMEM_GROUP@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_EACCESS = @LIB_EACCESS@
LIB_FDATASYNC = @LIB_FDATASYNC@
LIB_GETHRXTIME = @LIB_GETHRXTIME@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NEED_SETGID = @NEED_SETGID@
OBJEXT = @OBJEXT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSUB = @POSUB@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
U = @U@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = lib src doc man po tests
EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
.kludge-stamp .prev-version THANKS-to-translators THANKStt.in \
.x-sc_space_tab .x-sc_sun_os_names \
.x-sc_file_system .x-sc_obsolete_symbols \
.x-sc_useless_cpp_parens \
.x-sc_no_if_have_config_h \
announce-gen \
m4/ChangeLog \
old/fileutils/ChangeLog \
old/fileutils/ChangeLog-1997 \
old/sh-utils/ChangeLog \
old/sh-utils/ChangeLog.0 \
old/textutils/ChangeLog \
old/fileutils/NEWS \
old/sh-utils/NEWS \
old/textutils/NEWS
ACLOCAL_AMFLAGS = -I m4
# Just prior to distribution, ...
# transform the automake-generated rule that runs `rm -f rm'.
# On some systems, that command would fail with a diagnostic like
# `rm: cannot unlink `rm': Text file busy' when `.' appears so early
# in the shell's search path that running `rm' would run the `rm'
# executable in the current directory.
# Similarly, adjust the clean-binPROGRAMS rule.
rm_subst = \
s!(rm -f (rm|\$$\(bin_PROGRAMS\)))$$!$$1 > /dev/null 2>&1 || /bin/$$1!
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \
cd $(srcdir) && $(AUTOMAKE) --gnits \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.hin: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@case `sed 15q $(srcdir)/NEWS` in \
*"$(VERSION)"*) : ;; \
*) \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1;; \
esac
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/build-aux $(distdir)/m4 $(distdir)/old/fileutils $(distdir)/old/sh-utils $(distdir)/old/textutils $(distdir)/po
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-recursive ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-recursive \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-info-am
install-root:
cd src && $(MAKE) $@
# Some tests always need root privileges, others need them only sometimes.
check-root:
cd tests && $(MAKE) $@
dist-hook:
test -x $(srcdir)/build-aux/install-sh
distcheck-hook:
$(MAKE) my-distcheck
.kludge-stamp: $(srcdir)/src/Makefile.in
perl -pi -e '$(rm_subst)' $(srcdir)/src/Makefile.in
touch $@
THANKS-to-translators: po/LINGUAS THANKStt.in
( \
cat $(srcdir)/THANKStt.in; \
for lang in `cat po/LINGUAS`; do \
echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \
done; \
) > $@-tmp && mv $@-tmp $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,610 +0,0 @@
# -*-Makefile-*-
# This Makefile fragment is shared between the coreutils,
# CPPI, Bison, and Autoconf.
## Copyright (C) 2001-2005 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
## 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., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
# This is reported not to work with make-3.79.1
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME := Makefile.maint
# Do not save the original name or timestamp in the .tar.gz file.
GZIP_ENV = '--no-name --best --rsyncable'
CVS = cvs
CVS_LIST = cvsu --find --types=AFGM
ifeq ($(origin prev_version_file), undefined)
prev_version_file = .prev-version
endif
PREV_VERSION := $(shell cat $(prev_version_file))
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
tag-this-version = $(subst .,_,$(VERSION))
this-cvs-tag = $(tag-package)-$(tag-this-version)
my_distdir = $(PACKAGE)-$(VERSION)
# Old releases are stored here.
# Used for diffs and xdeltas.
release_archive_dir ?= ../release
# Prevent programs like 'sort' from considering distinct strings to be equal.
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
export LC_ALL = C
## --------------- ##
## Sanity checks. ##
## --------------- ##
# Checks that don't require cvs.
# Run `changelog-check' last, as previous test may reveal problems requiring
# new ChangeLog entries.
local-checks-available = \
po-check copyright-check writable-files m4-check author_mark_check \
changelog-check strftime-check syntax-check makefile_path_separator_check \
makefile-check
.PHONY: $(local-checks-available)
local-check = $(filter-out $(local-checks-to-skip), $(local-checks-available))
.PHONY: $(syntax-check-rules)
syntax-check-rules = \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_cast_of_alloca_return_value \
sc_dd_max_sym_length \
sc_error_exit_success \
sc_file_system \
sc_no_if_have_config_h \
sc_obsolete_symbols \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
sc_root_tests \
sc_space_tab \
sc_sun_os_names \
sc_system_h_headers \
sc_tight_scope \
sc_trailing_blank \
sc_unmarked_diagnostics \
sc_useless_cpp_parens
syntax-check: $(syntax-check-rules)
# @grep -E '# *include <(limits|std(def|arg|bool))\.h>' \
# $$(find -type f -name '*.[chly]') && \
# { echo '$(ME): found conditional include' 1>&2; \
# exit 1; } || :
# grep -E '^# *include <(string|stdlib)\.h>' \
# $(srcdir)/{lib,src}/*.[chy] && \
# { echo '$(ME): FIXME' 1>&2; \
# exit 1; } || :
# FIXME: don't allow `#include .strings\.h' anywhere
# FIXME: add a check for this.
# Nearly every lib/*.c file must include config.h, like this:
# #ifdef HAVE_CONFIG_H
# # include <config.h>
# #endif
sc_cast_of_argument_to_free:
@grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
exit 1; } || :
sc_cast_of_x_alloc_return_value:
@grep -E --exclude=$(srcdir)/lib/regex.c \
'\*\) *x(m|c|re)alloc\>' \
$(srcdir)/{lib,src}/*.[chy] && \
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
exit 1; } || :
sc_cast_of_alloca_return_value:
@grep -E '\*\) *alloca\>' \
$(srcdir)/src/*.[chy] && \
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
exit 1; } || :
sc_space_tab:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep '[ ] ' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
1>&2; exit 1; } || :
# Don't use atoi, atof, atol, atoll, or atoq in `real' code.
# They provide no error checking mechanism.
# Instead, use strto* functions.
sc_prohibit_atoi_atof:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -E '\<(ato[filq]|atoll)\>' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): do not use atof, atoi, atol, atoll, or atoq' \
1>&2; exit 1; } || :
# Using EXIT_SUCCESS as the first argument to error is misleading,
# since when that parameter is 0, error does not exit. Use `0' instead.
sc_error_exit_success:
@grep -F 'error (EXIT_SUCCESS,' \
$$(find -type f -name '*.[chly]') && \
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
exit 1; } || :
sc_file_system:
@grep -i 'filesystem' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found use of "filesystem";' \
'rewrite to use "file system"' 1>&2; \
exit 1; } || :
sc_no_if_have_config_h:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep '^# *if HAVE_CONFIG_H' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
1>&2; exit 1; } || :
sc_obsolete_symbols:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -E '\<(HAVE_FCNTL_H)\>' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): do not use HAVE_FCNTL_H' \
1>&2; exit 1; } || :
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
# Each nonempty line must start with a year number, or a TAB.
sc_changelog:
@grep '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
exit 1; } || :
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
# with the strings from the two affected variables.
dd_c = $(srcdir)/src/dd.c
sc_dd_max_sym_length:
@test -f $(dd_c) || exit 0; \
len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c); \
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|tr -d '"' | wc --max-line-length); \
if test "$$len" = "$$max"; then :; else \
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
exit 1; \
fi
# Many m4 macros names once began with `jm_'.
# On 2004-04-13, they were all changed to start with gl_ instead.
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -E 'jm_[A-Z]' \
$$($(CVS_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
sc_root_tests:
@t1=sc-root.expected; t2=sc-root.actual; \
grep -l '^PRIV_CHECK_ARG=require-root' \
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
$(srcdir)/tests/Makefile.am |sort > $$t2; \
diff -u $$t1 $$t2 || diff=1; \
rm -f $$t1 $$t2; \
test "$$diff" \
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
exit 1; } || :
# Create a list of regular expressions matching the names
# of files included from system.h. Exclude a couple.
.re-list:
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
| grep -Ev 'sys/(param|file)\.h' \
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
> $@-t
@mv $@-t $@
# Files in src/ should not include directly any of
# the headers already included via system.h.
sc_system_h_headers: .re-list
@if test -f $(srcdir)/src/system.h; then \
( $(CVS_LIST) ) > /dev/null 2>&1 || exit 0; \
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
grep -E -f .re-list \
$$($(CVS_LIST) src | grep -Ev '(copy|system)\.h$$') \
&& { echo '$(ME): the above are already included via system.h'\
1>&2; exit 1; } || :; \
fi
sc_sun_os_names:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -Ei \
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
exit 1; } || :
sc_tight_scope:
$(MAKE) -C src $@
sc_trailing_blank:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep '[ ]$$' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found trailing blank(s)' \
1>&2; exit 1; } || :
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics:
@grep -E \
'\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c \
| grep -v '_(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
# Avoid useless parentheses like those in this example:
# #if defined (SYMBOL) || defined (SYM2)
sc_useless_cpp_parens:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep '^# *if .*defined *(' \
$$($(CVS_LIST) | grep -vEf .x-$@ ) && \
{ echo '$(ME): found useless parentheses in cpp directive' \
1>&2; exit 1; } || :
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
strftime-check:
if test -f $(srcdir)/src/date.c; then \
grep '^ %. ' $(srcdir)/src/date.c | sort \
| $(extract_char) > $@-src; \
{ echo N; \
info libc date calendar format | grep '^ `%.'\' \
| $(extract_char); } | sort > $@-info; \
diff -u $@-src $@-info || exit 1; \
rm -f $@-src $@-info; \
fi
# Ensure that we use only the standard $(VAR) notation,
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
makefile-check:
grep -E '@[A-Z_0-9]+@' `find . -name Makefile.am` \
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
news-date-check: NEWS
today=`date +%Y-%m-%d`; \
if head NEWS | grep '^\*.*'$$today >/dev/null; then \
:; \
else \
echo "today's date is not in NEWS" 1>&2; \
exit 1; \
fi
changelog-check:
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
:; \
else \
echo "$(VERSION) not in ChangeLog" 1>&2; \
exit 1; \
fi
m4-check:
@grep 'AC_DEFUN([^[]' m4/*.m4 \
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
exit 1; } || :
# Verify that all source files using _() are listed in po/POTFILES.in.
# FIXME: don't hard-code src/false.c below; use a more general mechanism.
po-check:
( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in \
| grep -v '^src/false\.c$$' | sort > $@-1; \
files=; \
for file in $$($(CVS_LIST) lib src | grep '\.[chly]$$'); do \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
# In a definition of #define AUTHORS "... and ..." where the RHS contains
# the English word `and', the string must be marked with `N_ (...)' so that
# gettext recognizes it as a string requiring translation.
author_mark_check:
@grep '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
exit 1; } || :
# Sometimes it is useful to change the PATH environment variable
# in Makefiles. When doing so, it's better not to use the Unix-centric
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
# and there probably aren't many projects with so many Makefile.am files
# that we'd have to worry about limits on command line length.
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
makefile_path_separator_check:
@grep 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
&& { echo $(msg) 1>&2; exit 1; } || :
# Check that `make alpha' will not fail at the end of the process.
writable-files:
if test -d $(release_archive_dir); then :; else \
mkdir $(release_archive_dir); \
fi
for file in $(distdir).tar.gz $(xd-delta) \
$(release_archive_dir)/$(distdir).tar.gz \
$(release_archive_dir)/$(xd-delta); do \
test -e $$file || continue; \
test -w $$file \
|| { echo ERROR: $$file is not writable; fail=1; }; \
done; \
test "$$fail" && exit 1 || :
v_etc_file = lib/version-etc.c
# Make sure that the copyright date in $(v_etc_file) is up to date.
copyright-check:
@if test -f $(v_etc_file); then \
grep 'enum { COPYRIGHT_YEAR = 2005 };' $(v_etc_file) \
>/dev/null \
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
exit 1; }; \
fi
# Sanity checks with the CVS repository.
cvs-tag-check:
echo $(this-cvs-tag); \
if $(CVS) -n log -h README | grep -e $(this-cvs-tag): >/dev/null; then \
echo "$(this-cvs-tag) as already been used; not tagging" 1>&2; \
exit 1; \
else :; fi
cvs-diff-check:
if $(CVS) diff >cvs-diffs; then \
rm cvs-diffs; \
else \
echo "Some files are locally modified:" 1>&2; \
cat cvs-diffs; \
exit 1; \
fi
cvs-check: cvs-diff-check cvs-tag-check
maintainer-distcheck: changelog-check
$(MAKE) distcheck
$(MAKE) my-distcheck
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
cvs-dist: $(local-check) cvs-check maintainer-distcheck
$(CVS) update po
$(CVS) tag -c $(this-cvs-tag)
$(MAKE) dist
# Use this to make sure we don't run these programs when building
# from a virgin tgz file, below.
null_AM_MAKEFLAGS = \
ACLOCAL=false \
AUTOCONF=false \
AUTOMAKE=false \
AUTOHEADER=false \
MAKEINFO=false
# Detect format-string/arg-list mismatches that would normally be obscured
# by the use of _(). The --disable-nls effectively defines away that macro,
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
# treated as a failure. Also, check for shadowing problems with -Wshadow.
# These CFLAGS are pretty strict. If you build this target, you probably
# have to have a recent version of gcc and glibc headers.
TMPDIR ?= /tmp
t=$(TMPDIR)/$(PACKAGE)/test
my-distcheck: $(local-check)
-rm -rf $(t)
mkdir -p $(t)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow' \
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) distclean
(cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-rm -rf $(t)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
WGET = wget
WGETFLAGS = -C off
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/ -//')
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
xdelta-md5 = $(shell md5sum < $(xd-delta)|sed 's/ -//')
xdelta-sha1 = $(shell sha1sum < $(xd-delta)|sed 's/ -//')
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([MkK]\).*/ \1B/')
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([MkK]\).*/ \1B/')
xd-size = $(shell du --human $(xd-delta)|sed 's/\([MkK]\).*/ \1B/')
rel-check:
tarz=/tmp/rel-check-tarz-$$$$; \
md5_tmp=/tmp/rel-check-md5-$$$$; \
set -e; \
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
echo "$(md5) -" > $$md5_tmp; \
md5sum -c $$md5_tmp < $$tarz
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
rel-files = $(xd-delta) $(DIST_ARCHIVES)
announcement: NEWS ChangeLog $(rel-files)
@./announce-gen \
--release-type=$(RELEASE_TYPE) \
--package=$(PACKAGE) \
--prev=$(PREV_VERSION) \
--curr=$(VERSION) \
--release-archive-directory=$(release_archive_dir) \
--news=NEWS \
$(addprefix --url-dir=, $(url_dir_list)) \
## ---------------- ##
## Updating files. ##
## ---------------- ##
ftp-gnu = ftp://ftp.gnu.org/gnu
www-gnu = http://www.gnu.org
# Use mv, if you don't have/want move-if-change.
move_if_change ?= move-if-change
# --------------------- #
# Updating everything. #
# --------------------- #
.PHONY: update
local_updates ?= wget-update cvs-update po-update
update: $(local_updates)
# ------------------- #
# Updating PO files. #
# ------------------- #
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
rm -rf $$tmppo && \
mkdir $$tmppo && \
(cd $$tmppo && \
$(WGET) $(WGETFLAGS) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
cp $$tmppo/*.po po
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
if test -d "po"; then \
$(MAKE) do-po-update; \
fi
# -------------------------- #
# Updating GNU build tools. #
# -------------------------- #
# The following pseudo table associates a local directory and a URL
# with each of the files that belongs to some other package and is
# regularly updated from the specified URL.
wget_files ?= \
$(srcdir)/build-aux/config.guess \
$(srcdir)/build-aux/config.sub \
$(srcdir)/build-aux/texinfo.tex \
$(srcdir)/src/ansi2knr.c
get-targets = $(patsubst %, get-%, $(wget_files))
config.guess-url_prefix = $(ftp-gnu)/build-aux/
config.sub-url_prefix = $(ftp-gnu)/build-aux/
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
standards.texi-url_prefix = $(www-gnu)/prep/
make-stds.texi-url_prefix = $(standards.texi-url_prefix)
target = $(patsubst get-%, %, $@)
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
.PHONY: $(get-targets)
$(get-targets):
$(WGET) $(WGETFLAGS) $(url) -O $(target).t \
&& $(move_if_change) $(target).t $(target)
cvs_files ?= \
$(srcdir)/build-aux/depcomp \
$(srcdir)/build-aux/install-sh \
$(srcdir)/build-aux/missing \
$(srcdir)/build-aux/mkinstalldirs \
$(srcdir)/src/ansi2knr.c
automake_repo=:pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/automake
.PHONY: wget-update
wget-update: $(get-targets)
.PHONY: cvs-update
cvs-update:
fail=; \
for f in $(cvs_files); do \
test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
cvs diff $$f > /dev/null \
|| { echo "*** $$f is locally modified; skipping it" 1>&2; \
fail=yes; continue; }; \
file=$$(basename $$f); \
echo checking out $$file...; \
$(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
&& $(move_if_change) $$f.t $$f; \
done; \
test "$$fail" && exit 1
emit_upload_commands:
@echo =====================================
@echo =====================================
@echo "$(srcdir)/gnupload $(GNUPLOADFLAGS) \\"
@echo " --to $(gnu_rel_host):coreutils \\"
@echo " $(rel-files)"
@echo '# send the /tmp/announcement e-mail'
@echo =====================================
@echo =====================================
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
xdelta delta -9 $^ $@ || :
.PHONY: alpha beta major
alpha beta major: news-date-check $(local-check)
$(MAKE) cvs-dist
$(MAKE) $(xd-delta)
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
ln $(rel-files) $(release_archive_dir)
chmod a-w $(rel-files)
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
echo $(VERSION) > $(prev_version_file)
$(CVS) ci -m. $(prev_version_file)

1488
NEWS

File diff suppressed because it is too large Load Diff

134
README
View File

@@ -7,17 +7,21 @@ arbitrary limits.
The programs that can be built with this package are:
[ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
df dir dircolors dirname du echo env expand expr factor false fmt fold
ginstall groups head hostid hostname id join kill link ln logname ls
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort
split stat stty su sum sync tac tail tee test touch tr true tsort tty
uname unexpand uniq unlink uptime users vdir wc who whoami yes
[ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
csplit cut date dd df dir dircolors dirname du echo env expand expr
factor false fmt fold groups head hostid hostname id install join kill
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
sleep sort split stat stdbuf stty su sum sync tac tail tee test timeout
touch tr true truncate tsort tty uname unexpand uniq unlink uptime users
vdir wc who whoami yes
See the file NEWS for a list of major changes in the current release.
See the file INSTALL for compilation and installation instructions.
If you obtained this file as part of a "git clone", then see the
README-hacking file. If this file came to you as part of a tar archive,
then see the file INSTALL for compilation and installation instructions.
These programs are intended to conform to POSIX (with BSD and other
extensions), like the rest of the GNU system. By default they conform
@@ -37,7 +41,7 @@ Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry,
Kaveh Ghazi, and François Pinard for help with debugging and porting
these programs. Many thanks to all of the people who have taken the
time to submit problem reports and fixes. All contributed changes are
attributed in the ChangeLog files.
attributed in the commit logs.
And thanks to the following people who have provided accounts for
portability testing on many different types of systems: Bob Proulx,
@@ -54,9 +58,48 @@ and from the corresponding --help usage message. Patches to the template
files (man/*.x) are welcome. However, the authoritative documentation
is in texinfo form in the doc directory.
If you run the tests on a SunOS4.1.4 system, expect the ctime-part of
the ls `time-1' test to fail. I believe that is due to a bug in the
way Sun implemented link(2) and chmod(2).
*****************************************
On Mac OS X 10.5.1 (Darwin 9.1), test failure
-----------------------------------------
Mac OS X 10.5.1 (Darwin 9.1) provides only partial (and incompatible)
ACL support, so although "./configure && make" succeeds, "make check"
exposes numerous failures. The solution is to turn off ACL support
manually via "./configure --disable-acl". For details, see
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12292/focus=12318>.
*****************************************
Test failure with NLS and gettext <= 0.17
-----------------------------------------
Due to a conflict between libintl.h and gnulib's new xprintf module,
when you configure with NLS support, and with a gettext installation
older than 0.17.1 (not yet released, at the time of this writing),
then some tests fail, at least on NetBSD 1.6. To work around it in
the mean time, you can configure with --disable-nls. For details,
see <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12015/>.
***********************
Pre-C99 build failure
-----------------------
There is a new, implicit build requirement:
To build the coreutils from source, you should have a C99-conforming
compiler, due to the use of declarations after non-declaration statements
in several files in src/. There is code in configure to find and, if
possible, enable an appropriate compiler. However, if configure doesn't
find a C99 compiler, it continues nonetheless, and your build will fail.
If that happens, simply[*] apply the included patch using the following
command, and then run make again:
cd src && patch < c99-to-c89.diff
[*] however, as of coreutils-7.1, the "c99-to-c89.diff" file is no longer
maintained, so even if the patches still apply, the result will be an
incomplete conversion. It's been 10 years. Get a decent compiler! ;-)
***********************
@@ -80,6 +123,18 @@ Here is one possible patch to correct the problem:
+#ifndef __LP64__
************************
OSF/1 4.0d build failure
------------------------
If you use /usr/bin/make on an OSF/1 4.0d system, it will fail due
to the presence of the "[" target. That version of make appears to
treat "[" as some syntax relating to locks. To work around that,
the best solution is to use GNU make. Otherwise, simply remove
all mention of "[$(EXEEXT)" from src/Makefile.
**********************
Running tests as root:
----------------------
@@ -95,7 +150,7 @@ I find that it is best to unpack and build as a non-privileged
user, and then to run the following command as that user in order
to run the privilege-requiring tests:
sudo env NON_ROOT_USERNAME=$USER make -k check
sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
If you can run the tests as root, please do so and report any
problems. We get much less test coverage in that mode, and it's
@@ -109,22 +164,22 @@ Reporting bugs:
IMPORTANT: if you take the time to report a test failure,
please be sure to include the output of running `make check'
in verbose mode for each each failing test. For example,
if the test that fails is tests/mv/hard-link-1, then you
would run this command:
in verbose mode for each failing test. For example,
if the test that fails is tests/misc/df, then you would
run this command:
env VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1
(cd tests && make check TESTS=misc/df VERBOSE=yes) >> log 2>&1
For some tests, you can get even more detail by including
DEBUG=yes in the environment:
For some tests, you can get even more detail by adding DEBUG=yes.
Then include the contents of the file `log' in your bug report.
env DEBUG=yes VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1
and then include the contents of the file `log' in your bug report.
Send bug reports, questions, comments, etc. to bug-coreutils@gnu.org.
If you would like to suggest a patch, see the files README-hacking
and HACKING for tips.
***************************************
There are pretty many tests, but nowhere near as many as we need.
There are many tests, but nowhere near as many as we need.
Additions and corrections are very welcome.
If you see a problem that you've already reported, feel free to re-report
@@ -134,14 +189,13 @@ If you sent a complete patch and, after a couple weeks you haven't
received any acknowledgement, please ping us. A complete patch includes
a well-written ChangeLog entry, unified (diff -u format) diffs relative
to the most recent test release (or, better, relative to the latest
sources in the CVS repository), an explanation for why the patch is
sources in the public repository), an explanation for why the patch is
necessary or useful, and if at all possible, enough information to
reproduce whatever problem prompted it. Plus, you'll earn lots of
karma if you include a test case to exercise any bug(s) you fix.
Instructions for checking out the latest source via CVS are here:
http://savannah.gnu.org/cvs/?group=coreutils
Here are instructions for checking out the latest development sources:
http://savannah.gnu.org/git/?group=coreutils
If your patch adds a new feature, please try to get some sort of consensus
that it is a worthwhile change. One way to do that is to send mail to
@@ -150,16 +204,16 @@ as you can. Based on the feedback that generates, you may be able to
convince us that it's worth adding.
WARNING: Now that we use the ./bootstrap script, you should not run
autoreconf manually. Doing that will overwrite essential source files
with older versions, which may make the package unbuildable or introduce
subtle bugs.
WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4,
or any Makefile.am, then don't be surprised if what gets regenerated no
longer works. To make things work, you'll have to be using appropriate
versions of automake and autoconf. As for what versions are `appropriate',
use the versions of
* autoconf specified via AC_PREREQ in m4/jm-macros.m4
* automake specified via AM_INIT_AUTOMAKE in configure.ac
Usually it's fine to use versions that are newer than those specified.
versions of the tools listed in bootstrap.conf's buildreq string.
All of these programs except `test' recognize the `--version' option.
When reporting bugs, please include in the subject line both the package
@@ -171,3 +225,15 @@ http://www.gnu.org/prep/standards_toc.html.
Mail suggestions and bug reports for these programs to
the address on the last line of --help output.
========================================================================
Copyright (C) 1998, 2002-2009 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.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the ``GNU Free
Documentation License'' file as part of this distribution.

66
README-hacking Normal file
View File

@@ -0,0 +1,66 @@
-*- outline -*-
These notes intend to help people working on the checked-out sources.
These requirements do not apply when building from a distribution tarball.
See also HACKING for more detailed coreutils contribution guidelines.
* Requirements
We've opted to keep only the highest-level sources in the GIT repository.
This eases our maintenance burden, (fewer merges etc.), but imposes more
requirements on anyone wishing to build from the just-checked-out sources.
Note the requirements to build the released archive are much less and
are just the requirements of the standard ./configure && make procedure.
Specific development tools and versions will be checked for and listed by
the bootstrap script. See README-prereq for specific notes on obtaining
these prerequisite tools.
Valgrind <http://valgrind.org/> is also highly recommended, if
Valgrind supports your architecture. See also README-valgrind.
While building from a just-cloned source tree may require installing a
few prerequisites, later, a plain `git pull && make' should be sufficient.
* First GIT checkout
You can get a copy of the source repository like this:
$ git clone git://git.sv.gnu.org/coreutils
$ cd coreutils
The next step is to get and check other files needed to build,
which are extracted from other source packages:
$ ./bootstrap
And there you are! Just
$ ./configure #[--enable-gcc-warnings]
$ make
$ make check
At this point, there should be no difference between your local copy,
and the GIT master copy:
$ git diff
should output no difference.
Enjoy!
-----
Copyright (C) 2002-2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.

View File

@@ -1,6 +1,9 @@
As of 2002-09-01, the GNU fileutils, textutils, and sh-utils
packages have been merged into one, called the GNU coreutils.
See http://www.gnu.org/software/coreutils/ for a description.
Here's the FAQ list:
http://www.gnu.org/software/coreutils/faq/
For information on the mailing lists associated with the
coreutils package, see these:
@@ -10,4 +13,6 @@ coreutils package, see these:
mailing list archives are here:
http://mail.gnu.org/pipermail/bug-coreutils/
http://news.gmane.org/gmane.comp.gnu.coreutils.announce
http://news.gmane.org/gmane.comp.gnu.core-utils.bugs (up to the minute)
http://mail.gnu.org/pipermail/bug-coreutils/ (updated every 12 hours)

56
README-prereq Normal file
View File

@@ -0,0 +1,56 @@
This gives some notes on obtaining the tools required for development.
I.E. the tools checked for by the bootstrap script and include:
- Autoconf <http://www.gnu.org/software/autoconf/>
- Automake <http://www.gnu.org/software/automake/>
- Bison <http://www.gnu.org/software/bison/>
- Gettext <http://www.gnu.org/software/gettext/>
- Git <http://git.or.cz/>
- Gperf <http://www.gnu.org/software/gperf/>
- Gzip <http://www.gnu.org/software/gzip/>
- Perl <http://www.cpan.org/>
- Rsync <http://samba.anu.edu.au/rsync/>
- Tar <http://www.gnu.org/software/tar/>
- Texinfo <http://www.gnu.org/software/texinfo/>
Note please try to install/build official packages for your system.
If these are not available then one can make them available only to
the coreutils build using the following instructions. Even if the
official packages for your system are too old, please install them
as they may be required to build the newer versions.
* autoconf *
# Note Autoconf 2.62 or newer is needed to build automake-1.11
git clone --depth=1 git://git.sv.gnu.org/autoconf.git
git checkout v2.62
autoreconf -vi
./configure --prefix=$HOME/coreutils/deps
make install
* automake *
# Note help2man is required to build automake fully
git clone git://git.sv.gnu.org/automake.git
cd automake
git checkout -b branch-1.11 --track origin/branch-1.11
./bootstrap
./configure --prefix=$HOME/coreutils/deps
make install
coreutils uses XZ utils (successor to LZMA) to create
a compressed distribution tarball. Using this feature of Automake
requires version 1.10a or newer, as well as the xz program itself.
* xz *
git clone git://ctrl.tukaani.org/xz.git
cd xz
./autogen.sh
./configure --prefix=$HOME/coreutils/deps
make install
Now we can build coreutils as described in README-hacking
as long as $PATH starts with $HOME/coreutils/deps/bin, which
one can set for the current shell like:
$ export PATH=$HOME/coreutils/deps/bin:$PATH

97
README-release Normal file
View File

@@ -0,0 +1,97 @@
Here are most of the steps we (maintainers) follow when making a release.
* start from a clean, up-to-date git directory.
git checkout master; git pull
* Run ./configure && make maintainer-clean
* Ensure that the desired versions of autoconf, automake, bison, etc.
are in your PATH. See the buildreq list in bootstrap.conf for
the complete list.
* Ensure that you're on "master" with no uncommitted diffs.
This should produce no output: git checkout master; git diff
* Run bootstrap: ./bootstrap
FIXME: enable excluded programs like arch? to get their manual pages?
* Pre-release testing:
Ensure that make check syntax-check succeeds.
On at least one SELinux-enabled (enforcing) and one non-SELinux system,
run all tests, both root-only and regular.
Run *all* non-root tests, including expensive and very expensive ones i.e.,
run this: make -j1 check RUN_VERY_EXPENSIVE_TESTS=yes RUN_EXPENSIVE_TESTS=yes
Run the root-only tests:
sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
* Run "make distcheck"
* Manually set the date, version number, and [stable/alpha/beta] on
line 3 of NEWS, then do e.g.,:
v=8.0
pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile)
git commit -F <(printf 'version '$v'\n\n* NEWS: Record release date.\n') -a
git tag -s -m "$pkg $v" v$v HEAD
* Run the following to create release tarballs. Your choice selects the
corresponding upload-to destination in the emitted gnupload command.
The different destinations are specified in cfg.mk. See the definitions
of gnu_ftp_host-{alpha,beta,stable}.
# "TYPE" must be stable, beta or alpha
make TYPE
* Test the tarball. copy it to a few odd-ball systems and ensure that
it builds and passes all tests.
* While that's happening, write the release announcement that you will
soon post.
Once all the builds and tests have passed,
* Run the gnupload command that was suggested by your "make major" run above.
* Wait a few minutes (maybe up to 30?) and then use the release URLs to
download all tarball/signature pairs and use gpg --verify to ensure
that they're all valid.
* Push the new tag:
v=$(cat .prev-version)
git push origin tag v$v
* Send the gpg-signed announcement mail, e.g.,
To: info-gnu@gnu.org, coreutils-announce@gnu.org
Cc: coordinator@translationproject.org, bug-coreutils@gnu.org
Subject: coreutils-8.0 released [beta]
* Approve the announcement here:
http://lists.gnu.org/mailman/admindb/coreutils-announce
* Announce it on Savannah, too:
From here:
https://savannah.gnu.org/projects/coreutils/
click on the "submit news", then write something like the following:
(If there is no such button, then enable "News" for the project via
the Main -> "Select Features" menu item, or via this link:
https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=gzip)
Subject: coreutils-0.0 released [beta]
The announcement is here:
http://article.gmane.org/gmane.comp.gnu.core-utils.announce/54
Then go here to approve it:
https://savannah.gnu.org/news/approve.php?group=coreutils
* After each non-alpha release, update the on-line manual accessible via
http://www.gnu.org/software/coreutils/manual/
by running this:
build-aux/gnu-web-doc-update

View File

@@ -1,4 +1,20 @@
#! /bin/bash
# Convert this package for use with valgrind.
# Copyright (C) 2002-2006, 2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
# Convert Makefile.am files:
# find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
@@ -7,7 +23,7 @@
# find tests -name Makefile.am|xargs grep -wl PATH|xargs perl -pi -e 's,src/vg,src,'
#
# Create this symlink for suppressions (this is no longer necessary,
# with linux-2.6.9 and valgrind-2.2.0):
# with Linux kernel 2.6.9 and valgrind-2.2.0):
# ln -s $PWD/.vg-suppressions /tmp/cu-vg
# Create src/vg:
@@ -16,13 +32,13 @@ coreutils=$(echo 'spy:;@echo $(all_programs)' | (cd src; make -f Makefile -f - s
mkdir -p src/vg
pwd=`pwd`
srcdir=$pwd/src
path='export PATH='$srcdir':${PATH#*:}'
pre='#!/bin/sh\n'"$path"'\n'
n=9
vg='exec /usr/bin/valgrind --log-fd=3 --leak-check=yes --track-fds=yes --quiet --num-callers='$n
_path='export PATH='$srcdir':${PATH#*:}'
pre='#!/bin/sh\n'"$_path"'\n'
n=15
vg='exec /usr/bin/valgrind --suppressions=/tmp/cu-vg --log-fd=3 --leak-check=yes --track-fds=yes --leak-check=full --num-callers='$n
cat <<EOF > src/vg/gen
for i in $coreutils; do
printf "$pre$vg \$i"' "\$@"\n' > \$i
printf "$pre$vg -- \$i"' "\$@"\n' > \$i
chmod a+x \$i
done
EOF

144
THANKS
View File

@@ -8,9 +8,12 @@ the bug-report mailing list (as seen on last line of e.g., cp --help).
??? kytek@cybercomm.net
A Costa agcosta@gis.net
Aaron Hawley ashawley@uvm.edu
Achim Blumensath blume@corona.oche.de
Adam Jimerson vendion@charter.net
Adam Klein aklein@debian.org
Adrian Bunk bunk@stusta.de
AIDA Shinra shinra@j10n.org
Akim Demaille demaille@inf.enst.fr
Alain Magloire alain@qnx.com
Alan Iwi iwi@atm.ox.ac.uk
@@ -19,20 +22,26 @@ Albert Hopkins ahopkins@dynacare.com
Alberto Accomazzi alberto@cfa0.harvard.edu
aldomel aldomel@ix.netcom.com
Alen Muzinic zveki@fly.cc.fer.hr
Alexander Nguyen vinh@seas.ucla.edu
Alexander V. Lukyanov lav@netis.ru
Allen Hewes allen@decisiv.net
Axel Dörfler axeld@pinc-software.de
Alexandre Duret-Lutz duret_g@epita.fr
Alexey Solovyov alekso@math.uu.se
Alexey Vyskubov alexey@pippuri.mawhrin.net
Alfred M. Szmidt ams@kemisten.nu
Andi Kleen freitag@alancoxonachip.com
Andre Novaes Cunha Andre.Cunha@br.global-one.net
Andreas Frische andreasfrische@gmail.com
Andreas Gruenbacher ag@bestbits.at
Andreas Jaeger jaeger@gnu.org
Andreas Luik luik@isa.de
Andreas Schwab schwab@suse.de
Andreas Schwab schwab@linux-m68k.org
Andreas Stolcke stolcke@ICSI.Berkeley.EDU
Andrei Gaponenko andr@triumf.ca
Andres Soolo andres@soolo.matti.ee
Andrew Burgess aab@cichlid.com
Andrew Church achurch@achurch.org
Andrew Dalke dalke@bioreason.com
Andrew Fabbro andrew@fabbro.org
Andrew Pham andpha@us.ibm.com
@@ -50,13 +59,16 @@ Arthur Pool pool@commerce.uq.edu.au
Arun Sharma arun.sharma@intel.com
Arvind Autar Autar022@planet.nl
Augey Mikus mikus@dqc.org
Aurelien Jarno aurel32@debian.org
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
Axel Kittenberger Anshil@gmx.net
Barry Kelly http://barrkel.blogspot.com/
Bauke Jan Douma bjdouma@xs4all.nl
Ben Elliston bje@air.net.au
Ben Harris bjh21@netbsd.org
Benjamin Cutler cutlerbc@simla.colostate.edu
Bengt Martensson bengt@mathematik.uni-Bremen.de
Benjamin Cutler cutlerbc@simla.colostate.edu
Benno Schulenberg bensberg@justemail.net
Bernard Giroud bernard.giroud@creditlyonnais.ch
Bernd Eckenfels ecki@debian.org
Bernd Leibing bernd.leibing@rz.uni-ulm.de
@@ -64,7 +76,10 @@ Bernd Melchers melchers@cis.fu-berlin.de
Bernhard Baehr bernhard.baehr@gmx.de
Bernhard Gabler bernhard@uni-koblenz.de
Bernhard Rosenkraenzer bero@redhat.de
Bernhard Voelker bernhard.voelker@siemens-enterprise.com
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bert Wesarg bert.wesarg@googlemail.com
Bill Brelsford wb@k2di.net
Bill Peters peters@gaffel.as.arizona.edu
Bjorn Helgaas helgaas@rsn.hp.com
Bob McCracken kerouac@ravenet.com
@@ -72,12 +87,16 @@ Bob Proulx rwp@fc.hp.com
Branden Robinson branden@necrotic.deadbeast.net
Brendan O'Dea bod@compusol.com.au
Brian Kimball bfk@footbag.org
Brian M. Carlson sandals@crustytoothpaste.ath.cx
Brian Silverman bsilverman@conceptxdesign.com
Brian Youmans 3diff@gnu.org
Bruce Korb bkorb@veritas.com
Bruce Robertson brucer@theodolite.dyndns.org
Bruno Haible haible@clisp.cons.org
C de-Avillez hggdh2@gmail.com
Carl Johnson carlj@cjlinux.home.org
Carl Lowenstein cdl@mpl.UCSD.EDU
Carl Roth roth@urs.us
Carlos Canau Carlos.Canau@relay.puug.pt
Charles Karney karney@pppl.gov
Charles Randall crandall@matchlogic.com
@@ -92,31 +111,44 @@ 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
Christophe LYON christophe.lyon@st.com
Chuck Hedrick hedrick@klinzhai.rutgers.edu
Clark Morgan cmorgan@aracnet.com
Clement Wang clem.wang@overture.com
Cliff Miller cbm@whatexit.org
Colin Plumb colin@nyx.net
Colin Watson cjw44@riva.ucam.org
Collin Rogowski collin@rogowski.de
Cray-Cyber Project http://www.cray-cyber.org
Cristian Cadar cristic@stanford.edu
Cyril Bouthors cyril@bouthors.org
Dale Scheetz dwarf@polaris.net
Dameon G. Rogers dgr03@uark.edu
Dan Hagerty hag@gnu.ai.it.edu
Dan Jacobson http://www.geocities.com/jidani
Dan Jacobson jidanni@jidanni.org
Dan Pascu dan@services.iiruc.ro
Daniel Bergstrom noa@melody.se
Daniel Dunbar ddunbar@stanford.edu
Daniel P. Berrangé berrange@redhat.com
Dániel Varga danielv@axelero.hu
Danny Levinson danny.levinson@overture.com
Darrel Francis d.francis@cheerful.com
Darren Salt ds@youmustbejoking.demon.co.uk
Dave Beckett dajobe@dajobe.org
David Alan Gilbert gilbertd@treblig.org
David Bartley dtbartle@csclub.uwaterloo.ca
David Dyck dcd@tc.fluke.COM
David Eisner cradle@umd.edu
David Flynn dav@chess.plus.com
David Godfrey dave@delta.demon.co.uk
David Luyer david_luyer@pacific.net.au
David Madore david.madore@ens.fr
David Malone dwmalone@cnri.dit.ie
Davide Canova kc.canova@gmail.com
Dawson Engler engler@stanford.edu
Dean Gaudet dean-savannah@arctic.org
Deepak Goel deego@gnufans.org
Denis Excoffier denis.excoffier@airbus.com
Dennis Henriksen opus@flamingo.osrl.dk
Dennis Smit ds@nerds-incorporated.org
Derek Clegg dclegg@next.com
@@ -134,10 +166,14 @@ Duncan Roe duncanr@optimation.com.au
Ed Avis ed@membled.com
Edward Welbourne eddy@opera.com
Edzer Pebesma Edzer.Pebesma@rivm.nl
Egmont Koblinger egmont@uhulinux.hu
Eirik Fuller eirik@hackrat.com
Eivind eivindt@multinet.no
Elbert Pol elbert.pol@gmail.com
Eli Zaretskii eliz@is.elta.co.il
Elias Pipping pipping@gentoo.org
Emile LeBlanc leblanc@math.toronto.edu
Erik Auerswald auerswal@unix-ag.uni-kl.de
Eric Backus ericb@lsid.hp.com
Eric Blake ebb9@byu.net
Eric G. Miller egm2@jps.net
@@ -145,10 +181,15 @@ Eric Pemente pemente@northpark.edu
Eric S. Raymond esr@snark.thyrsus.com
Erik Bennett bennett@cvo.oneworld.com
Erik Corry erik@kroete2.freinet.de
Evan Hunt ethanol@armory.com
Felix Lee flee@teleport.com
Felix Rauch Valenti frauch@cse.unsw.edu.au
Ferdinand fw@scenic.mine.nu
Fletcher Mattox fletcher@cs.utexas.edu
Florent Bayle florent@sarcelle.net
Florian Schlichting fschlich@cis.fu-berlin.de
Florin Iucha fiucha@hsys.mic.ro
Francesco Montorsi fr_m@hotmail.com
François Pinard pinard@iro.umontreal.ca
Frank Adler fadler@allesklar.de
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
@@ -159,24 +200,29 @@ Gabor Z. Papp gzp@gzp.org.hu
Gaël Quéri gqueri@mail.dotcom.fr
Galen Hazelwood galenh@micron.net
Gary Anderson ganderson@clark.net
Gary Johnson garyjohn@spk.agilent.com
Gary V. Vaughan gary@gnu.org
Gaute Hvoslef Kvalnes gaute@verdsveven.com
Geoff Collyer geoff at collyer.net
Geoff Kuenning geoff@cs.hmc.edu
Geoff Odhner geoff@franklin.com
Geoff Whale geoffw@cse.unsw.EDU.AU
Gerald Pfeifer gerald@pfeifer.com
Gerhard Poul gpoul@gnu.org
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
Göran Uddeborg goeran@uddeborg.pp.se
Glen Lenker glen.lenker@gmail.com
Göran Uddeborg goeran@uddeborg.se
Guochun Shi gshi@ncsa.uiuc.edu
GOTO Masanori gotom@debian.or.jp
Greg Louis glouis@dynamicro.on.ca
Greg McGary gkm@gnu.org
Greg Metcalfe metcalfegreg@qwest.net
Greg Schafer gschafer@zip.com.au
Greg Troxel gdt@bbn.com
Greg Wooledge gawooledge@sherwin.com
Gregory Leblanc gleblanc@cu-portland.edu
Guido Leenders guido.leenders@invantive.com
Guntram Blohm Extern.Guntram.Blohm@AUDI.DE
H. J. Lu hjl@valinux.com
Hans Ginzel hans@matfyz.cz
Hans Lermen lermen@fgan.de
@@ -184,34 +230,48 @@ Hans Verkuil hans@wyst.hobby.nl
Harald Dunkel harald.dunkel@t-online.de
Harry Liu rliu@lek.ugcs.caltech.edu
Harti Brandt brandt@fokus.fraunhofer.de
Harvey Eneman Harvey.Eneman@oracle.com
Heiko Marr h.marr@webmasters.de
Helen Faulkner helen_ml_faulkner@yahoo.co.uk
Herbert Xu herbert@gondor.apana.org.au
Holger Berger hberger@ess.nec.de
Hon-Yin Kok hkok@yoda.unl.edu
Hugh Daniel hugh@xanadu.com
Ian Bruce ian.bruce@myrealbox.com
Iain Calder ic56@rogers.com
Ian Jackson ijackson@chiark.greenend.org.uk
Ian Kent ikent@redhat.com
Ian Lance Taylor ian@cygnus.com
Ian Turner vectro@pipeline.com
Iida Yosiaki iida@gnu.org
Ilya N. Golubev gin@mo.msk.ru
Ingo Saitz ingo@debian.org
Ivo Timmermans ivo@debian.org
James james@albion.glarp.com
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Lemley James.Lemley@acxiom.com
James Hunt jamesodhunt@hotmail.com
James Ralston ralston@pobox.com
James R. Van Zandt jrvz@comcast.net
James Sneeringer jvs@ocslink.com
James Tanis jtt@soscorp.com
James Youngman james+usenet@free-lunch.demon.co.uk
James Youngman jay@gnu.org
Jamie Lokier jamie@imbolc.ucc.ie
Jamie McClelland jm@mayfirst.org
Jan Engelhardt jengelh@medozas.de
Jan Fedak J.Fedak@sh.cvut.cz
Jan Moringen jan.moringen@uni-bielefeld.de
Jan Nieuwenhuizen janneke@gnu.org
Janos Farkas chexum@shadow.banki.hu
Jarkko Hietaniemi jhi@epsilon.hut.fi
Jarod Wilson jwilson@redhat.com
Jean Charles Delepine delepine@u-picardie.fr
Jeff Moore jbm@mordor.com
Jeff Sheinberg jeff@bsrd.net
Jens Elkner elkner@imsgroup.de
Jens Schmidt jms@jsds.hamburg.com
Jeph Cowan jeph@ucar.edu
Jeremy Maitin-Shepard jbms@cmu.edu
Jerome Abela abela@hsc.fr
Jérôme Zago bug-coreutils-ml@agt-the-walker.net
Jesse Kornblum kornblum@usna.edu
@@ -222,6 +282,9 @@ Jim Dennis jimd@starshine.org
Joakim Rosqvist dvljrt@cs.umu.se
Jochen Hein jochen@jochen.org
Joe Orton joe@manyfish.co.uk
Joel E. Denny jdenny@clemson.edu
Joerg Sonnenberger joerg@britannica.bec.de
Joey Hess joeyh@debian.org
Johan Boule bohan@bohan.dyndns.org
Johan Danielsson joda@pdc.kth.se
John Bley jbb6@acpub.duke.edu
@@ -238,8 +301,12 @@ Jon Peatfield J.S.Peatfield@damtp.cam.ac.uk
Joost van Baal joostvb@xs4all.nl
Jorge Stolfi stolfi@ic.unicamp.br
Joseph S. Myers jsm28@cam.ac.uk
Josh Triplett josh@freedesktop.org
Joshua Hudson joshudson@gmail.com
Josselin Mouette joss@debian.org
Juan F. Codagnone juam@arnet.com.ar
Juan M. Guerrero st001906@hrz1.hrz.tu-darmstadt.de
Julian Bradfield jcb@inf.ed.ac.uk
Jungshik Shin jshin@pantheon.yale.edu
Jürgen Fluk louis@dachau.marco.de
Jurriaan thunder7@xs4all.nl
@@ -259,6 +326,7 @@ Keith Owens kaos@audio.apana.org.au
Keith Thompson kst@cts.com
Ken Pizzini kenp@halcyon.com
Kevin Mudrick kmudrick@healthmarketscience.com
Kirk Kelsey kirk.kelsey@0x4b.net
Kristin E Thomas kristint@us.ibm.com
Kjetil Torgrim Homme kjetilho@ifi.uio.no
Kristoffer Rose kris@diku.dk
@@ -268,6 +336,7 @@ Leah Q eequor@earthlink.net
Lehti Rami rammer@cs.tut.fi
Leonard N. Zubkoff lnz@dandelion.com
Leonardo Milano lmilano@udel.edu
Lluís Batlle viriketo@gmail.com
Lorne Baker lbaker@nitro.avint.net
Luke Hassell lukehassell@yahoo.com
Luke Kendall lukekendall@optushome.com.au
@@ -277,6 +346,7 @@ Manas Garg manas@cygsoft.com
Manfred Hollstein manfred@s-direktnet.de
Marc Boucher marc@mbsi.ca
Marc Haber mh+debian-bugs@zugschlus.de
Marc Lehman schmorp@schmorp.de
Marc Olzheim marcolz@stack.nl
Marco Franzen Marco.Franzen@Thyron.com
Marcus Brinkmann http://www.marcus-brinkmann.de
@@ -305,19 +375,25 @@ Marty Leisner leisner@sdsp.mc.xerox.com
Masami Takikawa takikawm@CS.ORST.EDU
Mate Wierdl mw@moni.msci.memphis.edu
Matej Vela mvela@public.srce.hr
Matias A. Fonzo selk@dragora.org
Matt Kraai kraai@ftbfs.org
Matt Perry matt@primefactor.com
Matt Pham mattvpham@gmail.com
Matt Schalit mschalit@pacbell.net
Matt Swift swift@alum.mit.edu
Matthew Arnison maffew@cat.org.au
Matthew M. Boedicker matthewm@boedicker.org
Matthew Braun matthew@ans.net
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
Matthew S. Levine mslevine@theory.lcs.mit.edu
Matthew Smith matts@bluesguitar.org
Matthew Swift swift@alum.mit.edu
Matthew Woehlke mw_triad@users.sourceforge.net
Matthias Urlichs smurf@noris.de
Matti Aarnio matti.aarnio@zmailer.org
Mathias Brodala info@noctus.net
Mattias Wadenstein maswan@acc.umu.se
Max Chang maxchang@ucla.edu
Meelis Roos mroos@tartu.cyber.ee
Michael michael@aplatform.com
Michael ??? michael@roka.net
@@ -329,7 +405,9 @@ Michael Hasselberg mikelh@zonta.ping.de
Michael Hohn hohn@math.utah.edu
Michael J. Croghan mcroghan@usatoday.com
Michael McFarland sidlon@yahoo.com
Michael McLagan mmclagan@invlogic.com
Michael Piefel piefel@informatik.hu-berlin.de
Michael Speer knomenet@gmail.com
Michael Steffens michael.steffens@s.netic.de
Michael Stone mstone@debian.org
Michael Stutz stutz@dsl.org
@@ -340,6 +418,7 @@ Michal Politowski mpol@charybda.icm.edu.pl
Michal Svec msvec@suse.cz
Michel Robitaille robitail@IRO.UMontreal.CA
Michiel Bacchiani bacchian@raven.bu.edu
Mikael Magnusson mikachu@gmail.com
Mike Castle dalgoda@ix.netcom.com
Mike Coleman mkc@mathdogs.com
Mike Jetzer mjetzer@mke.catalystwms.com
@@ -353,9 +432,13 @@ Neal H Walfield neal@cs.uml.edu
Neil Brown neilb@cse.unsw.edu.au
Nelson H. F. Beebe beebe@math.utah.edu
Nick Estes debian@nickstoys.com
Nick Graham nick.d.graham@gmail.com
Nick Lawes nlawes@silverplatter.com
Nickolai Zeldovich nickolai@cs.stanford.edu
Nicolas François nicolas.francois@centraliens.net
Niklas Edmundsson nikke@acc.umu.se
Nikola Milutinovic Nikola.Milutinovic@ev.co.yu
Nima Nikzad nnikzad@ucla.edu
Noah Friedman friedman@splode.com
Noel Cragg noel@red-bean.com
Norbert Kiesel nkiesel@tbdnetworks.com
@@ -363,38 +446,55 @@ Olatunji Oluwabukunmi Ruwase tjruwase@stanford.edu
Olav Morkrid olav@funcom.com
Ole Laursen olau@hardworking.dk
Oliver Kiddle okiddle@yahoo.co.uk
Olivier Fourdan ofourdan@redhat.com
Ørn E. Hansen oehansen@daimi.aau.dk
Oskar Liljeblad osk@hem.passagen.se
Otavio Salvador otavio@ossystems.com.br
Pádraig Brady P@draigBrady.com
Patrick Mauritz oxygene@studentenbude.ath.cx
Paul D. Smith psmith@gnu.org
Paul Eggert eggert@twinsun.com
Paul Ghaleb paul.ghaleb@st.com
Paul Jarc prj@po.cwru.edu
Paul Nevai nevai@ops.mps.ohio-state.edu
Paul Sauer paul@alexa.com
Paul Slootman paul@debian.org
Paul Townsend aab@purdue.edu
Paul Worrall paul@basilisk.uklinux.net
Pawel Prokop pablo@wizard.ae.krakow.pl
Per Cederqvist ceder@lysator.liu.se
Per Kristian Hove perhov@math.ntnu.no
Per Starbäck starback@stp.lingfil.uu.se
Peter Breitenlohner peb@mppmu.mpg.de
Peter Dyballa peter_dyballa@web.de
Peter Eriksson peter@ifm.liu.se
Peter Fales psfales@lucent.com
Peter Horst peter@ointment.org
Peter Moulder reiter@netspace.net.au
Peter O'Gorman bug-coreutils@mlists.thewrittenword.com
Peter Samuelson psamuels@sampo.creighton.edu
Peter Seebach seebs@taniemarie.solon.com
Petr Uzel petr.uzel@suse.cz
Petter Reinholdtsen pere@hungry.com
Phelippe Neveu pneveu@pcigeomatics.com
Phil Richards phil.richards@vf.vodafone.co.uk
Philip Rowlands phr@doc.ic.ac.uk
Philippe De Muyter phdm@macqel.be
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
Phillip Jones mouse@datastacks.com
Piergiorgio Sartor sartor@sony.de
Pieter Bowman bowman@math.utah.edu
Piotr Kwapulinski kwap@univ.gda.pl
Prashant TR tr@eth.net
Priit Jõerüüt jemm4jemm@yahoo.com
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Ralf W. Stephan stephan@tmt.de
Ralf Wildenhues Ralf.Wildenhues@gmx.de
Ralph Loader loader@maths.ox.ac.uk
Raul Miller moth@magenta.com
Raúl Núñez de Arenas Coronado raul@pleyades.net
Reuben Thomas rrt@sc3d.org
Yang Ren ryang@redhat.com
Richard A Downing richard.downing@bcs.org.uk
Richard Braakman dark@xs4all.nl
Richard Dawe rich@phekda.freeserve.co.uk
@@ -414,61 +514,87 @@ Ronald F. Guilmette rfg@netcom.com
Ross Alexander r.alexander@auckland.ac.nz
Ross Paterson rap@doc.ic.ac.uk
Ross Ridge rridge@calum.csclub.uwaterloo.ca
Rudolf Kastl rkastl@redhat.com
Sahil Amoli sahilamoli@gmail.com
Sami Farin sfarin@ratol.fi
Samuel Tardieu sam@rfc1149.net
Samuel Thibault samuel.thibault@ens-lyon.org
Samuli Karkkainen Samuli.Karkkainen@hut.fi
Sander van Malssen svm@kozmix.ow.nl
Santiago Vila Doncel sanvila@unex.es
Savochkin Andrey Vladimirovich saw@msu.ru
Scott Lurndal slurn@griffin.engr.sgi.com
Sébastien Maret smaret@umich.edu
Sébastien Maret smaret@umich.edu
Sergei Steshenko sergstesh@yahoo.com
Shing-Shong Shei shei@cs.indiana.edu
Soeren Sonnenburg sonnenburg@informatik.hu-berlin.de
Solar Designer solar@owl.openwall.com
Stanislav Ievlev inger@altlinux.ru
Stavros Passas stabat@ics.forth.gr
Stéphane Chazelas Stephane_CHAZELAS@yahoo.fr
Stephen Depooter sbdep@myrealbox.com
Stephen Eglen eglen@pcg.wustl.edu
Stephen Gildea gildea@stop.mail-abuse.org
Stephen Smoogen smooge@mindspring.com
Steve McConnel steve@acadcomp.sil.org
Steve McIntyre steve@einval.com
Steve Ward planet36@gmail.com
Steven G. Johnson stevenj@alum.mit.edu
Steven Mocking ufo@quicknet.nl
Steven Parkes smparkes@smparkes.net
Steven Schveighoffer schveiguy@yahoo.com
Steven P Watson steven@magelico.net
Stuart Kemp skemp@peter.bmc.com
Stuart Shelton stuart@shelton.me
Sven Joachim svenjoac@gmx.de
Szakacsits Szabolcs szaka@sienet.hu
Tadayoshi Funaba tadf@kt.rim.or.jp
TAKAI Kousuke takai@vlsi.kuee.kyoto-u.ac.jp
Theodore Ts'o tytso@rsts-11.mit.edu
The Wanderer inverseparadox@comcast.net
Theodoros V. Kalamatianos nyb@users.sourceforge.net
Thomas Bushnell thomas@gnu.ai.mit.edu
Thomas Goerlich thomas@schnappmatik.de
Thomas Hood jdthood@yahoo.co.uk
Thomas Luzat thomas@luzat.com
Thomas M.Ott thmo-13@gmx.de
Thomas Quinot thomas@Cuivre.FR.EU.ORG
Thomas Schwinge tschwinge@gnu.org
Thomas Wolff mined@towo.net
Tim J. Robbins tjr@FreeBSD.org
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Tim Ryan Tim_Ryan@bnz.co.nz
Tim Smithers mouse@dmouse.com.au
Tim Waugh twaugh@redhat
Tobias Stoeckmann tobias@bugol.de
Toby Peterson toby@opendarwin.org
Todd A. Jacobs tjacobs@codegnome.org
Tom Fitzhenry tom@tom-fitzhenry.me.uk
Tom Haynes thomas@netapp.com
Tom Quinn trq@dionysos.thphys.ox.ac.uk
Tomas Pospisek tpo@sourcepole.ch
Tommi Kyntola tkyntola@cc.hut.fi
Ton Hospel thospel@mail.dma.be
Ton Nijkes ton@murphy.nl
Tony Kocurko akocurko@mun.ca
Tony Leneis tony@plaza.ds.adp.com
Tony Robinson ajr@eng.cam.ac.uk
Toralf Förster toralf.foerster@gmx.de
Torbjorn Granlund tege@nada.kth.se
Torbjorn Lindgren tl@funcom.no
Torsten Landschoff torsten@pclab.ifg.uni-kiel.de
Tristan Miller psychonaut@nothingisreal.com
Tzvi Rotshtein tzvi.ro@gmail.com
Ulrich Drepper drepper@gnu.org
Ulrich Hermisson ulrich_hermisson@hotmail.com
Urs Thuermann urs@isnogud.escape.de
Uwe H. Steinfeld usteinfeld@gmx.net
Vesselin Atanasov vesselin@bgnet.bg
Vin Shelton acs@alumni.princeton.edu
Vineet Chadha chadha@acis.ufl.edu
Vitali Lovich vlovich@gmail.com
Vitaly A. Ostanin vyt@altlinux.org
Vito Caputo vcaputo@pengaru.com
Vlada Macek tuttle@bbs.fsik.cvut.cz
Volker Borchert bt@teknon.de
Volker Paul vpaul@dohle.com
@@ -482,8 +608,14 @@ William Bader william@nscs.fast.net
William Dowling will@franklin.com
William Lewis wiml@omnigroup.com
wiregauze wiregauze@yahoo.com
Wis Macomson wis.macomson@intel.com
Wojciech Purczynski cliph@isec.pl
Wolfram Kleff kleff@cs.uni-bonn.de
Won-kyu Park wkpark@chem.skku.ac.kr
Yanko Kaneti yaneti@declera.com
Yann Dirson dirson@debian.org
Zvi Har'El rl@math.technion.ac.il
;; Local Variables:
;; coding: utf-8
;; End:

182
TODO
View File

@@ -1,16 +1,48 @@
restore djgpp, eventually
merge TODO lists
add unit tests for lib/*.c
If you're interested in helping, here are some tasks that we've considered
over the years. Beware: some are quite old and no longer valid. To avoid
wasting your time by duplicating work or by working on a task that is no
longer pertinent, please search the mailing list and post your intent
before embarking on a big project.
strip: add an option to specify the program used to strip binaries.
suggestion from Karl Berry
==================================================
Modify chmod so that it does not change an inode's st_ctime
when the selected operation would have no other effect.
First suggested by Hans Ecke <http://hans.ecke.ws> in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/2920
Discussed more recently on <http://bugs.debian.org/497514>.
document the following in coreutils.texi:
mktemp
[
pinky
Suggestion from Paul Eggert:
More generally, there's not that much use for imaxtostr nowadays,
since the inttypes module and newer versions of gettext allow things
like _("truncating %s at %" PRIdMAX " bytes") to work portably.
I suspect that (if someone cares to take the time) we can remove
all instances of imaxtostr and umaxtostr in coreutils and gnulib.
cp --recursive: use fts and *at functions to perform directory traversals
in source and destination hierarchy rather than forming full file names.
The latter (current) approach fails unnecessarily when the names
become very long, and requires space and time that is quadratic in the
depth of the hierarchy. [Bo Borgerson is working on this]
printf:
Now that gnulib supports *printf("%a"), import one of the
*printf-posix modules so that printf(1) will support %a even on
platforms where the native *printf(3) is deficient.
Suggestion from Eric Blake.
renice: POSIX utility, needs implementing.
suggestion from Karl Berry (among others).
Bob Proulx is working on this.
doc/coreutils.texi:
Address this comment: FIXME: mv's behavior in this case is system-dependent
Better still: fix the code so it's *not* system-dependent.
implement --target-directory=DIR for install (per texinfo documentation)
ls: add --format=FORMAT option that controls how each line is printed.
cp --no-preserve=X should not attempt to preserve attribute X
@@ -21,13 +53,6 @@ And once that's done, add an exclusion so that `cp --link'
no longer incurs the overhead of saving src. dev/ino and dest. filename
in the hash table.
See if we can be consistent about where --verbose sends its output:
These all send --verbose output to stdout:
head, tail, rm, cp, mv, ln, chmod, chown, chgrp, install, ln
These send it to stderr:
shred mkdir split
readlink is different
Write an autoconf test to work around build failure in HPUX's 64-bit mode.
See notes in README -- and remove them once there's a work-around.
@@ -41,26 +66,9 @@ Should printf '\0123' print "\n3"?
printf: consider adapting builtins/printf.def from bash
df: add `--total' option, suggested here http://bugs.debian.org/186007
seq: give better diagnostics for invalid formats:
e.g. no or too many % directives
seq: consider allowing format string to contain no %-directives
m4: rename all macros that start with AC_ to start with another prefix
resolve RH report on cp -a forwarded by Tim Waugh
Martin Michlmayr's patch to provide ls with `--sort directory' option
tail: don't use xlseek; it *exits*.
Instead, maybe use a macro and return nonzero.
add mktemp? Suggested by Nelson Beebe
df: alignment problem of `Used' heading with e.g., -mP
reported by Karl Berry
tr: support nontrivial equivalence classes, e.g. [=e=] with LC_COLLATE=fr_FR
lib/strftime.c: Since %N is the only format that we need but that
@@ -68,21 +76,6 @@ lib/strftime.c: Since %N is the only format that we need but that
would expand /%(-_)?\d*N/ to the desired string and then pass the
resulting string to glibc's strftime.
sort: Compress temporary files when doing large external sort/merges.
This improves performance when you can compress/uncompress faster than
you can read/write, which is common in these days of fast CPUs.
suggestion from Charles Randall on 2001-08-10
sort: Add an ordering option -R that causes 'sort' to sort according
to a random permutation of the correct sort order. Also, add an
option --random-seed=SEED that causes 'sort' to use an arbitrary
string SEED to select which permutations to use, in a deterministic
manner: that is, if you sort a permutation of the same input file
with the same --random-seed=SEED option twice, you'll get the same
output. The default SEED is chosen at random, and contains enough
information to ensure that the output permutation is random.
suggestion from Feth AREZKI, Stephan Kasal, and Paul Eggert on 2003-07-17
unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html]
printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified.
printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"
@@ -108,11 +101,8 @@ sort: Investigate better sorting algorithms; see Knuth vol. 3.
5.3.1, who credits Lester Ford, Jr. and Selmer Johnson, American
Mathematical Monthly 66 (1959), 387-389.
cp --recursive: perform dir traversals in source and dest hierarchy rather
than forming full file names. The latter (current) approach fails
unnecessarily when the names become very long.
tail --p is now ambiguous
shred: Update shred as described here to conform to DoD 5220 rules:
http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00075.html
Remove suspicious uses of alloca (ones that may allocate more than
about 4k)
@@ -120,19 +110,15 @@ Remove suspicious uses of alloca (ones that may allocate more than
Adapt these contribution guidelines for coreutils:
http://sources.redhat.com/automake/contribute.html
Improve test coverage.
See HACKING for instructions on generating an html test coverage report.
Find a program that has poor coverage and improve.
Changes expected to go in, post-5.2.1:
Changes expected to go in, someday.
======================================
wc: add an option, --files0-from [as for du] to make it read NUL-delimited
file name arguments from a file.
dd patch from Olivier Delhomme
Apply Andreas Gruenbacher's ACL and xattr changes
Apply Bruno Haible's hostname changes
test/mv/*: clean up $other_partition_tmpdir in all cases
ls: when both -l and --dereference-command-line-symlink-to-dir are
@@ -141,80 +127,60 @@ Changes expected to go in, post-5.2.1:
an implicit --NO-dereference-command-line-symlink-to-dir meaning.
Pointed out by Karl Berry.
A more efficient version of factor, and possibly one that
accepts inputs of size 2^64 and larger.
Re-add a separate test for du's stack space usage (like the one removed
from tests/rm/deep-1).
dd: consider adding an option to suppress `bytes/block read/written'
output to stderr. Suggested here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045
Pending copyright papers:
------------------------
ls --color: Ed Avis' patch to suppress escape sequences for
non-highlighted files
getpwnam from Bruce Korb
pb (progress bar) from Miika Pekkarinen
------------------------------
Look into improving the performance of md5sum.
`openssl md5' is consistently about 30% faster than md5sum on an idle
AMD 2000-XP system with plenty of RAM and a 261 MB input file.
openssl's md5 implementation is in assembly, generated by a perl script.
On an AMD-64 system, using a 700MB file on a tmpfs file system
(and enough RAM so that no actual disk reads were performed),
GNU md5sum is slightly faster than `openssl md5', e.g.:
2.38s user 0.38s system 100% cpu 2.756 total (gnu md5sum)
vs.
2.52s user 0.34s system 100% cpu 2.869 total
However, `openssl sha1' is about 5% faster than GNU sha1sum:
3.32s user 0.33s system 99% cpu 3.653 total (openssl sha1)
3.45s user 0.39s system 99% cpu 3.843 total (gnu sha1sum)
The above are using the debian-sid (amd_64 alioth) binaries from
coreutils-5.2.1. When I compile the latest (coreutils-cvs) with
gcc-4.0 -O3, I get slightly (2-3%) better sha1sum performance,
and a ~7% *decrease* in performance for md5sum. I suspect that
with the right compiler options you can do much better.
------------------------------
Have euidaccess.m4 check for eaccess as well as euidaccess
If found, then do `#define euidaccess eaccess'.
Remove long-deprecated options like tail's --allow-missing
Remove long-deprecated options. Search case-insensitive for
`deprecated' and `remove in '. Automate this.
Add a distcheck-time test to ensure that every distributed
file is either read-only(indicating generated) or is
version-controlled and up to date.
Implement Ulrich Drepper's suggestion to use getgrouplist rather
than getugroups. This affects only `id', but makes a big difference
on systems with many users and/or groups, and makes id usable once
again on systems where access restrictions make getugroups fail.
But first we'll need a run-test (either in an autoconf macro or at
run time) to avoid the segfault bug in libc-2.3.2's getgrouplist.
In that case, we'd revert to using a new (to-be-written) getgrouplist
module that does most of what `id' already does.
remove `%s' notation:
remove `%s' notation (now that they're all gone, add a maint.mk sc_
rule to ensure no new ones are added):
grep -E "\`%.{,4}s'" src/*.c
remove.c should never exit, yet may do so (see uses of EXIT_FAILURE)
remove all uses of the `register' keyword: Done. add a maint.mk rule
for this, too.
remove or adjust chown's --changes option, since it
can't always do what it currently says it does.
Support arbitrary-precision arithmetic in those tools for which it
makes sense. Factor and expr already support this via libgmp.
The "test" program is covered via its string-based comparison of
integers. To be converted: seq.
Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be
multibyte aware. The problem is that I want to avoid duplicating
significant blocks of logic, yet I also want to incur only minimal
(preferably `no') cost when operating in single-byte mode.
Remove all uses of the `register' keyword
pr's use of nstrftime can make it malloc a very large (up to SIZE_MAX) buffer
-----
Copyright (C) 2002-2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.

1097
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,399 +0,0 @@
#!/usr/bin/perl -w
# Generate an announcement message.
use strict;
use Getopt::Long;
use Digest::MD5;
use Digest::SHA1;
(my $VERSION = '$Revision: 1.23 $ ') =~ tr/[0-9].//cd;
(my $ME = $0) =~ s|.*/||;
my %valid_release_types = map {$_ => 1} qw (alpha beta major);
END
{
# Nobody ever checks the status of print()s. That's okay, because
# if any do fail, we're guaranteed to get an indicator when we close()
# the filehandle.
#
# Close stdout now, and if there were no errors, return happy status.
# If stdout has already been closed by the script, though, do nothing.
defined fileno STDOUT
or return;
close STDOUT
and return;
# Errors closing stdout. Indicate that, and hope stderr is OK.
warn "$ME: closing standard output: $!\n";
# Don't be so arrogant as to assume that we're the first END handler
# defined, and thus the last one invoked. There may be others yet
# to come. $? will be passed on to them, and to the final _exit().
#
# If it isn't already an error, make it one (and if it _is_ an error,
# preserve the value: it might be important).
$? ||= 1;
}
sub usage ($)
{
my ($exit_code) = @_;
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
if ($exit_code != 0)
{
print $STREAM "Try `$ME --help' for more information.\n";
}
else
{
my @types = sort keys %valid_release_types;
print $STREAM <<EOF;
Usage: $ME [OPTIONS]
OPTIONS:
Generate an announcement message.
FIXME: describe the following
--release-type=TYPE TYPE must be one of @types
--package-name=PACKAGE_NAME
--previous-version=VER
--current-version=VER
--release-archive-directory=DIR
--url-directory=URL_DIR
--news=NEWS_FILE optional
--help display this help and exit
--version output version information and exit
EOF
}
exit $exit_code;
}
=item C<%size> = C<sizes (@file)>
Compute the sizes of the C<@file> and return them as a hash. Return
C<undef> if one of the computation failed.
=cut
sub sizes (@)
{
my (@file) = @_;
my $fail = 0;
my %res;
foreach my $f (@file)
{
my $cmd = "du --human $f";
my $t = `$cmd`;
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
$@
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
chomp $t;
$t =~ s/^([\d.]+[MkK]).*/${1}B/;
$res{$f} = $t;
}
return $fail ? undef : %res;
}
=item C<print_locations ($title, \@url, \%size, @file)
Print a section C<$title> dedicated to the list of <@file>, which
sizes are stored in C<%size>, and which are available from the C<@url>.
=cut
sub print_locations ($\@\%@)
{
my ($title, $url, $size, @file) = @_;
print "Here are the $title:\n";
foreach my $url (@{$url})
{
for my $file (@file)
{
print " $url/$file";
print " (", $$size{$file}, ")"
if exists $$size{$file};
print "\n";
}
}
print "\n";
}
=item C<print_signatures (@file)
Print the MD5 and SHA1 signature section for each C<@file>.
=cut
sub print_signatures (@)
{
my (@file) = @_;
print "Here are the MD5 and SHA1 checksums:\n";
print "\n";
foreach my $meth (qw (md5 sha1))
{
foreach my $f (@file)
{
open IN, '<', $f
or die "$ME: $f: cannot open for reading: $!\n";
binmode IN;
my $dig =
($meth eq 'md5'
? Digest::MD5->new->addfile(*IN)->hexdigest
: Digest::SHA1->new->addfile(*IN)->hexdigest);
close IN;
print "$dig $f\n";
}
}
}
=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
Print the section of the NEWS file C<$news_file> addressing changes
between versions C<$prev_version> and C<$curr_version>.
=cut
sub print_news_deltas ($$$)
{
my ($news_file, $prev_version, $curr_version) = @_;
print "\n$news_file\n\n";
# Print all lines from $news_file, starting with the first one
# that mentions $curr_version up to but not including
# the first occurrence of $prev_version.
my $in_items;
open NEWS, '<', $news_file
or die "$ME: $news_file: cannot open for reading: $!\n";
while (defined (my $line = <NEWS>))
{
if ( ! $in_items)
{
# Match lines like this one:
# * Major changes in release 5.0.1:
# but not any other line that starts with a space, *, or -.
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$curr_version\E/o
or next;
$in_items = 1;
print $line;
}
else
{
# Be careful that this regexp cannot match version numbers
# in NEWS items -- they might well say `introduced in 4.5.5',
# and we don't want that to match.
$line =~ /^(\* Major changes.*|[^ *-].*)\Q$prev_version\E/o
and last;
print $line;
}
}
close NEWS;
$in_items
or die "$ME: $news_file: no matching lines for `$curr_version'\n";
}
sub print_changelog_deltas ($$)
{
my ($package_name, $prev_version) = @_;
# Print new ChangeLog entries.
# First find all CVS-controlled ChangeLog files.
use File::Find;
my @changelog;
find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
and push @changelog, $File::Find::name}},
'.');
# If there are no ChangeLog files, we're done.
@changelog
or return;
my %changelog = map {$_ => 1} @changelog;
# Reorder the list of files so that if there are ChangeLog
# files in the specified directories, they're listed first,
# in this order:
my @dir = qw ( . src lib m4 config doc );
# A typical @changelog array might look like this:
# ./ChangeLog
# ./po/ChangeLog
# ./m4/ChangeLog
# ./lib/ChangeLog
# ./doc/ChangeLog
# ./config/ChangeLog
my @reordered;
foreach my $d (@dir)
{
my $dot_slash = $d eq '.' ? $d : "./$d";
my $target = "$dot_slash/ChangeLog";
delete $changelog{$target}
and push @reordered, $target;
}
# Append any remaining ChangeLog files.
push @reordered, sort keys %changelog;
# Remove leading `./'.
@reordered = map { s!^\./!!; $_ } @reordered;
print "\nChangeLog entries:\n\n";
# print join ("\n", @reordered), "\n";
$prev_version =~ s/\./_/g;
my $prev_cvs_tag = "\U$package_name\E-$prev_version";
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
open DIFF, '-|', $cmd
or die "$ME: cannot run `$cmd': $!\n";
# Print two types of lines, making minor changes:
# Lines starting with `+++ ', e.g.,
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
# and those starting with `+'.
# Don't print the others.
my $prev_printed_line_empty = 1;
while (defined (my $line = <DIFF>))
{
if ($line =~ /^\+\+\+ /)
{
my $separator = "*"x70 ."\n";
$line =~ s///;
$line =~ s/\s.*//;
$prev_printed_line_empty
or print "\n";
print $separator, $line, $separator;
}
elsif ($line =~ /^\+/)
{
$line =~ s///;
print $line;
$prev_printed_line_empty = ($line =~ /^$/);
}
}
close DIFF;
# The exit code should be 1.
# Allow in case there are no modified ChangeLog entries.
$? == 256 || $? == 128
or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
}
{
# Neutralize the locale, so that, for instance, "du" does not
# issue "1,2" instead of "1.2", what confuses our regexps.
$ENV{LC_ALL} = "C";
my $release_type;
my $package_name;
my $prev_version;
my $curr_version;
my $release_archive_dir;
my @url_dir_list;
my @news_file;
GetOptions
(
'release-type=s' => \$release_type,
'package-name=s' => \$package_name,
'previous-version=s' => \$prev_version,
'current-version=s' => \$curr_version,
'release-archive-directory=s' => \$release_archive_dir,
'url-directory=s' => \@url_dir_list,
'news=s' => \@news_file,
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
) or usage 1;
my $fail = 0;
# Ensure that sure each required option is specified.
$release_type
or (warn "$ME: release type not specified\n"), $fail = 1;
$package_name
or (warn "$ME: package name not specified\n"), $fail = 1;
$prev_version
or (warn "$ME: previous version string not specified\n"), $fail = 1;
$curr_version
or (warn "$ME: current version string not specified\n"), $fail = 1;
$release_archive_dir
or (warn "$ME: release directory name not specified\n"), $fail = 1;
@url_dir_list
or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
exists $valid_release_types{$release_type}
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
@ARGV
and (warn "$ME: too many arguments\n"), $fail = 1;
$fail
and usage 1;
my $my_distdir = "$package_name-$curr_version";
my $tgz = "$my_distdir.tar.gz";
my $tbz = "$my_distdir.tar.bz2";
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
my %size = sizes ($tgz, $tbz, $xd);
%size
or exit 1;
# The markup is escaped as <\# so that when this script is sent by
# mail (or part of a diff), Gnus is not triggered.
print <<EOF;
Subject: $my_distdir released
<\#secure method=pgpmime mode=sign>
FIXME: put comments here
EOF
print_locations ("compressed sources", @url_dir_list, %size,
$tgz, $tbz);
print_locations ("xdelta-style diffs", @url_dir_list, %size,
$xd);
print_locations ("GPG detached signatures", @url_dir_list, %size,
"$tgz.sig", "$tbz.sig");
print_signatures ($tgz, $tbz, $xd);
print_news_deltas ($_, $prev_version, $curr_version)
foreach @news_file;
$release_type eq 'major'
or print_changelog_deltas ($package_name, $prev_version);
exit 0;
}
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
## perl-indent-level: 2
## perl-continued-statement-offset: 2
## perl-continued-brace-offset: 0
## perl-brace-offset: 0
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 2
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## End:

809
bootstrap Executable file
View File

@@ -0,0 +1,809 @@
#! /bin/sh
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
# Written by Paul Eggert.
nl='
'
# Ensure file names are sorted consistently across platforms.
LC_ALL=C
export LC_ALL
local_gl_dir=gl
# Temporary directory names.
bt='._bootmp'
bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
bt2=${bt}2
usage() {
cat <<EOF
Usage: $0 [OPTION]...
Bootstrap this package from the checked-out sources.
Options:
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again.
--copy Copy files instead of creating symbolic links.
--force Attempt to bootstrap even if the sources seem
not to have been checked out.
--skip-po Do not download po files.
If the file $0.conf exists in the same directory as this script, its
contents are read as shell variables to configure the bootstrap.
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
are honored.
Running without arguments will suffice in most cases.
EOF
}
# Configuration.
# Name of the Makefile.am
gnulib_mk=gnulib.mk
# List of gnulib modules needed.
gnulib_modules=
# Any gnulib files needed that are not in modules.
gnulib_files=
# A function to be called after everything else in this script.
bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into
# a specified directory. Fill in the first %s is the domain name, and
# the second with the destination directory. Use rsync's -L and -r
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\
"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
extract_package_name='
/^AC_INIT(/{
/.*,.*,.*, */{
s///
s/[][]//g
s/)$//
p
q
}
s/AC_INIT(\[*//
s/]*,.*//
s/^GNU //
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
s/[^A-Za-z0-9_]/-/g
p
}
'
package=`sed -n "$extract_package_name" configure.ac` || exit
gnulib_name=lib$package
build_aux=build-aux
source_base=lib
m4_base=m4
doc_base=doc
tests_base=tests
# Extra files from gnulib, which override files from other sources.
gnulib_extra_files="
$build_aux/install-sh
$build_aux/missing
$build_aux/mdate-sh
$build_aux/texinfo.tex
$build_aux/depcomp
$build_aux/config.guess
$build_aux/config.sub
doc/INSTALL
"
# Additional gnulib-tool options to use. Use "\newline" to break lines.
gnulib_tool_option_extras=
# Other locale categories that need message catalogs.
EXTRA_LOCALE_CATEGORIES=
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS='\\\
--flag=_:1:pass-c-format\\\
--flag=N_:1:pass-c-format\\\
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
'
# Package bug report address for gettext files
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
# Files we don't want to import.
excluded_files=
# File that should exist in the top directory of a checked out hierarchy,
# but not in a distribution tarball.
checkout_only_file=README-hacking
# Whether to use copies instead of symlinks.
copy=false
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
# those files to be generated in directories like lib/, m4/, and po/.
# Or set it to 'auto' to make this script select which to use based
# on which version control system (if any) is used in the source directory.
vc_ignore=auto
# find_tool ENVVAR NAMES...
# -------------------------
# Search for a required program. Use the value of ENVVAR, if set,
# otherwise find the first of the NAMES that can be run (i.e.,
# supports --version). If found, set ENVVAR to the program name,
# die otherwise.
find_tool ()
{
# Find sha1sum, named gsha1sum on MacPorts.
find_tool_envvar=$1
shift
find_tool_names=$@
eval "find_tool_res=\$$find_tool_envvar"
if test x"$find_tool_res" = x; then
for i
do
if ($i --version </dev/null) >/dev/null 2>&1; then
find_tool_res=$i
break
fi
done
else
find_tool_error_prefix="\$$find_tool_envvar: "
fi
if test x"$find_tool_res" = x; then
echo >&2 "$0: one of these is required: $find_tool_names"
exit 1
fi
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
echo >&2 "$0: ${find_tool_error_prefix}cannot run $find_tool_res --version"
exit 1
}
eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
# Find sha1sum, named gsha1sum on MacPorts.
find_tool SHA1SUM sha1sum gsha1sum
# Override the default configuration, if necessary.
# Make sure that bootstrap.conf is sourced from the current directory
# if we were invoked as "sh bootstrap".
case "$0" in
*/*) test -r "$0.conf" && . "$0.conf" ;;
*) test -r "$0.conf" && . ./"$0.conf" ;;
esac
if test "$vc_ignore" = auto; then
vc_ignore=
test -d .git && vc_ignore=.gitignore
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
fi
# Translate configuration into internal form.
# Parse options.
for option
do
case $option in
--help)
usage
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
--skip-po)
SKIP_PO=t;;
--force)
checkout_only_file=;;
--copy)
copy=true;;
*)
echo >&2 "$0: $option: unknown option"
exit 1;;
esac
done
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
exit 1
fi
# If $STR is not already on a line by itself in $FILE, insert it,
# sorting the new contents of the file and replacing $FILE with the result.
insert_sorted_if_absent() {
file=$1
str=$2
test -f $file || touch $file
echo "$str" | sort -u - $file | cmp - $file > /dev/null \
|| echo "$str" | sort -u - $file -o $file \
|| exit 1
}
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
found_aux_dir=no
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
>/dev/null && found_aux_dir=yes
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
>/dev/null && found_aux_dir=yes
if test $found_aux_dir = no; then
echo "$0: expected line not found in configure.ac. Add the following:" >&2
echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
exit 1
fi
# If $build_aux doesn't exist, create it now, otherwise some bits
# below will malfunction. If creating it, also mark it as ignored.
if test ! -d $build_aux; then
mkdir $build_aux
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
insert_sorted_if_absent $dot_ig $build_aux
done
fi
# Note this deviates from the version comparison in automake
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
# but this should suffice as we won't be specifying old
# version formats or redundant trailing .0 in bootstrap.conf.
# If we did want full compatibility then we should probably
# use m4_version_compare from autoconf.
sort_ver() { # sort -V is not generally available
ver1="$1"
ver2="$2"
# split on '.' and compare each component
i=1
while : ; do
p1=$(echo "$ver1" | cut -d. -f$i)
p2=$(echo "$ver2" | cut -d. -f$i)
if [ ! "$p1" ]; then
echo "$1 $2"
break
elif [ ! "$p2" ]; then
echo "$2 $1"
break
elif [ ! "$p1" = "$p2" ]; then
if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
echo "$2 $1"
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
echo "$1 $2"
else # numeric, then lexicographic comparison
lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
if [ "$lp" = "$p2" ]; then
echo "$1 $2"
else
echo "$2 $1"
fi
fi
break
fi
i=$(($i+1))
done
}
get_version() {
app=$1
$app --version >/dev/null 2>&1 || return 1
$app --version 2>&1 |
sed -n 's/[^0-9.]*\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/p
t done
d
:done
q'
}
check_versions() {
ret=0
while read app req_ver; do
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
appvar=`echo $app | tr '[a-z]' '[A-Z]'`
test "$appvar" = TAR && appvar=AMTAR
eval "app=\${$appvar-$app}"
inst_ver=$(get_version $app)
if [ ! "$inst_ver" ]; then
echo "Error: '$app' not found" >&2
ret=1
elif [ ! "$req_ver" = "-" ]; then
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
if [ ! "$latest_ver" = "$inst_ver" ]; then
echo "Error: '$app' version == $inst_ver is too old" >&2
echo " '$app' version >= $req_ver is required" >&2
ret=1
fi
fi
done
return $ret
}
print_versions() {
echo "Program Min_version"
echo "----------------------"
printf "$buildreq"
echo "----------------------"
# can't depend on column -t
}
if ! printf "$buildreq" | check_versions; then
test -f README-prereq &&
echo "See README-prereq for notes on obtaining these prerequisite programs:" >&2
echo
print_versions
exit 1
fi
echo "$0: Bootstrapping from checked-out $package sources..."
# See if we can use gnulib's git-merge-changelog merge driver.
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if git config merge.merge-changelog.driver >/dev/null ; then
:
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
echo "initializing git-merge-changelog driver"
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
else
echo "consider installing git-merge-changelog from gnulib"
fi
fi
cleanup_gnulib() {
status=$?
rm -fr gnulib
exit $status
}
git_modules_config () {
test -f .gitmodules && git config --file .gitmodules "$@"
}
# Get gnulib files.
case ${GNULIB_SRCDIR--} in
-)
if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
elif [ ! -d gnulib ]; then
echo "$0: getting gnulib files..."
trap cleanup_gnulib 1 2 13 15
git clone --help|grep depth > /dev/null && shallow='--depth 2' || shallow=
git clone $shallow git://git.sv.gnu.org/gnulib ||
cleanup_gnulib
trap - 1 2 13 15
fi
GNULIB_SRCDIR=gnulib
;;
*)
# Redirect the gnulib submodule to the directory on the command line
# if possible.
if test -d "$GNULIB_SRCDIR"/.git && \
git_modules_config submodule.gnulib.url >/dev/null; then
git submodule init
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
echo "$0: getting gnulib files..."
git submodule update || exit $?
GNULIB_SRCDIR=gnulib
fi
;;
esac
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
<$gnulib_tool || exit
# Get translations.
download_po_files() {
subdir=$1
domain=$2
echo "$0: getting translations into $subdir for $domain..."
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
eval "$cmd"
}
# Download .po files to $po_dir/.reference and copy only the new
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
update_po_files() {
# Directory containing primary .po files.
# Overwrite them only when we're sure a .po file is new.
po_dir=$1
domain=$2
# Download *.po files into this dir.
# Usually contains *.s1 checksum files.
ref_po_dir="$po_dir/.reference"
test -d $ref_po_dir || mkdir $ref_po_dir || return
download_po_files $ref_po_dir $domain \
&& ls "$ref_po_dir"/*.po 2>/dev/null |
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS"
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
test "$langs" = '*' && langs=x
for po in $langs; do
case $po in x) continue;; esac
new_po="$ref_po_dir/$po.po"
cksum_file="$ref_po_dir/$po.s1"
if ! test -f "$cksum_file" ||
! test -f "$po_dir/$po.po" ||
! $SHA1SUM -c --status "$cksum_file" \
< "$new_po" > /dev/null; then
echo "updated $po_dir/$po.po..."
cp "$new_po" "$po_dir/$po.po" \
&& $SHA1SUM < "$new_po" > "$cksum_file"
fi
done
}
case $SKIP_PO in
'')
if test -d po; then
update_po_files po $package || exit
fi
if test -d runtime-po; then
update_po_files runtime-po $package-runtime || exit
fi;;
esac
symlink_to_dir()
{
src=$1/$2
dst=${3-$2}
test -f "$src" && {
# If the destination directory doesn't exist, create it.
# This is required at least for "lib/uniwidth/cjk.h".
dst_dir=`dirname "$dst"`
if ! test -d "$dst_dir"; then
mkdir -p "$dst_dir"
# If we've just created a directory like lib/uniwidth,
# tell version control system(s) it's ignorable.
# FIXME: for now, this does only one level
parent=`dirname "$dst_dir"`
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
ig=$parent/$dot_ig
insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
done
fi
if $copy; then
{
test ! -h "$dst" || {
echo "$0: rm -f $dst" &&
rm -f "$dst"
}
} &&
test -f "$dst" &&
cmp -s "$src" "$dst" || {
echo "$0: cp -fp $src $dst" &&
cp -fp "$src" "$dst"
}
else
test -h "$dst" &&
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
test "$src_i" = "$dst_i" || {
dot_dots=
case $src in
/*) ;;
*)
case /$dst/ in
*//* | */../* | */./* | /*/*/*/*/*/)
echo >&2 "$0: invalid symlink calculation: $src -> $dst"
exit 1;;
/*/*/*/*/) dot_dots=../../../;;
/*/*/*/) dot_dots=../../;;
/*/*/) dot_dots=../;;
esac;;
esac
echo "$0: ln -fs $dot_dots$src $dst" &&
ln -fs "$dot_dots$src" "$dst"
}
fi
}
}
cp_mark_as_generated()
{
cp_src=$1
cp_dst=$2
if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
symlink_to_dir $local_gl_dir "$cp_dst"
else
case $cp_dst in
*.[ch]) c1='/* '; c2=' */';;
*.texi) c1='@c '; c2= ;;
*.m4|*/Make*|Make*) c1='# ' ; c2= ;;
*) c1= ; c2= ;;
esac
# If the destination directory doesn't exist, create it.
# This is required at least for "lib/uniwidth/cjk.h".
dst_dir=`dirname "$cp_dst"`
test -d "$dst_dir" || mkdir -p "$dst_dir"
if test -z "$c1"; then
cmp -s "$cp_src" "$cp_dst" || {
# Copy the file first to get proper permissions if it
# doesn't already exist. Then overwrite the copy.
echo "$0: cp -f $cp_src $cp_dst" &&
rm -f "$cp_dst" &&
cp "$cp_src" "$cp_dst-t" &&
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" &&
mv -f "$cp_dst-t" "$cp_dst"
}
else
# Copy the file first to get proper permissions if it
# doesn't already exist. Then overwrite the copy.
cp "$cp_src" "$cp_dst-t" &&
(
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
echo '#line 1' &&
sed "s!$bt_regex/!!g" "$cp_src"
) > $cp_dst-t &&
if cmp -s "$cp_dst-t" "$cp_dst"; then
rm -f "$cp_dst-t"
else
echo "$0: cp $cp_src $cp_dst # with edits" &&
mv -f "$cp_dst-t" "$cp_dst"
fi
fi
fi
}
version_controlled_file() {
dir=$1
file=$2
found=no
if test -d CVS; then
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
elif test -d .git; then
git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
elif test -d .svn; then
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
else
echo "$0: no version control for $dir/$file?" >&2
fi
test $found = yes
}
slurp() {
for dir in . `(cd $1 && find * -type d -print)`; do
copied=
sep=
for file in `ls -a $1/$dir`; do
case $file in
.|..) continue;;
.*) continue;; # FIXME: should all file names starting with "." be ignored?
esac
test -d $1/$dir/$file && continue
for excluded_file in $excluded_files; do
test "$dir/$file" = "$excluded_file" && continue 2
done
if test $file = Makefile.am; then
copied=$copied${sep}$gnulib_mk; sep=$nl
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || {
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
rm -f $dir/$gnulib_mk &&
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
}
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
version_controlled_file $dir $file; then
echo "$0: $dir/$file overrides $1/$dir/$file"
else
copied=$copied$sep$file; sep=$nl
if test $file = gettext.m4; then
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
rm -f $dir/$file
sed '
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
AC_DEFUN([AM_INTL_SUBDIR], [
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
$a\
AC_DEFUN([gl_LOCK_EARLY], [])
' $1/$dir/$file >$dir/$file
else
cp_mark_as_generated $1/$dir/$file $dir/$file
fi
fi || exit
done
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
ig=$dir/$dot_ig
if test -n "$copied"; then
insert_sorted_if_absent $ig "$copied"
# If an ignored file name ends with .in.h, then also add
# the name with just ".h". Many gnulib headers are generated,
# e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc.
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
insert_sorted_if_absent $ig "$f"
# For files like sys_stat.in.h and sys_time.in.h, record as
# ignorable the directory we might eventually create: sys/.
f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'`
insert_sorted_if_absent $ig "$f"
fi
done
done
}
# Create boot temporary directories to import from gnulib and gettext.
rm -fr $bt $bt2 &&
mkdir $bt $bt2 || exit
# Import from gnulib.
gnulib_tool_options="\
--import\
--no-changelog\
--aux-dir $bt/$build_aux\
--doc-base $bt/$doc_base\
--lib $gnulib_name\
--m4-base $bt/$m4_base/\
--source-base $bt/$source_base/\
--tests-base $bt/$tests_base\
--local-dir $local_gl_dir\
$gnulib_tool_option_extras\
"
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
slurp $bt || exit
for file in $gnulib_files; do
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
done
# Import from gettext.
with_gettext=yes
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no
if test $with_gettext = yes; then
echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..."
cp configure.ac $bt2 &&
(cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) &&
slurp $bt2 $bt || exit
fi
rm -fr $bt $bt2 || exit
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
# The following requires GNU find 4.2.3 or newer. Considering the usual
# portability constraints of this script, that may seem a very demanding
# requirement, but it should be ok. Ignore any failure, which is fine,
# since this is only a convenience to help developers avoid the relatively
# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
# between successive runs of this script.
find "$m4_base" "$source_base" \
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
-type l -xtype l -delete > /dev/null 2>&1
# Reconfigure, getting other files.
# Skip autoheader if it's not needed.
grep '^[ ]*AC_CONFIG_HEADERS\>' configure.ac >/dev/null ||
AUTOHEADER=true
for command in \
libtool \
"${ACLOCAL-aclocal} --force -I m4" \
"${AUTOCONF-autoconf} --force" \
"${AUTOHEADER-autoheader} --force" \
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
do
if test "$command" = libtool; then
use_libtool=0
# We'd like to use grep -E, to see if any of LT_INIT,
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
# but that's not portable enough (e.g., for Solaris).
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
&& use_libtool=1
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
&& use_libtool=1
test $use_libtool = 0 \
&& continue
command="${LIBTOOLIZE-libtoolize} -c -f"
fi
echo "$0: $command ..."
$command || exit
done
# Get some extra files from gnulib, overriding existing files.
for file in $gnulib_extra_files; do
case $file in
*/INSTALL) dst=INSTALL;;
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
*) dst=$file;;
esac
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
done
if test $with_gettext = yes; then
# Create gettext configuration.
echo "$0: Creating po/Makevars from po/Makevars.template ..."
rm -f po/Makevars
sed '
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
/^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
/^XGETTEXT_OPTIONS *=/{
s/$/ \\/
a\
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
}
' po/Makevars.template >po/Makevars
if test -d runtime-po; then
# Similarly for runtime-po/Makevars, but not quite the same.
rm -f runtime-po/Makevars
sed '
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
/^subdir *=.*/s/=.*/= runtime-po/
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
/^XGETTEXT_OPTIONS *=/{
s/$/ \\/
a\
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
}
' <po/Makevars.template >runtime-po/Makevars
# Copy identical files from po to runtime-po.
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
fi
fi
bootstrap_epilogue
echo "$0: done. Now you can run './configure'."

332
bootstrap.conf Normal file
View File

@@ -0,0 +1,332 @@
# Bootstrap configuration.
# Copyright (C) 2006-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
# We don't need these modules.
avoided_gnulib_modules='
--avoid=canonicalize-lgpl
--avoid=dummy
'
# These modules are obsolete and can probably be removed soon,
# but leave them in for now to minimize changes.
obsolete_gnulib_modules='
atexit
memcmp
memcpy
memmove
memset
strcspn
strtod
strtol
'
# gnulib modules used by this package.
gnulib_modules="
$avoided_gnulib_modules
$obsolete_gnulib_modules
acl
alloca
announce-gen
areadlink-with-size
argmatch
argv-iter
assert
autobuild
backupfile
base64
c-strcase
c-strtod
c-strtold
calloc
canon-host
canonicalize
chown
cloexec
closein
closeout
config-h
configmake
crypto/md5
crypto/sha1
crypto/sha256
crypto/sha512
cycle-check
d-ino
d-type
diacrit
dirfd
dirname
dup2
error
euidaccess
exclude
exitfail
faccessat
fchdir
fcntl
fcntl-safer
fdl
file-type
fileblocks
filemode
filenamecat
filevercmp
fnmatch-gnu
fopen-safer
fprintftime
freopen
fseeko
fsusage
fsync
ftello
ftruncate
fts
getdate
getgroups
gethrxtime
getline
getloadavg
getndelim2
getopt-gnu
getpagesize
getpass-gnu
gettext
gettime
gettimeofday
getugroups
getusershell
git-version-gen
gitlog-to-changelog
gnu-make
gnu-web-doc-update
gnumakefile
gnupload
group-member
hard-locale
hash
hash-pjw
host-os
human
idcache
ignore-value
inttostr
inttypes
isapipe
lchmod
lchown
lib-ignore
linebuffer
link
link-follow
linkat
long-options
lstat
maintainer-makefile
malloc
manywarnings
mbrtowc
mbsalign
mbswidth
memcasecmp
memchr
memcmp2
mempcpy
memrchr
mgetgroups
mkancesdirs
mkdir
mkdir-p
mkstemp
mktime
modechange
mountlist
mpsort
obstack
pathmax
perl
physmem
posix-shell
posixtm
posixver
priv-set
progname
propername
putenv
quote
quotearg
raise
randint
randperm
readlink
readtokens
readtokens0
readutmp
realloc
regex
rename
rename-dest-slash
rmdir
root-dev-ino
rpmatch
safe-read
same
save-cwd
savedir
savewd
selinux-at
settime
sig2str
sigaction
ssize_t
stat-macros
stat-time
stdbool
stdlib-safer
stpcpy
stpncpy
strdup-posix
strftime
strpbrk
strsignal
strtoimax
strtoumax
strverscmp
symlink
sys_stat
timespec
tzset
uname
unicodeio
unistd-safer
unlink-busy
unlocked-io
update-copyright
uptime
useless-if-before-free
userspec
utimecmp
utimens
vasprintf-posix
vc-list-files
verify
verror
version-etc-fsf
warnings
wcwidth
winsz-ioctl
winsz-termios
write-any-file
xalloc
xfreopen
xgetcwd
xgethostname
xmemcoll
xnanosleep
xprintf
xprintf-posix
xreadlink
xstrtod
xstrtoimax
xstrtol
xstrtold
xstrtoumax
yesno
"
# Other locale categories that need message catalogs.
EXTRA_LOCALE_CATEGORIES=LC_TIME
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--flag=asnprintf:3:c-format\\\
--flag=asprintf:2:c-format\\\
--flag=error:3:c-format\\\
--flag=error_at_line:5:c-format\\\
--flag=vasnprintf:3:c-format\\\
--flag=vasprintf:2:c-format\\\
--flag=verror:3:c-format\\\
--flag=verror_at_line:5:c-format\\\
--flag=wrapf:1:c-format\\\
--flag=xasprintf:1:c-format\\\
--flag=xfprintf:2:c-format\\\
--flag=xprintf:1:c-format\\\
--from-code=UTF-8\\\
'
# Append these, since we use the propername module.
see_manual='"This is a proper name. See the gettext manual, section Names."'
see_manual=\'"$see_manual"\'
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--keyword=proper_name:1,'"$see_manual"'\\\
--keyword=proper_name_utf8:1,'"$see_manual"'\\\
'
# If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
# appears in configure.ac, exclude some unnecessary files.
# Without grep's -E option (not portable enough, pre-configure),
# the following test is ugly. Also, this depends on the existence
# of configure.ac, not the obsolescent-named configure.in. But if
# you're using this infrastructure, you should care about such things.
gettext_external=0
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
gettext_external=1
grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
gettext_external=1
if test $gettext_external = 1; then
# Gettext supplies these files, but we don't need them since
# we don't have an intl subdirectory.
excluded_files='
m4/glibc2.m4
m4/intdiv0.m4
m4/lcmessage.m4
m4/uintmax_t.m4
m4/ulonglong.m4
m4/visibility.m4
'
fi
gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
# Build prerequisites
buildreq="\
autoconf 2.61
automake 1.11
autopoint -
bison -
gettext -
git 1.4.4
gperf -
gzip -
makeinfo -
perl 5.5
rsync -
tar -
"
# Automake requires that ChangeLog exist.
touch ChangeLog || exit 1
bootstrap_epilogue()
{
# Change paths in gnulib-tests/gnulib.mk from "../.." to "..".
m=gnulib-tests/gnulib.mk
sed 's,\.\./\.\.,..,g' $m > $m-t
mv -f $m-t $m
}

View File

@@ -1,3 +1,98 @@
2007-09-29 Eric Blake <ebb9@byu.net>
* check.mk (%.log): Also allow suffix-less tests, on platforms
where $(EXEEXT) is not empty.
2007-09-15 Jim Meyering <jim@meyering.net>
* vc-list-files: Remove mercurial support.
Check for CVS first. Adjust comments.
2007-01-30 Jim Meyering <jim@meyering.net>
* vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
now has only two columns).
2006-10-14 Jim Meyering <jim@meyering.net>
* vc-list-files: Don't filter git-ls-files output through cut.
Add a comment about cvsu.
2006-08-22 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: New file.
2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
* compile, config.guess, config.rpath, config.sub, depcomp:
* install-sh, mdate-sh, missing, texinfo.tex:
Remove from CVS, since ../bootstrap generates them automatically.
2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
* ChangeLog: Add copyright notice.
* vc-list-files: Likewise.
* mkinstalldirs: Remove; no longer needed.
2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
* texinfo.tex: Update from gnulib.
2006-07-25 Jim Meyering <jim@meyering.net>
* vc-list-files: Handle git repositories, too.
2006-07-19 Jim Meyering <jim@meyering.net>
* vc-list-files: Command line args correspond to an "include"
list, not an exclude list.
2006-07-14 Jim Meyering <jim@meyering.net>
* vc-list-files: New file.
2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
* config.guess, config.sub, install-sh, texinfo.tex:
Update from gnulib.
2006-05-29 Jim Meyering <jim@meyering.net>
* config.guess, config.rpath, config.sub, install-sh:
* mkinstalldirs, texinfo.tex: Update from gnulib.
2006-02-14 Paul Eggert <eggert@cs.ucla.edu>
* install-sh: Update from gnulib.
2006-01-31 Jim Meyering <jim@meyering.net>
* config.guess, missing, texinfo.tex: Update from gnulib.
2006-01-10 Paul Eggert <eggert@cs.ucla.edu>
* config.guess, config.sub, depcomp, texinfo.tex: Sync from gnulib.
2005-12-13 Paul Eggert <eggert@cs.ucla.edu>
* config.guess: Sync from gnulib.
2005-12-07 Jim Meyering <jim@meyering.net>
* cvsu: New file.
2005-11-12 Jim Meyering <jim@meyering.net>
* config.guess, install-sh: Update from gnulib.
2005-10-23 Jim Meyering <jim@meyering.net>
* compile: New file, used to build sha* programs from md5sum.c.
2005-10-13 Jim Meyering <jim@meyering.net>
* texinfo.tex: Sync from gnulib.
2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
* install-sh, config.guess: Sync from gnulib.
@@ -135,3 +230,12 @@
* config.guess (main): Don't use `head -1'; it's no longer portable.
Use `sed 1q' instead.
-----
Copyright (C) 2002-2009 Free Software Foundation, Inc.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice
and this notice are preserved.

1465
build-aux/config.guess vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,571 +0,0 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2005 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
cc_basename=`echo "$CC" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case "$cc_basename" in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | pw32* | os2*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux*)
case $cc_basename in
icc* | ecc*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
sco3.2v5*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
wl='-Wl,'
;;
sysv4*MP*)
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris* | sysv5*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sunos4*)
hardcode_direct=yes
;;
linux*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = yes; then
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
hardcode_direct=yes
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case "$cc_basename" in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | kfreebsd*-gnu | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10* | hpux11*)
if test "$with_gnu_ld" = no; then
case "$host_cpu" in
hppa*64*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=no
;;
ia64*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=no
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
sco3.2v5*)
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4.2uw2*)
hardcode_direct=yes
hardcode_minus_L=no
;;
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
;;
sysv5*)
hardcode_libdir_flag_spec=
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
libname_spec='lib$name'
case "$host_os" in
aix3*)
;;
aix4* | aix5*)
;;
amigaos*)
;;
beos*)
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
shrext=.dll
;;
darwin* | rhapsody*)
shrext=.dylib
;;
dgux*)
;;
freebsd1*)
;;
kfreebsd*-gnu)
;;
freebsd*)
;;
gnu*)
;;
hpux9* | hpux10* | hpux11*)
case "$host_cpu" in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
;;
irix5* | irix6* | nonstopux*)
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux*)
;;
knetbsd*-gnu)
;;
netbsd*)
;;
newsos6)
;;
nto-qnx*)
;;
openbsd*)
;;
os2*)
libname_spec='$name'
shrext=.dll
;;
osf3* | osf4* | osf5*)
;;
sco3.2v5*)
;;
solaris*)
;;
sunos4*)
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
;;
sysv4*MP*)
;;
uts4*)
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF

1579
build-aux/config.sub vendored

File diff suppressed because it is too large Load Diff

512
build-aux/cvsu Executable file
View File

@@ -0,0 +1,512 @@
#! /usr/bin/perl -w
# cvsu - do a quick check to see what files are out of date.
#
# Copyright (C) 2000-2005 Pavel Roskin <proski@gnu.org>
# Initially written by Tom Tromey <tromey@cygnus.com>
# Completely rewritten by Pavel Roskin <proski@gnu.org>
#
# 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
require 5.004;
use Getopt::Long;
use File::Basename;
use Time::Local;
use strict;
use vars qw($list_types %messages %options @batch_list $batch_cmd
$no_recurse $explain_type $find_mode $short_print
$no_cvsignore $nolinks $file $single_filename $curr_dir
@common_ignores $ignore_rx %entries %subdirs %removed);
use constant SUBDIR_FOUND => 1;
use constant SUBDIR_CVS => 2;
# This list comes from the CVS manual.
use constant STANDARD_IGNORES =>
('RCS', 'SCCS', 'CVS', 'CVS.adm', 'RCSLOG', 'cvslog.*', 'tags',
'TAGS', '.make.state', '.nse_depinfo', '*~', '#*', '.#*', ',*',
"_\$*", "*\$", '*.old', '*.bak', '*.BAK', '*.orig', '*.rej',
'.del-*', '*.a', '*.olb', '*.o', '*.obj', '*.so', '*.exe',
'*.Z', '*.elc', '*.ln', 'core');
# 3-letter month names in POSIX locale, for fast date decoding
my %months = (
"Jan" => 0,
"Feb" => 1,
"Mar" => 2,
"Apr" => 3,
"May" => 4,
"Jun" => 5,
"Jul" => 6,
"Aug" => 7,
"Sep" => 8,
"Oct" => 9,
"Nov" => 10,
"Dec" => 11
);
# print usage information and exit
sub usage ()
{
print "Usage:\n" .
" cvsu [OPTIONS] [FILE] ...\n" .
"Options:\n" .
" --local Disable recursion\n" .
" --explain Verbosely print status of files\n" .
" --find Emulate find - filenames only\n" .
" --short Don't print paths\n" .
" --ignore Don't read .cvsignore\n" .
" --messages List known file types and long messages\n" .
" --nolinks Disable recognizing hard and soft links\n" .
" --types=[^]LIST Print only file types [not] from LIST\n" .
" --batch=COMMAND Execute this command on files\n" .
" --help Print this usage information\n" .
" --version Print version number\n" .
"Abbreviations and short options are supported\n";
exit 0;
}
# print version information and exit
sub version ()
{
print "cvsu - CVS offline examiner, version 0.2.3\n";
exit 0;
}
# If types begin with '^', make inversion
sub adjust_types ()
{
if ($list_types =~ m{^\^(.*)$}) {
$list_types = "";
foreach (keys %messages) {
$list_types .= $_
if (index ($1, $_) < 0);
}
}
}
# list known messages and exit
sub list_messages ()
{
my $default_mark;
print "Recognizable file types are:\n";
foreach (sort keys %messages) {
if (index($list_types, $_) >= 0) {
$default_mark = "*";
} else {
$default_mark = " ";
}
print " $default_mark $_ $messages{$_}\n";
}
print "* indicates file types listed by default\n";
exit 0;
}
# Initialize @common_ignores
# Also read $HOME/.cvsignore and append it to @common_ignores
sub init_ignores ()
{
my $HOME = $ENV{"HOME"};
push @common_ignores, STANDARD_IGNORES;
unless (defined($HOME)) {
return;
}
my $home_cvsignore = "${HOME}/.cvsignore";
if (-f "$home_cvsignore") {
unless (open (CVSIGNORE, "< $home_cvsignore")) {
error ("couldn't open $home_cvsignore: $!");
}
while (<CVSIGNORE>) {
push (@common_ignores, split);
}
close (CVSIGNORE);
}
my $CVSIGNOREENV = $ENV{"CVSIGNORE"};
unless (defined($CVSIGNOREENV)) {
return;
}
my @ignores_var = split (/ /, $CVSIGNOREENV);
push (@common_ignores, @ignores_var);
}
# Print message and exit (like "die", but without raising an exception).
# Newline is added at the end.
sub error ($)
{
print STDERR "cvsu: ERROR: " . shift(@_) . "\n";
exit 1;
}
# execute commands from @exec_list with $exec_cmd
sub do_batch ()
{
my @cmd_list = split (' ', $batch_cmd);
system (@cmd_list, @batch_list);
}
# print files status
# Parameter 1: status in one-letter representation
sub file_status ($)
{
my $type = shift (@_);
my $item;
my $pathfile;
return
if $ignore_rx ne '' && $type =~ /[?SLD]/ && $file =~ /$ignore_rx/;
return
if (index($list_types, $type) < 0);
$pathfile = $curr_dir . $file;
if (defined($batch_cmd)) {
push (@batch_list, $pathfile);
# 1000 items in the command line might be too much for HP-UX
if ($#batch_list > 1000) {
do_batch();
undef @batch_list;
}
}
if ($short_print) {
$item = $file;
} else {
$item = $pathfile;
}
if ($find_mode) {
print "$item\n";
} else {
$type = $messages{$type}
if ($explain_type);
print "$type $item\n";
}
}
# load entries from CVS/Entries and CVS/Entries.Log
# Parameter 1: file name for CVS/Entries
# Return: list of entries in the format used in CVS/Entries
sub load_entries ($);
sub load_entries ($)
{
my $entries_file = shift (@_);
my $entries_log_file = "$entries_file.Log";
my %ent = ();
unless (open (ENTRIES, "< $entries_file")) {
error ("couldn't open $entries_file: $!");
}
while (<ENTRIES>) {
chomp;
$ent{$_} = 1;
}
close (ENTRIES);
if (open (ENTRIES, "< $entries_log_file")) {
while (<ENTRIES>) {
chomp;
if ( m{^A (.+)} ) {
$ent{$1} = 1;
} elsif ( m{^R (.+)} ) {
delete $ent{$1};
} else {
# Note: "cvs commit" helps even when you are offline
error ("$entries_log_file:$.: unrecognizable line, " .
"try \"cvs commit\"");
}
}
close (ENTRIES);
}
return keys %ent;
}
# process one directory
# Parameter 1: directory name
sub process_arg ($);
sub process_arg ($)
{
my $arg = shift (@_);
my %found_files = ();
# $file, $curr_dir, and $ignore_rx must be seen in file_status
local $file = "";
local $ignore_rx = "";
local $single_filename = 0;
if ( $arg eq "" or -d $arg ) {
$curr_dir = $arg;
my $real_curr_dir = $curr_dir eq "" ? "." : $curr_dir;
error ("$real_curr_dir is not a directory")
unless ( -d $real_curr_dir );
# Scan present files.
file_status (".");
opendir (DIR, $real_curr_dir) ||
error ("couldn't open directory $real_curr_dir: $!");
foreach (readdir (DIR)) {
$found_files {$_} = 1;
}
closedir (DIR);
} else {
$single_filename = basename $arg;
$curr_dir = dirname $arg;
$found_files{$single_filename} = 1 if lstat $arg;
}
$curr_dir .= "/"
unless ( $curr_dir eq "" || $curr_dir =~ m{/$} );
# Scan CVS/Entries.
my %entries = ();
my %subdirs = ();
my %removed = ();
foreach ( load_entries ("${curr_dir}CVS/Entries") ) {
if ( m{^D/([^/]+)/} ) {
$subdirs{$1} = SUBDIR_FOUND if !$single_filename;
} elsif ( m{^/([^/]+)/([^/])[^/]*/([^/]*)/} ) {
if ( !$single_filename or $single_filename eq $1 ) {
$entries{$1} = $3;
$removed{$1} = 1
if $2 eq '-';
}
} elsif ( m{^D$} ) {
next;
} else {
error ("${curr_dir}CVS/Entries: unrecognizable line");
}
}
if ( $single_filename && !$entries{$single_filename} &&
!$found_files{$single_filename} ) {
error ("nothing known about $arg");
}
# Scan .cvsignore if any
unless ($no_cvsignore) {
my (@ignore_list) = ();
if (-f "${curr_dir}.cvsignore") {
open (CVSIGNORE, "< ${curr_dir}.cvsignore")
|| error ("couldn't open ${curr_dir}.cvsignore: $!");
while (<CVSIGNORE>) {
push (@ignore_list, split);
}
close (CVSIGNORE);
}
my ($iter);
foreach $iter (@ignore_list, @common_ignores) {
if ($iter eq '!') {
$ignore_rx = ''
} else {
if ($ignore_rx eq '') {
$ignore_rx = '^(';
} else {
$ignore_rx .= '|';
}
$ignore_rx .= glob_to_rx ($iter);
}
}
$ignore_rx .= ')$'
if $ignore_rx ne '';
}
# File is missing
foreach $file (sort keys %entries) {
unless ($found_files{$file}) {
if ($removed{$file}) {
file_status("R");
} else {
file_status("U");
}
}
}
foreach $file (sort keys %found_files) {
next if ($file eq '.' || $file eq '..');
lstat ($curr_dir . $file) ||
error ("lstat() failed on $curr_dir . $file");
if (! $nolinks && -l _) {
file_status ("L");
} elsif (-d _) {
if ($file eq 'CVS') {
file_status ("C");
} elsif ($subdirs{$file}) {
$subdirs{$file} = SUBDIR_CVS;
} else {
file_status ("D"); # Unknown directory
}
} elsif (! (-f _) && ! (-l _)) {
file_status ("S"); # This must be something very special
} elsif (! $nolinks && (stat _) [3] > 1 ) {
file_status ("H"); # Hard link
} elsif (! $entries{$file}) {
file_status ("?");
} elsif ($entries{$file} =~ /^Initial |^dummy /) {
file_status ("A");
} elsif ($entries{$file} =~ /^Result of merge/) {
file_status ("G");
} elsif ($entries{$file} !~
/^(...) (...) (..) (..):(..):(..) (....)$/) {
error ("Invalid timestamp for $curr_dir$file: $entries{$file}");
} else {
my $cvtime = timegm($6, $5, $4, $3, $months{$2}, $7 - 1900);
my $mtime = (stat _) [9];
if ($cvtime == $mtime) {
file_status ("F");
} elsif ($cvtime < $mtime) {
file_status ("M");
} else {
file_status ("O");
}
}
}
# Now do directories.
unless ($no_recurse) {
my $save_curr_dir = $curr_dir;
foreach $file (sort keys %subdirs) {
if ($subdirs{$file} == SUBDIR_FOUND) {
$curr_dir = $save_curr_dir;
file_status ("X");
} elsif ($subdirs{$file} == SUBDIR_CVS) {
process_arg ($save_curr_dir . $file)
}
}
}
}
# Turn a glob into a regexp without recognizing square brackets.
sub glob_to_rx_simple ($)
{
my ($expr) = @_;
# Quote all non-word characters, convert ? to . and * to .*
$expr =~ s/(\W)/\\$1/g;
$expr =~ s/\\\*/.*/g;
$expr =~ s/\\\?/./g;
return $expr;
}
# Turn a glob into a regexp
sub glob_to_rx ($)
{
my $result = '';
my ($expr) = @_;
# Find parts in square brackets and copy them literally
# Text outside brackets is processed by glob_to_rx_simple()
while ($expr ne '') {
if ($expr =~ /^(.*?)(\[.*?\])(.*)/) {
$expr = $3;
$result .= glob_to_rx_simple ($1) . $2;
} else {
$result .= glob_to_rx_simple ($expr);
last;
}
}
return $result;
}
sub Main ()
{
# types of files to be listed
$list_types = "^.FCL";
# long status messages
%messages = (
"?" => "Unlisted file",
"." => "Known directory",
"F" => "Up-to-date file",
"C" => "CVS admin directory",
"M" => "Modified file",
"S" => "Special file",
"D" => "Unlisted directory",
"L" => "Symbolic link",
"H" => "Hard link",
"U" => "Lost file",
"X" => "Lost directory",
"A" => "Newly added",
"O" => "Older copy",
"G" => "Result of merge",
"R" => "Removed file"
);
undef @batch_list; # List of files for batch processing
undef $batch_cmd; # Command to be executed on files
$no_recurse = 0; # If this is set, do only local files
$explain_type = 0; # Verbosely print status of files
$find_mode = 0; # Don't print status at all
$short_print = 0; # Print only filenames without path
$no_cvsignore = 0; # Ignore .cvsignore
$nolinks = 0; # Do not test for soft- or hard-links
my $want_msg = 0; # List possible filetypes and exit
my $want_help = 0; # Print help and exit
my $want_ver = 0; # Print version and exit
my %options = (
"types=s" => \$list_types,
"batch=s" => \$batch_cmd,
"local" => \$no_recurse,
"explain" => \$explain_type,
"find" => \$find_mode,
"short" => \$short_print,
"ignore" => \$no_cvsignore,
"messages" => \$want_msg,
"nolinks" => \$nolinks,
"help" => \$want_help,
"version" => \$want_ver
);
GetOptions(%options);
adjust_types();
list_messages() if $want_msg;
usage() if $want_help;
version() if $want_ver;
unless ($no_cvsignore) {
init_ignores();
}
if ($#ARGV < 0) {
@ARGV = ("");
}
foreach (@ARGV) {
process_arg ($_);
}
if ($#batch_list >= 0) {
do_batch();
}
}
Main();

View File

@@ -1,530 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 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
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,401 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-09-13.16
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
posix_glob=
posix_mkdir=
# Symbolic mode for testing mkdir with directories.
# It is the same as 755, but also tests that "u+" works.
test_mode=u=rwx,g=rx,o=rx,u+wx
# Desired mode of installed file.
mode=0755
# Desired mode of newly created intermediate directories.
# It is empty if not known yet.
intermediate_mode=
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
/^X\(\/\/\)$/{ s//\1/; q; }
/^X\(\/\).*/{ s//\1/; q; }
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
posix_mkdir=false
if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
posix_mkdir=true
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
fi ;;
esac
if
$posix_mkdir && {
# With -d, create the new directory with the user-specified mode.
# Otherwise, create it using the same intermediate mode that
# mkdir -p would use when creating intermediate directories.
# POSIX says that this mode is "$(umask -S),u+wx", so use that
# if umask -S works.
if test -n "$dir_arg"; then
mkdir_mode=$mode
else
case $intermediate_mode in
'')
if umask_S=`(umask -S) 2>/dev/null`; then
intermediate_mode=$umask_S,u+wx
else
intermediate_mode=$test_mode
fi ;;
esac
mkdir_mode=$intermediate_mode
fi
$mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
}
then :
else
# mkdir does not conform to POSIX, or it failed possibly due to
# a race condition. Create the directory the slow way, step by
# step, checking for races as we go.
case $dstdir in
/*) pathcomp=/ ;;
-*) pathcomp=./ ;;
*) pathcomp= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
$posix_glob && set +f
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# Don't fail if two instances are running concurrently.
test -d "$pathcomp" || exit 1
fi
pathcomp=$pathcomp/
done
obsolete_mkdir_used=true
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
trap - 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,201 +0,0 @@
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
scriptversion=2005-06-29.22
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
# Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No file. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: mdate-sh [--help] [--version] FILE
Pretty-print the modification time of FILE.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
exit $?
;;
esac
# Prevent date giving response in another language.
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LC_TIME=C
export LC_TIME
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume `unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
export TIME_STYLE
fi
save_arg1=$1
# Find out how to get the extended ls output of a file or directory.
if ls -L /dev/null 1>/dev/null 2>&1; then
ls_command='ls -L -l -d'
else
ls_command='ls -l -d'
fi
# A `ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo
# This differs from Unix, which adds ownership information.
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
#
# To find the date, we split the line on spaces and iterate on words
# until we find a month. This cannot work with files whose owner is a
# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
# will be owned by a user whose name is a month. So we first look at
# the extended ls output of the root directory to decide how many
# words should be skipped to get the date.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
set x`ls -l -d /`
# Find which argument is the month.
month=
command=
until test $month
do
shift
# Add another shift to the command.
command="$command shift;"
case $1 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
done
# Get the extended ls output of the file or directory.
set dummy x`eval "$ls_command \"\$save_arg1\""`
# Remove all preceding arguments
eval $command
# Because of the dummy argument above, month is in $2.
#
# On a POSIX system, we should have
#
# $# = 5
# $1 = file size
# $2 = month
# $3 = day
# $4 = year or time
# $5 = filename
#
# On Darwin 7.7.0 and 7.6.0, we have
#
# $# = 4
# $1 = day
# $2 = month
# $3 = year or time
# $4 = filename
# Get the month.
case $2 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
case $3 in
???*) day=$1;;
*) day=$3; shift;;
esac
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.
case $3 in
*:*) set `date`; eval year=\$$#
case $2 in
Jan) nummonthtod=1;;
Feb) nummonthtod=2;;
Mar) nummonthtod=3;;
Apr) nummonthtod=4;;
May) nummonthtod=5;;
Jun) nummonthtod=6;;
Jul) nummonthtod=7;;
Aug) nummonthtod=8;;
Sep) nummonthtod=9;;
Oct) nummonthtod=10;;
Nov) nummonthtod=11;;
Dec) nummonthtod=12;;
esac
# For the first six month of the year the time notation can also
# be used for files modified in the last year.
if (expr $nummonth \> $nummonthtod) > /dev/null;
then
year=`expr $year - 1`
fi;;
*) year=$3;;
esac
# The result.
echo $day $month $year
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,360 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,158 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2005-06-29.22
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
errstatus=0
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
for d
do
test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

221
cfg.mk Normal file
View File

@@ -0,0 +1,221 @@
# Customize maint.mk -*- makefile -*-
# Copyright (C) 2003-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
# Use alpha.gnu.org for alpha and beta releases.
# Use ftp.gnu.org for major releases.
gnu_ftp_host-alpha = alpha.gnu.org
gnu_ftp_host-beta = alpha.gnu.org
gnu_ftp_host-major = ftp.gnu.org
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
# Used in maint.mk's web-manual rule
manual_title = Core GNU utilities
url_dir_list = \
ftp://$(gnu_rel_host)/gnu/$(PACKAGE)
# The GnuPG ID of the key used to sign the tarballs.
gpg_key_ID = B9AB9A16
# Tests not to run as part of "make distcheck".
local-checks-to-skip =
# Tools used to bootstrap this package, used for "announcement".
bootstrap-tools = autoconf,automake,gnulib,bison
# Now that we have better tests, make this the default.
export VERBOSE = yes
old_NEWS_hash = 785e51bc9af87e7eb004f9ba24a0ca27
# Ensure that the list of O_ symbols used to compute O_FULLBLOCK is complete.
dd = $(srcdir)/src/dd.c
sc_dd_O_FLAGS:
@rm -f $@.1 $@.2
@{ echo O_FULLBLOCK; perl -nle '/^ +\| (O_\w*)$$/ and print $$1' \
$(dd); } | sort > $@.1
@{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
$(dd); } | sort > $@.2
@diff -u $@.1 $@.2 || diff=1 || diff=; \
rm -f $@.1 $@.2; \
test "$$diff" \
&& { echo '$(ME): $(dd) has inconsistent O_ flag lists'>&2; \
exit 1; } || :
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
# with the strings from the two affected variables.
dd_c = $(srcdir)/src/dd.c
sc_dd_max_sym_length:
ifneq ($(wildcard $(dd_c)),)
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|tr -d '"' | wc --max-line-length); \
if test "$$len" = "$$max"; then :; else \
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
exit 1; \
fi
endif
# Many m4 macros names once began with `jm_'.
# On 2004-04-13, they were all changed to start with gl_ instead.
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
@grep -nE 'jm_[A-Z]' \
$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
# Ensure that each root-requiring test is run via the "check-root" rule.
sc_root_tests:
@if test -d tests \
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
t1=sc-root.expected; t2=sc-root.actual; \
grep -nl '^require_root_$$' \
$$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
$(srcdir)/tests/Makefile.am \
| sed 's/^ *//;/^root_tests =/d' \
| tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
diff -u $$t1 $$t2 || diff=1 || diff=; \
rm -f $$t1 $$t2; \
test "$$diff" \
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
exit 1; } || :; \
fi
# Ensure that the syntax_check_exceptions file list in Makefile.am
# stays in sync with corresponding files in the repository.
sce = syntax_check_exceptions
sc_x_sc_dist_check:
@test "$$( ($(VC_LIST) | sed -n '/^.x-sc_/p'; \
sed -n '/^$(sce) =[ ]*\\$$/,/[^\]$$/p' \
$(srcdir)/Makefile.am \
| sed 's/^ *//;/^$(sce) =/d' \
| tr -s '\012\\' ' ' | fmt -1 \
) | sort | uniq -u)" \
&& { echo 'Makefile.am: $(sce) mismatch' >&2; exit 1; } || :;
headers_with_interesting_macro_defs = \
exit.h \
fcntl_.h \
fnmatch_.h \
intprops.h \
inttypes_.h \
lchown.h \
openat.h \
stat-macros.h \
stdint_.h
# Create a list of regular expressions matching the names
# of macros that are guaranteed by parts of gnulib to be defined.
.re-defmac:
@(cd $(srcdir)/lib; \
for f in $(headers_with_interesting_macro_defs); do \
test -f $$f && \
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
done; \
) | sort -u \
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
| sed 's/^/^# *define /' \
> $@-t
@mv $@-t $@
# Don't define macros that we already get from gnulib header files.
sc_always_defined_macros: .re-defmac
@if test -f $(srcdir)/src/system.h; then \
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
grep -f .re-defmac $$($(VC_LIST)) \
&& { echo '$(ME): define the above via some gnulib .h file' \
1>&2; exit 1; } || :; \
fi
# Create a list of regular expressions matching the names
# of files included from system.h. Exclude a couple.
.re-list:
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
| grep -Ev 'sys/(param|file)\.h' \
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
> $@-t
@mv $@-t $@
# Files in src/ should not include directly any of
# the headers already included via system.h.
sc_system_h_headers: .re-list
@if test -f $(srcdir)/src/system.h; then \
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
grep -nE -f .re-list \
$$($(VC_LIST_EXCEPT) | grep '^src/') \
&& { echo '$(ME): the above are already included via system.h'\
1>&2; exit 1; } || :; \
fi
sc_sun_os_names:
@grep -nEi \
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
$$($(VC_LIST_EXCEPT)) && \
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
exit 1; } || :
ALL_RECURSIVE_TARGETS += sc_tight_scope
sc_tight_scope:
@$(MAKE) -C src $@
ALL_RECURSIVE_TARGETS += sc_check-AUTHORS
sc_check-AUTHORS:
@$(MAKE) -C src $@
# Perl-based tests used to exec perl from a #!/bin/sh script.
# Now they all start with #!/usr/bin/perl and the portability
# infrastructure is in tests/Makefile.am. Make sure no old-style
# script sneaks back in.
sc_no_exec_perl_coreutils:
@if test -f $(srcdir)/tests/Coreutils.pm; then \
grep '^exec *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) && \
{ echo 1>&2 '$(ME): found anachronistic Perl-based tests'; \
exit 1; } || :; \
fi
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
sc_strftime_check:
@if test -f $(srcdir)/src/date.c; then \
grep '^ %. ' $(srcdir)/src/date.c | sort \
| $(extract_char) > $@-src; \
{ echo N; \
info libc date calendar format | grep '^ `%.'\' \
| $(extract_char); } | sort > $@-info; \
diff -u $@-src $@-info || exit 1; \
rm -f $@-src $@-info; \
fi
# Indent only with spaces.
sc_prohibit_tab_based_indentation:
@re='^ * ' \
msg='TAB in indentation; use only spaces' \
$(_prohibit_regexp)
# Don't use "indent-tabs-mode: nil" anymore. No longer needed.
sc_prohibit_emacs__indent_tabs_mode__setting:
@re='^( *[*#] *)?indent-tabs-mode:' \
msg='use of emacs indent-tabs-mode: setting' \
$(_prohibit_regexp)
include $(srcdir)/dist-check.mk

1740
config.hin

File diff suppressed because it is too large Load Diff

55398
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +1,146 @@
dnl Process this file with autoconf to produce a configure script. -*-m4-*-
# -*- autoconf -*-
# Process this file with autoconf to produce a configure script.
dnl Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2005,
dnl 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# Copyright (C) 1991, 1993-2009 Free Software Foundation, Inc.
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
# 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 3 of the License, or
# (at your option) any later version.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
# 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.
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software Foundation,
dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
dnl Written by Jim Meyering.
AC_INIT([GNU coreutils],[5.90],[bug-coreutils@gnu.org])
AC_CONFIG_SRCDIR(src/ls.c)
AC_PREREQ([2.61])
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_HEADERS([config.h:config.hin])
# Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
# indicates that it is built from the 219th delta (in _some_ repository)
# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
AC_INIT([GNU coreutils],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-coreutils@gnu.org])
AB_INIT()
AM_INIT_AUTOMAKE([1.8.3 gnits dist-bzip2])
AC_CONFIG_SRCDIR([src/ls.c])
gl_DEFAULT_POSIX2_VERSION
gl_USE_SYSTEM_EXTENSIONS
gl_PERL
AC_PROG_CC
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_RANLIB
AC_PROG_LN_S
gl_EARLY
gl_INIT
coreutils_MACROS
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],
[case $enableval in
yes|no) ;;
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
esac
gl_gcc_warnings=$enableval],
[gl_gcc_warnings=no]
)
AC_CHECK_FUNCS(uname,
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)"
MAN="$MAN uname.1")
AC_CHECK_FUNCS(chroot,
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)"
MAN="$MAN chroot.1")
AC_CHECK_FUNCS(gethostid,
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)"
MAN="$MAN hostid.1")
if test "$gl_gcc_warnings" = yes; then
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
AC_SUBST([WERROR_CFLAGS])
gl_MACROS
nw=
# This, $nw, is the list of warnings we disable.
nw="$nw -Wdeclaration-after-statement" # too useful to forbid
nw="$nw -Waggregate-return" # anachronistic
nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
nw="$nw -Wc++-compat" # We don't care about C++ compilers
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wcast-qual" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wunreachable-code" # Too many warnings for now
nw="$nw -Wpadded" # Our structs are not padded
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
nw="$nw -Wlogical-op" # any use of fwrite provokes this
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
nw="$nw -Wvla" # warnings in gettext.h
nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
nw="$nw -Wswitch-enum" # Too many warnings for now
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Wstack-protector" # not worth working around
# things I might fix soon:
nw="$nw -Wfloat-equal" # sort.c, seq.c
nw="$nw -Wmissing-format-attribute" # copy.c
nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
nw="$nw -Wstrict-overflow" # expr.c, pr.c, tr.c, factor.c
# ?? -Wstrict-overflow
gl_MANYWARN_ALL_GCC([ws])
gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
for w in $ws; do
gl_WARN_ADD([$w])
done
gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
# In spite of excluding -Wlogical-op above, it is enabled, as of
# gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
gl_WARN_ADD([-Wno-logical-op])
gl_WARN_ADD([-fdiagnostics-show-option])
AC_SUBST([WARN_CFLAGS])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
AC_DEFINE([_FORTIFY_SOURCE], [2],
[enable compile-time and run-time bounds-checking, and some warnings])
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
fi
AC_FUNC_FORK
optional_bin_progs=
AC_CHECK_FUNCS([chroot],
gl_ADD_PROG([optional_bin_progs], [chroot]))
AC_CHECK_FUNCS([gethostid],
gl_ADD_PROG([optional_bin_progs], [hostid]))
gl_WINSIZE_IN_PTEM
AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(utils_cv_localtime_cache,
AC_MSG_CHECKING([whether localtime caches TZ])
AC_CACHE_VAL([utils_cv_localtime_cache],
[if test x$ac_cv_func_tzset = xyes; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
extern char **environ;
unset_TZ ()
void unset_TZ (void)
{
char **from, **to;
for (to = from = environ; (*to = *from); from++)
if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
to++;
}
main()
int main()
{
time_t now = time ((time_t *) 0);
int hour_GMT0, hour_unset;
@@ -90,26 +163,26 @@ main()
[# If we have tzset, assume the worst when cross-compiling.
utils_cv_localtime_cache=yes])
else
# If we lack tzset, report that localtime does not cache TZ,
# since we can't invalidate the cache if we don't have tzset.
utils_cv_localtime_cache=no
# If we lack tzset, report that localtime does not cache TZ,
# since we can't invalidate the cache if we don't have tzset.
utils_cv_localtime_cache=no
fi])dnl
AC_MSG_RESULT($utils_cv_localtime_cache)
AC_MSG_RESULT([$utils_cv_localtime_cache])
if test $utils_cv_localtime_cache = yes; then
AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
AC_DEFINE([LOCALTIME_CACHE], [1], [FIXME])
fi
# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
AC_CHECK_FUNCS(initgroups)
AC_CHECK_FUNCS([initgroups])
if test $ac_cv_func_initgroups = no; then
AC_CHECK_LIB(os, initgroups)
AC_CHECK_LIB([os], [initgroups])
fi
AC_CHECK_FUNCS(syslog)
AC_CHECK_FUNCS([syslog])
if test $ac_cv_func_syslog = no; then
# syslog is not in the default libraries. See if it's in some other.
for lib in bsd socket inet; do
AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
AC_CHECK_LIB([$lib], [syslog], [AC_DEFINE([HAVE_SYSLOG], [1], [FIXME])
LIBS="$LIBS -l$lib"; break])
done
fi
@@ -119,7 +192,7 @@ AC_CACHE_CHECK([for 3-argument setpriority function],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/time.h>
#include <sys/resource.h>
#include <sys/resource.h>
]],
[[setpriority (0, 0, 0);]])],
[utils_cv_func_setpriority=yes],
@@ -129,86 +202,82 @@ if test $utils_cv_func_setpriority = no; then
fi
case $utils_cv_func_setpriority,$ac_cv_func_nice in
*yes*)
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
MAN="$MAN nice.1";;
gl_ADD_PROG([optional_bin_progs], [nice])
esac
AC_DEFUN([coreutils_DUMMY_1],
[
AC_REQUIRE([gl_READUTMP])
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)"
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)"
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)"
MAN="$MAN pinky.1 users.1 who.1"
gl_ADD_PROG([optional_bin_progs], [who])
gl_ADD_PROG([optional_bin_progs], [users])
gl_ADD_PROG([optional_bin_progs], [pinky])
fi
])
coreutils_DUMMY_1
AC_MSG_CHECKING(ut_host in struct utmp)
AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
AC_MSG_CHECKING([ut_host in struct utmp])
AC_CACHE_VAL([su_cv_func_ut_host_in_utmp],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],
#include <utmp.h>]], [[struct utmp ut; return !sizeof ut.ut_host;]])],
[su_cv_func_ut_host_in_utmp=yes],
[su_cv_func_ut_host_in_utmp=no])])
AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmp])
if test $su_cv_func_ut_host_in_utmp = yes; then
have_ut_host=1
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
fi
if test -z "$have_ut_host"; then
AC_MSG_CHECKING(ut_host in struct utmpx)
AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
AC_MSG_CHECKING([ut_host in struct utmpx])
AC_CACHE_VAL([su_cv_func_ut_host_in_utmpx],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <utmpx.h>]], [[struct utmpx ut; ut.ut_host;]])],
#include <utmpx.h>]], [[struct utmpx ut; return !sizeof ut.ut_host;]])],
[su_cv_func_ut_host_in_utmpx=yes],
[su_cv_func_ut_host_in_utmpx=no])])
AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmpx])
if test $su_cv_func_ut_host_in_utmpx = yes; then
AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
AC_DEFINE([HAVE_UTMPX_H], [1], [FIXME])
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
fi
fi
GNULIB_BOOT_TIME(
[OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
MAN="$MAN uptime.1"])
GNULIB_BOOT_TIME([gl_ADD_PROG([optional_bin_progs], [uptime])])
AC_SYS_POSIX_TERMIOS()
gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
if test $ac_cv_sys_posix_termios = yes; then
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1"
gl_ADD_PROG([optional_bin_progs], [stty])
AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE)
AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source,
[AC_EGREP_CPP(yes, [#include <termios.h>
AC_MSG_CHECKING([whether termios.h needs _XOPEN_SOURCE])
AC_CACHE_VAL([su_cv_sys_termios_needs_xopen_source],
[AC_EGREP_CPP([yes], [#include <termios.h>
#ifdef IUCLC
yes
#endif], su_cv_sys_termios_needs_xopen_source=no,
AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
AC_EGREP_CPP([yes], [#define _XOPEN_SOURCE
#include <termios.h>
#ifdef IUCLC
yes
#endif], su_cv_sys_termios_needs_xopen_source=yes,
su_cv_sys_termios_needs_xopen_source=no))])
AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
AC_MSG_RESULT([$su_cv_sys_termios_needs_xopen_source])
test $su_cv_sys_termios_needs_xopen_source = yes &&
AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], [1], [FIXME])
AC_MSG_CHECKING(c_line in struct termios)
AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
AC_MSG_CHECKING([c_line in struct termios])
AC_CACHE_VAL([su_cv_sys_c_line_in_termios],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif
#include <sys/types.h>
#include <termios.h>]], [[struct termios t; t.c_line;]])],
#include <termios.h>]], [[struct termios t; return !sizeof t.c_line;]])],
[su_cv_sys_c_line_in_termios=yes],
[su_cv_sys_c_line_in_termios=no])])
AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
AC_MSG_RESULT([$su_cv_sys_c_line_in_termios])
test $su_cv_sys_c_line_in_termios = yes \
&& AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
&& AC_DEFINE([HAVE_C_LINE], [1], [FIXME])
fi
# FIXME: note that this macro appears above, too.
@@ -217,10 +286,10 @@ gl_WINSIZE_IN_PTEM
gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H
if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h)
AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h,
if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
AC_MSG_CHECKING([TIOCGWINSZ in sys/pty.h])
AC_CACHE_VAL([su_cv_sys_tiocgwinsz_in_sys_pty_h],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef WINSIZE_IN_PTEM
# include <sys/stream.h>
@@ -231,10 +300,10 @@ if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
#include <sys/pty.h>]], [[int x = TIOCGWINSZ;]])],
[su_cv_sys_tiocgwinsz_in_sys_pty_h=yes],
[su_cv_sys_tiocgwinsz_in_sys_pty_h=no])])
AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
AC_MSG_RESULT([$su_cv_sys_tiocgwinsz_in_sys_pty_h])
test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
&& AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
&& AC_DEFINE([GWINSZ_IN_SYS_PTY], [1],
[Define if your system defines TIOCGWINSZ in sys/pty.h.])
fi
@@ -243,13 +312,117 @@ AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT
#include <signal.h>])
# For src/kill.c and src/printf.c.
AC_CHECK_DECLS([strtoimax, strtoumax])
cu_LIB_CHECK
cu_GMP
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.13.1)
# Build df only if there's a point to it.
if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
gl_ADD_PROG([optional_bin_progs], [df])
fi
# Limit stdbuf to ELF systems with GCC
optional_pkglib_progs=
AC_MSG_CHECKING([whether this is an ELF system])
AC_EGREP_CPP([yes], [#if __ELF__
yes
#endif], [elf_sys=yes], [elf_sys=no])
AC_MSG_RESULT([$elf_sys])
if test "$elf_sys" = "yes" && \
test "$GCC" = "yes"; then
gl_ADD_PROG([optional_bin_progs], [stdbuf])
gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so])
fi
############################################################################
mk="$srcdir/src/Makefile.am"
# Extract all literal names from the definition of $(EXTRA_PROGRAMS)
# in $mk but don't expand the variable references.
# Append each literal name to $optional_bin_progs.
v=EXTRA_PROGRAMS
for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
| tr -s '\\015\\012\\\\' ' '`; do
gl_ADD_PROG([optional_bin_progs], $gl_i)
done
# As above, extract literal names from the definition of $(no_install__progs)
# in $mk but don't expand the variable references.
v=no_install__progs
t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
| tr -s '\\015\\012\\\\' ' '`
# Remove any trailing space.
no_install_progs_default=`echo "$t"|sed 's/ $//'`
# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list
# of default-not-installed programs, "arch hostname su", must appear in two
# places: in this file below, and in $mk. Using "$no_install_progs_default"
# below cannot work. And we can't substitute the names into $mk because
# automake needs the literals, too.
# The compromise is to ensure that the space-separated list extracted
# above matches the literal 2nd argument below.
c="$srcdir/configure.ac"
re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])'
t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp
}' $c`
case $t in
$no_install_progs_default) ;;
*) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t,
does not match the list of default-not-installed programs
($no_install_progs_default) also recorded in $mk]],
1) ;;
esac
# Given the name of a variable containing a space-separated list of
# install-by-default programs and the actual list do-not-install-by-default
# programs, modify the former variable to reflect any "do-install" and
# "don't-install" requests.
# I.e., add any program name specified via --enable-install-program=..., and
# remove any program name specified via --enable-no-install-program=...
# Note how the second argument below is a literal, with "," separators.
# That is required due to the way the macro works, and since the
# corresponding ./configure option argument is comma-separated on input.
gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
# Set INSTALL_SU if su installation has been requested via
# --enable-install-program=su.
AC_SUBST([INSTALL_SU])
case " $optional_bin_progs " in
*' su '*) INSTALL_SU=yes ;;
*) INSTALL_SU=no ;;
esac
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
# Change ginstall.1 to "install.h" in $MAN.
MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
| tr '\015\012' ' '; echo`
# Remove [.1, since writing a portable rule for it in man/Makefile.am
# is not practical. The sed LHS below uses the autoconf quadrigraph
# representing '['.
MAN=`echo "$MAN"|sed 's/\@<:@\.1//'`
OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'`
AC_SUBST([OPTIONAL_BIN_PROGS])
OPTIONAL_PKGLIB_PROGS=`echo "$optional_pkglib_progs " | sed 's/ $//'`
AC_SUBST([OPTIONAL_PKGLIB_PROGS])
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
# Arrange to rerun configure whenever the file, src/Makefile.am,
# containing the list of program names changes.
CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am'
AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
############################################################################
AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.15])
# For a test of uniq: it uses the $LOCALE_FR envvar.
gt_LOCALE_FR
AC_CONFIG_FILES(
Makefile
@@ -259,49 +432,6 @@ AC_CONFIG_FILES(
po/Makefile.in
src/Makefile
tests/Makefile
tests/basename/Makefile
tests/chgrp/Makefile
tests/chmod/Makefile
tests/chown/Makefile
tests/cp/Makefile
tests/cut/Makefile
tests/dd/Makefile
tests/dircolors/Makefile
tests/du/Makefile
tests/expr/Makefile
tests/factor/Makefile
tests/fmt/Makefile
tests/head/Makefile
tests/install/Makefile
tests/join/Makefile
tests/ln/Makefile
tests/ls-2/Makefile
tests/ls/Makefile
tests/md5sum/Makefile
tests/misc/Makefile
tests/mkdir/Makefile
tests/mv/Makefile
tests/od/Makefile
tests/pr/Makefile
tests/readlink/Makefile
tests/rm/Makefile
tests/rmdir/Makefile
tests/seq/Makefile
tests/sha1sum/Makefile
tests/shred/Makefile
tests/sort/Makefile
tests/stty/Makefile
tests/sum/Makefile
tests/tac/Makefile
tests/tail-2/Makefile
tests/tail/Makefile
tests/tee/Makefile
tests/test/Makefile
tests/touch/Makefile
tests/tr/Makefile
tests/tsort/Makefile
tests/unexpand/Makefile
tests/uniq/Makefile
tests/wc/Makefile
gnulib-tests/Makefile
)
AC_OUTPUT

133
dist-check.mk Normal file
View File

@@ -0,0 +1,133 @@
# Most of this is probably too coreutils-centric to be useful to other packages.
bin=bin-$$$$
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
TMPDIR ?= /tmp
t=$(TMPDIR)/$(PACKAGE)/test
pfx=$(t)/i
# More than once, tainted build and source directory names would
# have caused at least one "make check" test to apply "chmod 700"
# to all directories under $HOME. Make sure it doesn't happen again.
tp := $(shell echo "$(TMPDIR)/$(PACKAGE)-$$$$")
t_prefix = $(tp)/a
t_taint = '$(t_prefix) b'
fake_home = $(tp)/home
# Ensure that tests run from tainted build and src dir names work,
# and don't affect anything in $HOME. Create witness files in $HOME,
# record their attributes, and build/test. Then ensure that the
# witnesses were not affected.
ALL_RECURSIVE_TARGETS += taint-distcheck
taint-distcheck: $(DIST_ARCHIVES)
test -d $(t_taint) && chmod -R 700 $(t_taint) || :
-rm -rf $(t_taint) $(fake_home)
mkdir -p $(t_prefix) $(t_taint) $(fake_home)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
mkfifo $(fake_home)/fifo
touch $(fake_home)/f
mkdir -p $(fake_home)/d/e
ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
cd $(t_taint)/$(distdir) \
&& ./configure \
&& $(MAKE) \
&& HOME=$(fake_home) $(MAKE) check \
&& ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
&& diff $(tp)/.ls-before $(tp)/.ls-after \
&& test -d $(t_prefix)
rm -rf $(tp)
# Verify that a twisted use of --program-transform-name=PROGRAM works.
define install-transform-check
echo running install-transform-check \
&& rm -rf $(pfx) \
&& $(MAKE) program_transform_name='s/.*/zyx/' \
prefix=$(pfx) install \
&& test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
&& test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
endef
# Install, then verify that all binaries and man pages are in place.
# Note that neither the binary, ginstall, nor the ].1 man page is installed.
define my-instcheck
$(MAKE) prefix=$(pfx) install \
&& test ! -f $(pfx)/bin/ginstall \
&& { fail=0; \
for i in $(built_programs); do \
test "$$i" = ginstall && i=install; \
for j in "$(pfx)/bin/$$i" \
"$(pfx)/share/man/man1/$$i.1"; do \
case $$j in *'[.1') continue;; esac; \
test -f "$$j" && : \
|| { echo "$$j not installed"; fail=1; }; \
done; \
done; \
test $$fail = 1 && exit 1 || :; \
}
endef
define coreutils-path-check
{ \
if test -f $(srcdir)/src/true.c; then \
fail=1; \
mkdir $(bin) \
&& ($(write_loser)) > $(bin)/loser \
&& chmod a+x $(bin)/loser \
&& for i in $(built_programs); do \
case $$i in \
rm|expr|basename|echo|sort|ls|tr);; \
cat|dirname|mv|wc);; \
*) ln $(bin)/loser $(bin)/$$i;; \
esac; \
done \
&& ln -sf ../src/true $(bin)/false \
&& PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH \
$(MAKE) -C tests check \
&& { test -d gnulib-tests \
&& $(MAKE) -C gnulib-tests check \
|| :; } \
&& rm -rf $(bin) \
&& fail=0; \
else \
fail=0; \
fi; \
test $$fail = 1 && exit 1 || :; \
}
endef
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
# Also, check for shadowing problems with -Wshadow, and for pointer
# arithmetic problems with -Wpointer-arith.
# These CFLAGS are pretty strict. If you build this target, you probably
# have to have a recent version of gcc and glibc headers.
# The hard-linking for-loop below ensures that there is a bin/ directory
# full of all of the programs under test (except the ones that are required
# for basic Makefile rules), all symlinked to the just-built "false" program.
# This is to ensure that if ever a test neglects to make PATH include
# the build srcdir, these always-failing programs will run.
# Otherwise, it is too easy to test the wrong programs.
# Note that "false" itself is a symlink to true, so it too will malfunction.
ALL_RECURSIVE_TARGETS += my-distcheck
my-distcheck: $(DIST_ARCHIVES) $(local-check)
$(MAKE) syntax-check
$(MAKE) check
-rm -rf $(t)
mkdir -p $(t)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
cd $(t)/$(distdir) \
&& ./configure --enable-gcc-warnings --disable-nls \
&& $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
&& $(MAKE) dvi \
&& $(install-transform-check) \
&& $(my-instcheck) \
&& $(coreutils-path-check) \
&& $(MAKE) distclean
(cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-rm -rf $(t)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"

View File

@@ -1,20 +1,22 @@
Makefile
constants.texi
coreutils.aux
coreutils.cm
coreutils.cp
coreutils.cps
coreutils.dvi
coreutils.fl
coreutils.fn
coreutils.html
coreutils.info
coreutils.info*
coreutils.ky
coreutils.log
coreutils.op
coreutils.pdf
coreutils.pg
coreutils.toc
coreutils.tp
coreutils.vr
fdl.texi
gendocs_template
getdate.texi
stamp-vti
version.texi
coreutils.tmp

View File

@@ -1,3 +1,530 @@
2007-10-05 Jim Meyering <jim@meyering.net>
* coreutils.texi (chroot invocation): List two systems on which
chroot works when run by non-root.
2007-09-19 Jim Meyering <jim@meyering.net>
* coreutils.texi (expr invocation): Correct description of relative
operator precedence. Reported by hanpingtian@gmail.com.
2007-08-25 Eric Blake <ebb9@byu.net>
Avoid case-insensitive clash in one-page-per-node html docs.
* coreutils.texi (Concept index): Rename from Index.
2007-07-15 Jim Meyering <jim@meyering.net>
* coreutils.texi: Revise node structure per new fdl.texi.
2007-06-06 Jim Meyering <jim@meyering.net>
* coreutils.texi (rmdir invocation): Fix a tiny typo.
2007-06-03 Jim Meyering <jim@meyering.net>
* constants.texi: Remove from version control.
This file has always been generated.
* .gitignore: Add constants.texi.
2007-04-28 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (nohup invocation): Add advice about saving
output to a file.
2007-04-16 Jim Meyering <jim@meyering.net>
* coreutils.texi (cut invocation): Adjust synopsis to show that an
OPTION is required. Reported by Rudolf Kastl.
2007-03-21 Eric Blake <ebb9@byu.net>
* coreutils.texi (md5sum invocation): Document escapes in output
format. Reported by Armijn Hemel.
2007-03-15 Paul Eggert <eggert@cs.ucla.edu>
Fix manual in response to bug reports by Dan Jacobson.
* coreutils.texi (sort invocation): Explain numeric sorts better.
Compress self-congratulation into a simple "comparison is exact"
notice; the --general-numeric-sort option already explains the
tradeoffs.
(seq invocation): Add example of -f.
2007-03-12 Jim Meyering <jim@meyering.net>
* coreutils.texi (cp invocation): Mention that --preserve=timestamps
doesn't preserve time stamps on symbolic links.
Reported by Polo Talnir in <https://bugzilla.redhat.com/230866>.
2007-02-27 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (df invocation): With -P, the default block size
and output format is not affected by DF_BLOCK_SIZE, BLOCK_SIZE, or
BLOCKSIZE.
2007-01-30 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi
(Input processing in ptx, mkdir invocation, rmdir invocation):
@item -> @itemx to fix some typos.
2007-01-30 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (mkdir invocation): Say how to set the file
permission bits of a parent directory with mkdir -p.
2007-01-29 Jim Meyering <jim@meyering.net>
Document new syntax: "chown +0:+287 file", "chgrp +99 file"
* coreutils.texi (Disambiguating names and IDs): New section.
(chown invocation, chgrp invocation): Mention the new syntax
with an xref to the new section.
2007-01-19 Jim Meyering <jim@meyering.net>
* coreutils.texi (ls: General output formatting): Mention the
workarounds to accommodate the Apple Terminal bug.
2007-01-04 Jim Meyering <jim@meyering.net>
* coreutils.texi (base64 invocation): When decoding, newlines
are always accepted.
2007-01-03 Jim Meyering <jim@meyering.net>
Document what the ".0" in e.g., "-k 2,3.0" means, and...
* coreutils.texi (sort invocation): ... that it can be applied to the
field-end spec, but not the field-start one. Patch from Evan Hunt.
2006-12-21 Jim Meyering <jim@meyering.net>
* coreutils.texi (dd invocation): Improve the documentation
for bs, ibs, obs, and cbs. Suggestion from Dan Jacobson.
Patch by Olivier Delhomme.
(dd invocation): Add to the description of cbs.
(dd invocation): Specify that bs=N overrides only any
_preceding_ ibs and obs settings. Spotted by Andreas Schwab.
2006-12-14 Jim Meyering <jim@meyering.net>
* coreutils.texi: Remove two doubled words.
(Treating / specially): With --preserve-root, chgrp and chown
will not modify "/", even through a symlink.
2006-11-28 Jim Meyering <jim@meyering.net>
* perm.texi (Mode Structure): Fix typo: s/setgid/setuid/.
Reported by Georg Neis as Debian bug 400778.
2006-10-27 Jim Meyering <jim@meyering.net>
* coreutils.texi (wc invocation): When giving the order in which
the various "counts" are listed, also mention "maximum line length".
Prompted by a report from Vincent LeFevre.
2006-10-23 Jim Meyering <jim@meyering.net>
* coreutils.texi (rm invocation): Describe --one-file-system.
2006-09-26 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (groups invocation): "groups" no longer prefixes
the output with "user :" unless more than one user is specified.
2006-09-19 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (cp invocation): Say that -i and -f are
independent. Clarify -i's behavior.
(Disk usage): Clarify intro. Problem reported by Van Ly.
2006-09-08 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (tail invocation): Ignore -f when standard input
is a FIFO, too.
2006-09-02 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (Treating / specially): --preserve-root is
now the default for rm.
(rm invocation): Likewise. Also, document that you can't
remove `.' or `..'. Use the POSIX term "root directory"
rather than the more-ambiguous "file system root".
2006-08-22 Paul Eggert <eggert@cs.ucla.edu>
* .cvsignore: Add Makefile.in, coreutils.html, coreutils.pdf,
coreutils.ps, coreutils.tps. Remove coreutils.cm (dunno what it
is, but the makefile doesn't mention it). Remove coreutils.info
as it is subsumed by coreutils.info*.
2006-08-22 Jim Meyering <jim@meyering.net>
* .cvsignore: Add files that are now generated by ../bootstrap.
2006-08-20 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in, fdl.texi, getdate.texi:
Remove from CVS, since ../bootstrap generates them automatically.
2006-08-17 Jim Meyering <jim@meyering.net>
* Makefile.am (EXTRA_DIST): Reflect doclicense.texi->fdl.texi renaming.
2006-08-17 Paul Eggert <eggert@cs.ucla.edu>
* ChangeLog: Add copyright notice.
* Makefile.am: Likewise.
* getdate.texi: Likewise.
* perm.texi: Likewise.
* getdate.texi: Update to version 1.2 of the GNU FDL.
* coreutils.texi: Likewise.
(Copying This Manual): Renamed from GNU Free Documentation License.
Now an appendix. Include fdl.texi rather than doclicense.texi.
* fdl.tex: Renamed from doclicense.texi. Latest version from FSF.
* perm.texi: Add copyright notice.
2006-08-15 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (df invocation): df exits nonzero if it outputs
nothing.
2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (dd invocation): Warn about oflag=append without
conv=notrunc. See Debian bug 373736.
2006-08-08 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (shuf invocation, Random sources): New sections.
(Operating on sorted files): Add shuf.
(sort invocation, shred invocation): New option --random-source.
(sort invocation): Fix typo: -R -> -r.
2006-07-28 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (install invocation, mkdir invocation):
Add cross-references to Directory Setuid and Setgid.
(install-invocation): The default mode is no longer equivalent to 755.
* perm.texi (Changing Special Mode Bits): Clarify u+s versus
a+s versus +s, and likewise for g+s.
(Numeric Modes): Bring back example of 0055 == 55. 4755 no
longer clears setgid bit on directories.
(Directory Setuid and Setgid): Numeric modes now affect setuid
and setgid on directories only if they set these bits. This
is so that leading 0 has no effect on numeric modes.
2006-07-26 Jim Meyering <jim@meyering.net>
* coreutils.texi (What information is listed): Mention that missing
pieces of information are marked with "?". From Paul Eggert.
2006-07-25 Paul Eggert <eggert@cs.ucla.edu>
* perm.texi (Directory Setuid and Setgid): Explain that this is a
GNU extension, and that other systems behave differently here.
2006-07-22 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (What information is listed): Clarify that the
restricted deletion flag is another name for the sticky bit.
* perm.texi (Mode Structure): The restricted deletion flag
restricts only unprivileged users.
(Mode Structure, Symbolic Modes, Numeric Modes): Be more careful
about distinguishing file mode bits from permissions bits,
and about execute versus search permission. The FreeBSD command
is chflags, not chrflags.
2006-07-16 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi: Change GNU to @acronym{GNU} in a few places.
Use "set-user-ID" and "set-group-ID" a bit more consistently.
Use "appropriate privileges" rather than "super-user" a bit
more consistently.
(install invocation): Parent directories are now 755 without uid
or gid changing. The default mode is now 0755, not 755.
(mkdir invocation): Rewrite the top-level usage description, since
I couldn't easily follow the old one. It's now 3 lines not 8.
For -m, describe file permission bits versus other bits, and note
that mkdir is atomic if you don't mention special bits.
(chmod invocation): Mention what chmod does to setgid and setuid bits.
* perm.texi (Mode Structure): Modernize the explanation of the
setuid and setgid bits on directories.
(Changing Special Mode Bits): Mention that a implies both u and g
for s. Cross reference to new node.
(Numeric Modes): Don't claim that 0055 is the same as 55; this isn't
true any more. Mention new node.
4755 is now like u=rwxs,go=rx,g-s, not like u=rwxs,go=rx.
(Directory Setuid and Setgid): New node.
2006-07-08 Jim Meyering <jim@meyering.net>
* coreutils.texi (Squeezing): Separate doubled "the", so typo-checkers
don't complain.
* Makefile.am (check-texinfo): Enforce the zeros vs. zeroes consistency.
2006-07-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* coreutils.texi: Fix some typos. Use `zeros' consistently (both
`zeros' and `zeroes' are correct).
2006-07-01 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (tail invocation): With no operand, 'tail -f' now
silently ignores the '-f' only if standard input is a FIFO or pipe
and POSIXLY_CORRECT is set.
2006-06-30 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (seq invocation): seq now uses long double
internally rather than double. It now defaults to a minimal fixed
point format if possible. It lets you use %a, %A, %E, %F, %G.
Don't assume printf doesn't work for numbers that fit in 64 but
not 32 bits; typically they work these days. Improve discussion
of large integers and update the rounding-error numbers.
2006-06-28 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (sort invocation): 'sort +1 -2' is now supported
even when conforming to POSIX 1003.1-2001, since this is a pure
extension to POSIX.
2006-06-27 Jim Meyering <jim@meyering.net>
* coreutils.texi (wc invocation): Remove ./ prefix from example.
From Padraig Brady.
2006-06-26 Jim Meyering <jim@meyering.net>
* coreutils.texi (wc invocation): Spell out `--files0-from' in
the example. Suggestion from Bob Proulx.
* coreutils.texi (wc invocation): Document new --files0-from option.
2006-06-20 Eric Blake <ebb9@byu.net>
* coreutils.texi (sleep invocation): Document that accepting
multiple arguments and suffixes are extensions.
Reported by Dan Jacobson.
2006-06-12 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.am (check-texinfo): Use $(_W) and $(W_) instead of
assuming grep -w (which is not portable).
2006-05-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.am: Use `AM_MAKEINFOFLAGS' rather than
overwriting `MAKEINFO', so that `missing' can do its job.
* Makefile.am (check-texinfo): Use `$(EGREP)' instead of `grep -E'.
(check-texinfo): Use literal `{' only in brackets, i.e., [{] or [}],
to avoid triggering an error from Solaris 2.6's grep.
2006-05-25 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (sort invocation): Remove mention of --seed, since
it's going away.
2006-05-04 Eric Blake <ebb9@byu.net>
* coreutils.texi (Examples of date): Give example of @seconds.
2006-05-03 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (head invocation, tail invocation, sort invocation):
Give advice about porting to hosts that support only obsolete syntax.
Problem reported by Zack Weinberg.
2006-04-23 Francesco Montorsi <fr_m@hotmail.com>
* coreutils.texi (Which files are listed): Describe new option:
--group-directories-first.
2006-04-17 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (What information is listed): Add P for Solaris
10 ports. Add commented-out entries for other types that POSIX
says are possible, or that I observed in FreeBSD documentation.
2006-04-18 Jim Meyering <jim@meyering.net>
* coreutils.texi (Input processing in ptx): Remove mention of the
default --ignore file, /usr/local/lib/eign. That file has never
been used. Reported by Eric Blake.
2006-04-12 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (expr invocation): expr exit status is 3 only for
internal errors now; 2 is also for invalid values in expressions.
(What information is listed): Document 'ls' type letters.
Problem reported by Lincoln Martin.
2006-04-09 Ori Avtalion <oavtal@bezeqint.net>
* coreutils.texi (Top): Add 'hostid' to System context menu line.
(trivial change)
2006-03-22 Eric Blake <ebb9@byu.net>
* coreutils.texi (General options in ptx): Undocument --copyright.
2006-03-27 Eric Blake <ebb9@byu.net>
* coreutils.texi (dirname invocation): Macro in previous patch
was too broad.
2006-03-11 Eric Blake <ebb9@byu.net>
* coreutils.texi (basename invocation, dirname invocation):
Improve documentation to match recent // patches.
2006-03-23 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (nohup invocation): nohup now redirects stderr to
nohup.out if stdout is closed and stderr is a tty.
2006-03-05 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (dd invocation): New flags directory, nolinks.
Alphabetize nofollow.
2006-02-17 Simon Josefsson <jas@extundo.com>
* coreutils.texi: Add base64 section.
2006-02-20 Eric Blake <ebb9@byu.net>
* coreutils.texi (rm invocation): Fix typo in last patch.
(paste invocation): Fix whitespace.
2006-02-18 Eric Blake <ebb9@byu.net>
* coreutils.texi (rm invocation): Document new -I option, and new
--interactive behavior.
2006-02-12 Jim Meyering <jim@meyering.net>
* coreutils.texi (Character sets): Don't say that an unknown
backslash-escape causes an error message -- it doesn't.
Mention that `\' also removes any special significance, so
is useful for [, ], *, -. Prompted by Richard Neill in
http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=14937
2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (od invocation): Warn that -t a ignores the high
order bit.
2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (tail invocation): In the obsolete usage, the
count is optional, so put square brackets around it.
2006-01-02 Paul Eggert <eggert@cs.ucla.edu>
* getdate.texi (General date syntax): Invalid dates are rejected.
(Time of day items): Mention the possibility of leap seconds.
Problem reported by Dr. David Alan Gilbert.
* coreutils.texi: Use @acronym around "ISO" uniformly.
(Date conversion specifiers): Explain %g, %G, and %V a bit better.
2006-01-02 Jim Meyering <jim@meyering.net>
* coreutils.texi (tail invocation): Say that --retry
is useful `mainly' (not `only') when following by name.
2006-01-01 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi, perm.texi: Clarify file mode bits versus
file permission bits.
* coreutils.texi (mkfifo invocation, mknod invocation): -m
affects only file permission bits.
2005-12-29 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (sort invocation): Clarify that a blank is a space
or a tab.
2005-12-15 Jim Meyering <jim@meyering.net>
* coreutils.texi (stat invocation) [--printf]: Describe new option.
[--format]: Add example. Distinguish from --printf.
Sort option descriptions.
2005-12-05 Andreas Gruenbacher <agruen@suse.de>
* coreutils.texi (ls): Clarify the Alternate Access Method description.
(cp): Clarify that --preserve=mode also preserves acls.
2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (sort invocation): Clarify explanation of
--random-sort, and use a simpler example.
2005-12-10 Frederik Eaton <frederik@ofb.net>
* coreutils.texi (sort invocation): Add --random-sort (-R) and --seed.
2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (dd invocation): New noatime flag.
2005-11-25 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (df invocation): Document treatment of dummy file
systems better.
2005-11-16 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (ln invocation): ln -v now outputs lines only for
successful links.
(tail invocation): Say that the obsolete form uses exactly one
option and at most one file.
2005-11-13 Jim Meyering <jim@meyering.net>
* perm.texi (Mode Structure): Capitalize two sentences in an
enumerated list and fix a typo. From Aaron Hawley.
2005-11-08 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (Formatting file timestamps): ls now defaults to
--time-style='locale', which in turn acts like
--time-style='posix-long-iso' if the locale settings are messed up.
2005-11-02 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (rm invocation): Don't mention --directory (-d).
2005-11-01 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (tail invocation): Describe obsolete usages
like "tail -2" more precisely.
(touch invocation): The old usage works only for 1969-1999 now.
2005-08-28 David Madore <david.madore@ens.fr>
* coreutils.texi: Document SHA-1 and SHA-2 utilities.
2005-10-15 Paul Eggert <eggert@cs.ucla.edu>
* doc/coreutils.texi (Top, General output formatting, dir invocation):
(vdir invocation): Don't document the old v and d commands.
2005-10-15 Jim Meyering <jim@meyering.net>
* coreutils.texi (du invocation): Document du's -m option,
now that we've decided to keep it.
(who invocation): Remove documentation for deprecated --idle (-i).
2005-10-13 Jim Meyering <jim@meyering.net>
* coreutils.texi: Avoid a few overfull/underfull hboxes.
2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (touch invocation):
@@ -1471,3 +1998,12 @@
(DISABLED_constants.texi): New rule -- disabled for now.
This directory is now shared by fileutils, textutils, and sh-utils.
-----
Copyright (C) 2001-2009 Free Software Foundation, Inc.
Copying and distribution of this file, with or without
modification, are permitted provided the copyright notice
and this notice are preserved.

View File

@@ -1,7 +1,23 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
# Make coreutils documentation. -*-Makefile-*-
# Copyright (C) 1995-1998, 2001-2009 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
# the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
info_TEXINFOS = coreutils.texi
EXTRA_DIST = perm.texi getdate.texi constants.texi doclicense.texi
EXTRA_DIST = perm.texi getdate.texi constants.texi fdl.texi
# The following is necessary if the package name is 8 characters or longer.
# If the info documentation would be split into 10 or more separate files,
@@ -11,12 +27,15 @@ EXTRA_DIST = perm.texi getdate.texi constants.texi doclicense.texi
# Otherwise, it would also generate files with names like <package>.info-[123],
# and those names all map to one 14-byte name (<package>.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split
AM_MAKEINFOFLAGS = --no-split
constants.texi: $(top_srcdir)/src/tail.c
constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c
LC_ALL=C \
sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \
$(top_srcdir)/src/tail.c > t-$@
LC_ALL=C \
sed -n -e 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\
$(top_srcdir)/src/shred.c >> t-$@
mv t-$@ $@
MAINTAINERCLEANFILES = constants.texi
@@ -28,26 +47,75 @@ $(INFO_DEPS): $(EXTRA_DIST)
_W = (^|[^A-Za-z0-9_])
W_ = ([^A-Za-z0-9_]|$$)
syntax_checks = \
sc-avoid-io \
sc-avoid-non-zero \
sc-avoid-timezone \
sc-avoid-zeroes \
sc-exponent-grouping \
sc-lower-case-var \
sc-use-small-caps-NUL
.PHONY: $(syntax_checks) check-texinfo
# List words/regexps here that should not appear in the texinfo documentation.
# E.g., use @sc{nul}, not `NUL'
# and use `time zone', not `timezone'.
check-texinfo:
fail=0; \
grep timezone $(srcdir)/*.texi && fail=1; \
$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \
grep non-zero $(srcdir)/*.texi && fail=1; \
grep '@url{' $(srcdir)/*.texi && fail=1; \
$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
grep -n filename $(srcdir)/*.texi|grep -vE 'setfilename|{filename}' \
&& fail=1; \
$(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
check-texinfo: $(syntax_checks)
$(AM_V_GEN)fail=0; \
grep '@url{' $(srcdir)/*.texi && fail=1; \
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
grep -n filename $(srcdir)/*.texi \
| $(EGREP) -v 'setfilename|[{]filename[}]' \
&& fail=1; \
$(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
'/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
grep -iwE 'builtins?' $(srcdir)/*.texi && fail=1; \
grep -iwE 'path(name)?s?' $(srcdir)/*.texi \
| grep -vE '@vindex PATH$$|@env{PATH}' && fail=1; \
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
$(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \
$(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \
| $(EGREP) -v 'search path|@vindex PATH$$|@env[{]PATH[}]' && fail=1; \
exit $$fail
# Use `time zone', not `timezone'.
sc-avoid-timezone:
$(AM_V_GEN)$(EGREP) timezone $(srcdir)/*.texi && exit 1 || :
# Check for insufficient exponent grouping, e.g.,
# @math{2^64} should be @math{2^{64}}.
sc-exponent-grouping:
$(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(srcdir)/*.texi && exit 1 || :
# E.g., use @sc{nul}, not NUL.
sc-use-small-caps-NUL:
$(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || :
# Say I/O, not IO.
sc-avoid-io:
$(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && exit 1 || :
# I prefer nonzero over non-zero.
sc-avoid-non-zero:
$(AM_V_GEN)$(EGREP) non-zero $(srcdir)/*.texi && exit 1 || :
# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
sc-avoid-zeroes:
$(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || :
# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ME = doc/Makefile
# The quantity inside @var{...} should not contain upper case letters.
# The leading backslash exemption is to permit in-macro uses like
# @var{\varName\} where the upper case letter is part of a parameter name.
find_upper_case_var = \
'/\@var{/ or next; \
while (/\@var{(.+?)}/g) \
{ \
$$v = $$1; \
$$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \
} \
END {$$m and (warn "$(ME): do not use upper case in \@var{...}\n"), exit 1}'
sc-lower-case-var:
$(AM_V_GEN)$(PERL) -e 1 \
&& $(PERL) -lne $(find_upper_case_var) $(srcdir)/*.texi
check: check-texinfo

View File

@@ -1,677 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/stamp-vti $(srcdir)/version.texi ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/afs.m4 \
$(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \
$(top_srcdir)/m4/argmatch.m4 $(top_srcdir)/m4/assert.m4 \
$(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/autobuild.m4 \
$(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/basename.m4 \
$(top_srcdir)/m4/bison.m4 $(top_srcdir)/m4/boottime.m4 \
$(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/calloc.m4 \
$(top_srcdir)/m4/canon-host.m4 \
$(top_srcdir)/m4/canonicalize.m4 \
$(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/check-decl.m4 \
$(top_srcdir)/m4/chown.m4 $(top_srcdir)/m4/clock_time.m4 \
$(top_srcdir)/m4/cloexec.m4 $(top_srcdir)/m4/closeout.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/cycle-check.m4 \
$(top_srcdir)/m4/d-ino.m4 $(top_srcdir)/m4/d-type.m4 \
$(top_srcdir)/m4/diacrit.m4 $(top_srcdir)/m4/dirfd.m4 \
$(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
$(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \
$(top_srcdir)/m4/euidaccess.m4 $(top_srcdir)/m4/exclude.m4 \
$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
$(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fd-reopen.m4 \
$(top_srcdir)/m4/file-type.m4 $(top_srcdir)/m4/fileblocks.m4 \
$(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/filenamecat.m4 \
$(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \
$(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/fstypename.m4 \
$(top_srcdir)/m4/fsusage.m4 $(top_srcdir)/m4/ftruncate.m4 \
$(top_srcdir)/m4/fts.m4 $(top_srcdir)/m4/getaddrinfo.m4 \
$(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
$(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/getdelim.m4 \
$(top_srcdir)/m4/getgroups.m4 $(top_srcdir)/m4/gethostname.m4 \
$(top_srcdir)/m4/gethrxtime.m4 $(top_srcdir)/m4/getline.m4 \
$(top_srcdir)/m4/getndelim2.m4 $(top_srcdir)/m4/getopt.m4 \
$(top_srcdir)/m4/getpagesize.m4 $(top_srcdir)/m4/getpass.m4 \
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettime.m4 \
$(top_srcdir)/m4/gettimeofday.m4 \
$(top_srcdir)/m4/getugroups.m4 \
$(top_srcdir)/m4/getusershell.m4 $(top_srcdir)/m4/glibc21.m4 \
$(top_srcdir)/m4/group-member.m4 \
$(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/hash-pjw.m4 \
$(top_srcdir)/m4/hash.m4 $(top_srcdir)/m4/host-os.m4 \
$(top_srcdir)/m4/human.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/idcache.m4 $(top_srcdir)/m4/intmax_t.m4 \
$(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes-pri.m4 \
$(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \
$(top_srcdir)/m4/jm-macros.m4 $(top_srcdir)/m4/jm-winsz1.m4 \
$(top_srcdir)/m4/jm-winsz2.m4 $(top_srcdir)/m4/lchown.m4 \
$(top_srcdir)/m4/lib-check.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/linebuffer.m4 $(top_srcdir)/m4/link-follow.m4 \
$(top_srcdir)/m4/localcharset.m4 \
$(top_srcdir)/m4/long-options.m4 \
$(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \
$(top_srcdir)/m4/ls-mntd-fs.m4 $(top_srcdir)/m4/lstat.m4 \
$(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
$(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
$(top_srcdir)/m4/mbswidth.m4 $(top_srcdir)/m4/md5.m4 \
$(top_srcdir)/m4/memcasecmp.m4 $(top_srcdir)/m4/memchr.m4 \
$(top_srcdir)/m4/memcmp.m4 $(top_srcdir)/m4/memcoll.m4 \
$(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \
$(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
$(top_srcdir)/m4/memset.m4 $(top_srcdir)/m4/mkdir-p.m4 \
$(top_srcdir)/m4/mkdir-slash.m4 $(top_srcdir)/m4/mkstemp.m4 \
$(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/modechange.m4 \
$(top_srcdir)/m4/mountlist.m4 $(top_srcdir)/m4/nanosleep.m4 \
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/obstack.m4 \
$(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/openat.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perl.m4 \
$(top_srcdir)/m4/physmem.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/posixtm.m4 $(top_srcdir)/m4/posixver.m4 \
$(top_srcdir)/m4/prereq.m4 $(top_srcdir)/m4/progtest.m4 \
$(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quote.m4 \
$(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \
$(top_srcdir)/m4/readtokens.m4 $(top_srcdir)/m4/readutmp.m4 \
$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
$(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/rmdir-errno.m4 \
$(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/root-dev-ino.m4 \
$(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/safe-read.m4 \
$(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/same.m4 \
$(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
$(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/settime.m4 \
$(top_srcdir)/m4/sha1.m4 $(top_srcdir)/m4/sig2str.m4 \
$(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/socklen.m4 \
$(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/ssize_t.m4 \
$(top_srcdir)/m4/st_dm_mode.m4 $(top_srcdir)/m4/stat-macros.m4 \
$(top_srcdir)/m4/stat-prog.m4 $(top_srcdir)/m4/stat-time.m4 \
$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint_h.m4 \
$(top_srcdir)/m4/stdio-safer.m4 \
$(top_srcdir)/m4/stdlib-safer.m4 $(top_srcdir)/m4/stpcpy.m4 \
$(top_srcdir)/m4/strcase.m4 $(top_srcdir)/m4/strcspn.m4 \
$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strftime.m4 \
$(top_srcdir)/m4/stripslash.m4 $(top_srcdir)/m4/strndup.m4 \
$(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strnumcmp.m4 \
$(top_srcdir)/m4/strpbrk.m4 $(top_srcdir)/m4/strstr.m4 \
$(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/strtoimax.m4 \
$(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \
$(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \
$(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/strverscmp.m4 \
$(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
$(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/uint32_t.m4 \
$(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/uintptr_t.m4 \
$(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
$(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
$(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
$(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
$(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
$(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
$(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
$(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
$(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
$(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \
$(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xfts.m4 \
$(top_srcdir)/m4/xgetcwd.m4 $(top_srcdir)/m4/xnanosleep.m4 \
$(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xstrtod.m4 \
$(top_srcdir)/m4/xstrtoimax.m4 $(top_srcdir)/m4/xstrtol.m4 \
$(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/m4/yesno.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
INFO_DEPS = $(srcdir)/coreutils.info
TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
DVIS = coreutils.dvi
PDFS = coreutils.pdf
PSS = coreutils.ps
HTMLS = coreutils.html
TEXINFOS = coreutils.texi
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
am__installdirs = "$(DESTDIR)$(infodir)"
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALLOCA_H = @ALLOCA_H@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFAULT_POSIX2_VERSION = @DEFAULT_POSIX2_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EOVERFLOW = @EOVERFLOW@
EXEEXT = @EXEEXT@
FNMATCH_H = @FNMATCH_H@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_H = @GETOPT_H@
GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
GREP = @GREP@
HAVE__BOOL = @HAVE__BOOL@
HELP2MAN = @HELP2MAN@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
KMEM_GROUP = @KMEM_GROUP@
LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_EACCESS = @LIB_EACCESS@
LIB_FDATASYNC = @LIB_FDATASYNC@
LIB_GETHRXTIME = @LIB_GETHRXTIME@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
# The following is necessary if the package name is 8 characters or longer.
# If the info documentation would be split into 10 or more separate files,
# then this is necessary even if the package name is 7 characters long.
#
# Tell makeinfo to put everything in a single info file: <package>.info.
# Otherwise, it would also generate files with names like <package>.info-[123],
# and those names all map to one 14-byte name (<package>.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
NEED_SETGID = @NEED_SETGID@
OBJEXT = @OBJEXT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSUB = @POSUB@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
U = @U@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
info_TEXINFOS = coreutils.texi
EXTRA_DIST = perm.texi getdate.texi constants.texi doclicense.texi
MAINTAINERCLEANFILES = constants.texi
# Extended regular expressions to match word starts and ends.
_W = (^|[^A-Za-z0-9_])
W_ = ([^A-Za-z0-9_]|$$)
all: all-am
.SUFFIXES:
.SUFFIXES: .dvi .html .info .pdf .ps .texi
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
.texi.info:
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && cd $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$$am__cwd"; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $@ $<; \
then \
rc=0; \
cd $(srcdir); \
else \
rc=$$?; \
cd $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
.texi.dvi:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) $<
.texi.pdf:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2PDF) $<
.texi.html:
rm -rf $(@:.html=.htp)
if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
-o $(@:.html=.htp) $<; \
then \
rm -rf $@; \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
else \
if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
$(srcdir)/coreutils.info: coreutils.texi $(srcdir)/version.texi
coreutils.dvi: coreutils.texi $(srcdir)/version.texi
coreutils.pdf: coreutils.texi $(srcdir)/version.texi
coreutils.html: coreutils.texi $(srcdir)/version.texi
$(srcdir)/version.texi: $(srcdir)/stamp-vti
$(srcdir)/stamp-vti: coreutils.texi $(top_srcdir)/configure
@(dir=.; test -f ./coreutils.texi || dir=$(srcdir); \
set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/coreutils.texi`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > vti.tmp
@cmp -s vti.tmp $(srcdir)/version.texi \
|| (echo "Updating $(srcdir)/version.texi"; \
cp vti.tmp $(srcdir)/version.texi)
-@rm -f vti.tmp
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
-rm -f vti.tmp
maintainer-clean-vti:
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
.dvi.ps:
TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) -o $@ $<
uninstall-info-am:
@$(PRE_UNINSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if cd "$(DESTDIR)$(infodir)"; then \
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in $$d/$$base*; do \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f $(distdir)/$$relfile || \
cp -p $$file $(distdir)/$$relfile; \
done; \
done
mostlyclean-aminfo:
-rm -rf coreutils.aux coreutils.cp coreutils.cps coreutils.fl coreutils.fn \
coreutils.ky coreutils.log coreutils.op coreutils.pg \
coreutils.tmp coreutils.toc coreutils.tp coreutils.tps \
coreutils.vr coreutils.dvi coreutils.pdf coreutils.ps \
coreutils.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
check-am: all-am
check: check-am
all-am: Makefile $(INFO_DEPS)
installdirs:
for dir in "$(DESTDIR)$(infodir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am: $(DVIS)
html: html-am
html-am: $(HTMLS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am
install-exec-am:
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
$(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if (install-info --version && \
install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
pdf: pdf-am
pdf-am: $(PDFS)
ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic dist-info \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-exec install-exec-am install-info install-info-am \
install-man install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti mostlyclean \
mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \
pdf-am ps ps-am uninstall uninstall-am uninstall-info-am
constants.texi: $(top_srcdir)/src/tail.c
LC_ALL=C \
sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \
$(top_srcdir)/src/tail.c > t-$@
mv t-$@ $@
$(DVIS): $(EXTRA_DIST)
$(INFO_DEPS): $(EXTRA_DIST)
# List words/regexps here that should not appear in the texinfo documentation.
# E.g., use @sc{nul}, not `NUL'
# and use `time zone', not `timezone'.
check-texinfo:
fail=0; \
grep timezone $(srcdir)/*.texi && fail=1; \
$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \
grep non-zero $(srcdir)/*.texi && fail=1; \
grep '@url{' $(srcdir)/*.texi && fail=1; \
$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
grep -n filename $(srcdir)/*.texi|grep -vE 'setfilename|{filename}' \
&& fail=1; \
$(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
'/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
grep -iwE 'builtins?' $(srcdir)/*.texi && fail=1; \
grep -iwE 'path(name)?s?' $(srcdir)/*.texi \
| grep -vE '@vindex PATH$$|@env{PATH}' && fail=1; \
exit $$fail
check: check-texinfo
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,8 +0,0 @@
perl -pi -e \
's/\@code\{('"$(echo cp dd df dir dircolors du install ln ls mkdir mkfifo mknod mv shred touch vdir|tr ' ' '|')"')\}/\@command{$1}/' coreutils.texi
perl -pi -e \
's/\@code\{('"$(echo cp dd df dir dircolors du install ln ls mkdir mkfifo mknod mv shred touch vdir|tr ' ' '|')"')\}/\@command{$1}/' coreutils.texi
regex=$((textutils; shellutils) | tr -s ' ' '|')
perl -pi -e 's/\@code\{('"$regex"')\}/\@command{$1}/' coreutils.texi

View File

@@ -1 +0,0 @@
@set DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS 5

File diff suppressed because it is too large Load Diff

View File

@@ -1,395 +0,0 @@
@c -*-texinfo-*-
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@center Version 1.1, March 2000
@ifnottex
@menu
* How to use this License for your documents::
@end menu
@end ifnottex
@display
Copyright (C) 2000 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@iftex
@sp1
@end iftex
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
written document ``free'' in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@iftex
@sp1
@end iftex
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The ``Document'', below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as ``you''.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
@iftex
@sp1
@end iftex
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@iftex
@sp1
@end iftex
@item
COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@iftex
@sp1
@end iftex
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.@*
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).@*
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.@*
D. Preserve all the copyright notices of the Document.@*
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.@*
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.@*
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.@*
H. Include an unaltered copy of this License.@*
I. Preserve the section entitled ``History'', and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.@*
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.@*
K. In any section entitled ``Acknowledgements'' or ``Dedications'',
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.@*
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.@*
M. Delete any section entitled ``Endorsements''. Such a section
may not be included in the Modified Version.@*
N. Do not retitle any existing section as ``Endorsements''
or to conflict in title with any Invariant Section.@*
@iftex
@sp1
@end iftex
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@iftex
@sp1
@end iftex
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled ``History''
in the various original documents, forming one section entitled
``History''; likewise combine any sections entitled ``Acknowledgements'',
and any sections entitled ``Dedications''. You must delete all sections
entitled ``Endorsements.''
@iftex
@sp1
@end iftex
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@iftex
@sp1
@end iftex
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an ``aggregate'', and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.
@iftex
@sp1
@end iftex
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.
@iftex
@sp1
@end iftex
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@iftex
@sp1
@end iftex
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@node How to use this License for your documents
@unnumberedsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being @var{list their titles}, with the
Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have no Invariant Sections, write ``with no Invariant Sections''
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write ``no Front-Cover Texts'' instead of
``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

View File

@@ -1,547 +0,0 @@
@c GNU date syntax documentation
@c Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@c 2003, 2004, 2005 Free Software Foundation, Inc.
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.1 or
@c any later version published by the Free Software Foundation; with no
@c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
@c Texts. A copy of the license is included in the ``GNU Free
@c Documentation License'' file as part of this distribution.
@node Date input formats
@chapter Date input formats
@cindex date input formats
@findex get_date
First, a quote:
@quotation
Our units of temporal measurement, from seconds on up to months, are so
complicated, asymmetrical and disjunctive so as to make coherent mental
reckoning in time all but impossible. Indeed, had some tyrannical god
contrived to enslave our minds to time, to make it all but impossible
for us to escape subjection to sodden routines and unpleasant surprises,
he could hardly have done better than handing down our present system.
It is like a set of trapezoidal building blocks, with no vertical or
horizontal surfaces, like a language in which the simplest thought
demands ornate constructions, useless particles and lengthy
circumlocutions. Unlike the more successful patterns of language and
science, which enable us to face experience boldly or at least
level-headedly, our system of temporal calculation silently and
persistently encourages our terror of time.
@dots{} It is as though architects had to measure length in feet, width
in meters and height in ells; as though basic instruction manuals
demanded a knowledge of five different languages. It is no wonder then
that we often look into our own immediate past or future, last Tuesday
or a week from Sunday, with feelings of helpless confusion. @dots{}
--- Robert Grudin, @cite{Time and the Art of Living}.
@end quotation
This section describes the textual date representations that @sc{gnu}
programs accept. These are the strings you, as a user, can supply as
arguments to the various programs. The C interface (via the
@code{get_date} function) is not described here.
@menu
* General date syntax:: Common rules.
* Calendar date items:: 19 Dec 1994.
* Time of day items:: 9:20pm.
* Time zone items:: @sc{est}, @sc{pdt}, @sc{gmt}.
* Day of week items:: Monday and others.
* Relative items in date strings:: next tuesday, 2 years ago.
* Pure numbers in date strings:: 19931219, 1440.
* Seconds since the Epoch:: @@1078100502.
* Specifying time zone rules:: TZ="America/New_York", TZ="UTC0".
* Authors of get_date:: Bellovin, Eggert, Salz, Berets, et al.
@end menu
@node General date syntax
@section General date syntax
@cindex general date syntax
@cindex items in date strings
A @dfn{date} is a string, possibly empty, containing many items
separated by whitespace. The whitespace may be omitted when no
ambiguity arises. The empty string means the beginning of today (i.e.,
midnight). Order of the items is immaterial. A date string may contain
many flavors of items:
@itemize @bullet
@item calendar date items
@item time of day items
@item time zone items
@item day of the week items
@item relative items
@item pure numbers.
@end itemize
@noindent We describe each of these item types in turn, below.
@cindex numbers, written-out
@cindex ordinal numbers
@findex first @r{in date strings}
@findex next @r{in date strings}
@findex last @r{in date strings}
A few ordinal numbers may be written out in words in some contexts. This is
most useful for specifying day of the week items or relative items (see
below). Among the most commonly used ordinal numbers, the word
@samp{last} stands for @math{-1}, @samp{this} stands for 0, and
@samp{first} and @samp{next} both stand for 1. Because the word
@samp{second} stands for the unit of time there is no way to write the
ordinal number 2, but for convenience @samp{third} stands for 3,
@samp{fourth} for 4, @samp{fifth} for 5,
@samp{sixth} for 6, @samp{seventh} for 7, @samp{eighth} for 8,
@samp{ninth} for 9, @samp{tenth} for 10, @samp{eleventh} for 11 and
@samp{twelfth} for 12.
@cindex months, written-out
When a month is written this way, it is still considered to be written
numerically, instead of being ``spelled in full''; this changes the
allowed strings.
@cindex language, in dates
In the current implementation, only English is supported for words and
abbreviations like @samp{AM}, @samp{DST}, @samp{EST}, @samp{first},
@samp{January}, @samp{Sunday}, @samp{tomorrow}, and @samp{year}.
@cindex language, in dates
@cindex time zone item
The output of the @command{date} command
is not always acceptable as a date string,
not only because of the language problem, but also because there is no
standard meaning for time zone items like @samp{IST}. When using
@command{date} to generate a date string intended to be parsed later,
specify a date format that is independent of language and that does not
use time zone items other than @samp{UTC} and @samp{Z}. Here are some
ways to do this:
@example
$ LC_ALL=C TZ=UTC0 date
Mon Mar 1 00:21:42 UTC 2004
$ TZ=UTC0 date +'%Y-%m-%d %H:%M:%SZ'
2004-03-01 00:21:42Z
$ date --iso-8601=ns | tr T ' ' # --iso-8601 is a GNU extension.
2004-02-29 16:21:42,692722128-0800
$ date --rfc-2822 # a GNU extension
Sun, 29 Feb 2004 16:21:42 -0800
$ date +'%Y-%m-%d %H:%M:%S %z' # %z is a GNU extension.
2004-02-29 16:21:42 -0800
$ date +'@@%s.%N' # %s and %N are GNU extensions.
@@1078100502.692722128
@end example
@cindex case, ignored in dates
@cindex comments, in dates
Alphabetic case is completely ignored in dates. Comments may be introduced
between round parentheses, as long as included parentheses are properly
nested. Hyphens not followed by a digit are currently ignored. Leading
zeros on numbers are ignored.
@node Calendar date items
@section Calendar date items
@cindex calendar date item
A @dfn{calendar date item} specifies a day of the year. It is
specified differently, depending on whether the month is specified
numerically or literally. All these strings specify the same calendar date:
@example
1972-09-24 # @sc{iso} 8601.
72-9-24 # Assume 19xx for 69 through 99,
# 20xx for 00 through 68.
72-09-24 # Leading zeros are ignored.
9/24/72 # Common U.S. writing.
24 September 1972
24 Sept 72 # September has a special abbreviation.
24 Sep 72 # Three-letter abbreviations always allowed.
Sep 24, 1972
24-sep-72
24sep72
@end example
The year can also be omitted. In this case, the last specified year is
used, or the current year if none. For example:
@example
9/24
sep 24
@end example
Here are the rules.
@cindex @sc{iso} 8601 date format
@cindex date format, @sc{iso} 8601
For numeric months, the @sc{iso} 8601 format
@samp{@var{year}-@var{month}-@var{day}} is allowed, where @var{year} is
any positive number, @var{month} is a number between 01 and 12, and
@var{day} is a number between 01 and 31. A leading zero must be present
if a number is less than ten. If @var{year} is 68 or smaller, then 2000
is added to it; otherwise, if @var{year} is less than 100,
then 1900 is added to it. The construct
@samp{@var{month}/@var{day}/@var{year}}, popular in the United States,
is accepted. Also @samp{@var{month}/@var{day}}, omitting the year.
@cindex month names in date strings
@cindex abbreviations for months
Literal months may be spelled out in full: @samp{January},
@samp{February}, @samp{March}, @samp{April}, @samp{May}, @samp{June},
@samp{July}, @samp{August}, @samp{September}, @samp{October},
@samp{November} or @samp{December}. Literal months may be abbreviated
to their first three letters, possibly followed by an abbreviating dot.
It is also permitted to write @samp{Sept} instead of @samp{September}.
When months are written literally, the calendar date may be given as any
of the following:
@example
@var{day} @var{month} @var{year}
@var{day} @var{month}
@var{month} @var{day} @var{year}
@var{day}-@var{month}-@var{year}
@end example
Or, omitting the year:
@example
@var{month} @var{day}
@end example
@node Time of day items
@section Time of day items
@cindex time of day item
A @dfn{time of day item} in date strings specifies the time on a given
day. Here are some examples, all of which represent the same time:
@example
20:02:00.000000
20:02
8:02pm
20:02-0500 # In @sc{est} (U.S. Eastern Standard Time).
@end example
More generally, the time of day may be given as
@samp{@var{hour}:@var{minute}:@var{second}}, where @var{hour} is
a number between 0 and 23, @var{minute} is a number between 0 and
59, and @var{second} is a number between 0 and 59 possibly followed by
@samp{.} or @samp{,} and a fraction containing one or more digits.
Alternatively,
@samp{:@var{second}} can be omitted, in which case it is taken to
be zero.
@findex am @r{in date strings}
@findex pm @r{in date strings}
@findex midnight @r{in date strings}
@findex noon @r{in date strings}
If the time is followed by @samp{am} or @samp{pm} (or @samp{a.m.}
or @samp{p.m.}), @var{hour} is restricted to run from 1 to 12, and
@samp{:@var{minute}} may be omitted (taken to be zero). @samp{am}
indicates the first half of the day, @samp{pm} indicates the second
half of the day. In this notation, 12 is the predecessor of 1:
midnight is @samp{12am} while noon is @samp{12pm}.
(This is the zero-oriented interpretation of @samp{12am} and @samp{12pm},
as opposed to the old tradition derived from Latin
which uses @samp{12m} for noon and @samp{12pm} for midnight.)
@cindex time zone correction
@cindex minutes, time zone correction by
The time may alternatively be followed by a time zone correction,
expressed as @samp{@var{s}@var{hh}@var{mm}}, where @var{s} is @samp{+}
or @samp{-}, @var{hh} is a number of zone hours and @var{mm} is a number
of zone minutes. You can also separate @var{hh} from @var{mm} with a colon.
When a time zone correction is given this way, it
forces interpretation of the time relative to
Coordinated Universal Time (@sc{utc}), overriding any previous
specification for the time zone or the local time zone. For example,
@samp{+0530} and @samp{+05:30} both stand for the time zone 5.5 hours
ahead of @sc{utc} (e.g., India). The @var{minute}
part of the time of day may not be elided when a time zone correction
is used. This is the best way to specify a time zone correction by
fractional parts of an hour.
Either @samp{am}/@samp{pm} or a time zone correction may be specified,
but not both.
@node Time zone items
@section Time zone items
@cindex time zone item
A @dfn{time zone item} specifies an international time zone, indicated
by a small set of letters, e.g., @samp{UTC} or @samp{Z}
for Coordinated Universal
Time. Any included periods are ignored. By following a
non-daylight-saving time zone by the string @samp{DST} in a separate
word (that is, separated by some white space), the corresponding
daylight saving time zone may be specified.
Alternatively, a non-daylight-saving time zone can be followed by a
time zone correction, to add the two values. This is normally done
only for @samp{UTC}; for example, @samp{UTC+05:30} is equivalent to
@samp{+05:30}.
Time zone items other than @samp{UTC} and @samp{Z}
are obsolescent and are not recommended, because they
are ambiguous; for example, @samp{EST} has a different meaning in
Australia than in the United States. Instead, it's better to use
unambiguous numeric time zone corrections like @samp{-0500}, as
described in the previous section.
If neither a time zone item nor a time zone correction is supplied,
time stamps are interpreted using the rules of the default time zone
(@pxref{Specifying time zone rules}).
@node Day of week items
@section Day of week items
@cindex day of week item
The explicit mention of a day of the week will forward the date
(only if necessary) to reach that day of the week in the future.
Days of the week may be spelled out in full: @samp{Sunday},
@samp{Monday}, @samp{Tuesday}, @samp{Wednesday}, @samp{Thursday},
@samp{Friday} or @samp{Saturday}. Days may be abbreviated to their
first three letters, optionally followed by a period. The special
abbreviations @samp{Tues} for @samp{Tuesday}, @samp{Wednes} for
@samp{Wednesday} and @samp{Thur} or @samp{Thurs} for @samp{Thursday} are
also allowed.
@findex next @var{day}
@findex last @var{day}
A number may precede a day of the week item to move forward
supplementary weeks. It is best used in expression like @samp{third
monday}. In this context, @samp{last @var{day}} or @samp{next
@var{day}} is also acceptable; they move one week before or after
the day that @var{day} by itself would represent.
A comma following a day of the week item is ignored.
@node Relative items in date strings
@section Relative items in date strings
@cindex relative items in date strings
@cindex displacement of dates
@dfn{Relative items} adjust a date (or the current date if none) forward
or backward. The effects of relative items accumulate. Here are some
examples:
@example
1 year
1 year ago
3 years
2 days
@end example
@findex year @r{in date strings}
@findex month @r{in date strings}
@findex fortnight @r{in date strings}
@findex week @r{in date strings}
@findex day @r{in date strings}
@findex hour @r{in date strings}
@findex minute @r{in date strings}
The unit of time displacement may be selected by the string @samp{year}
or @samp{month} for moving by whole years or months. These are fuzzy
units, as years and months are not all of equal duration. More precise
units are @samp{fortnight} which is worth 14 days, @samp{week} worth 7
days, @samp{day} worth 24 hours, @samp{hour} worth 60 minutes,
@samp{minute} or @samp{min} worth 60 seconds, and @samp{second} or
@samp{sec} worth one second. An @samp{s} suffix on these units is
accepted and ignored.
@findex ago @r{in date strings}
The unit of time may be preceded by a multiplier, given as an optionally
signed number. Unsigned numbers are taken as positively signed. No
number at all implies 1 for a multiplier. Following a relative item by
the string @samp{ago} is equivalent to preceding the unit by a
multiplier with value @math{-1}.
@findex day @r{in date strings}
@findex tomorrow @r{in date strings}
@findex yesterday @r{in date strings}
The string @samp{tomorrow} is worth one day in the future (equivalent
to @samp{day}), the string @samp{yesterday} is worth
one day in the past (equivalent to @samp{day ago}).
@findex now @r{in date strings}
@findex today @r{in date strings}
@findex this @r{in date strings}
The strings @samp{now} or @samp{today} are relative items corresponding
to zero-valued time displacement, these strings come from the fact
a zero-valued time displacement represents the current time when not
otherwise changed by previous items. They may be used to stress other
items, like in @samp{12:00 today}. The string @samp{this} also has
the meaning of a zero-valued time displacement, but is preferred in
date strings like @samp{this thursday}.
When a relative item causes the resulting date to cross a boundary
where the clocks were adjusted, typically for daylight saving time,
the resulting date and time are adjusted accordingly.
The fuzz in units can cause problems with relative items. For
example, @samp{2003-07-31 -1 month} might evaluate to 2003-07-01,
because 2003-06-31 is an invalid date. To determine the previous
month more reliably, you can ask for the month before the 15th of the
current month. For example:
@example
$ date -R
Thu, 31 Jul 2003 13:02:39 -0700
$ date --date='-1 month' +'Last month was %B?'
Last month was July?
$ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!'
Last month was June!
@end example
Also, take care when manipulating dates around clock changes such as
daylight saving leaps. In a few cases these have added or subtracted
as much as 24 hours from the clock, so it is often wise to adopt
universal time by setting the @env{TZ} environment variable to
@samp{UTC0} before embarking on calendrical calculations.
@node Pure numbers in date strings
@section Pure numbers in date strings
@cindex pure numbers in date strings
The precise interpretation of a pure decimal number depends
on the context in the date string.
If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and no
other calendar date item (@pxref{Calendar date items}) appears before it
in the date string, then @var{yyyy} is read as the year, @var{mm} as the
month number and @var{dd} as the day of the month, for the specified
calendar date.
If the decimal number is of the form @var{hh}@var{mm} and no other time
of day item appears before it in the date string, then @var{hh} is read
as the hour of the day and @var{mm} as the minute of the hour, for the
specified time of day. @var{mm} can also be omitted.
If both a calendar date and a time of day appear to the left of a number
in the date string, but no relative item, then the number overrides the
year.
@node Seconds since the Epoch
@section Seconds since the Epoch
If you precede a number with @samp{@@}, it represents an internal time
stamp as a count of seconds. The number can contain an internal
decimal point (either @samp{.} or @samp{,}); any excess precision not
supported by the internal representation is truncated toward minus
infinity. Such a number cannot be combined with any other date
item, as it specifies a complete time stamp.
@cindex beginning of time, for @acronym{POSIX}
@cindex epoch, for @acronym{POSIX}
Internally, computer times are represented as a count of seconds since
an epoch---a well-defined point of time. On @acronym{GNU} and
@acronym{POSIX} systems, the epoch is 1970-01-01 00:00:00 @sc{utc}, so
@samp{@@0} represents this time, @samp{@@1} represents 1970-01-01
00:00:01 @sc{utc}, and so forth. @acronym{GNU} and most other
@acronym{POSIX}-compliant systems support such times as an extension
to @acronym{POSIX}, using negative counts, so that @samp{@@-1}
represents 1969-12-31 23:59:59 @sc{utc}.
Traditional Unix systems count seconds with 32-bit two's-complement
integers and can represent times from 1901-12-13 20:45:52 through
2038-01-19 03:14:07 @sc{utc}. More modern systems use 64-bit counts
of seconds with nanosecond subcounts, and can represent all the times
in the known lifetime of the universe to a resolution of 1 nanosecond.
On most systems, these counts ignore the presence of leap seconds.
For example, on most systems @samp{@@915148799} represents 1998-12-31
23:59:59 @sc{utc}, @samp{@@915148800} represents 1999-01-01 00:00:00
@sc{utc}, and there is no way to represent the intervening leap second
1998-12-31 23:59:60 @sc{utc}.
@node Specifying time zone rules
@section Specifying time zone rules
@vindex TZ
Normally, dates are interpreted using the rules of the current time
zone, which in turn are specified by the @env{TZ} environment
variable, or by a system default if @env{TZ} is not set. To specify a
different set of default time zone rules that apply just to one date,
start the date with a string of the form @samp{TZ="@var{rule}"}. The
two quote characters (@samp{"}) must be present in the date, and any
quotes or backslashes within @var{rule} must be escaped by a
backslash.
For example, with the @acronym{GNU} @command{date} command you can
answer the question ``What time is it in New York when a Paris clock
shows 6:30am on October 31, 2004?'' by using a date beginning with
@samp{TZ="Europe/Paris"} as shown in the following shell transcript:
@example
$ export TZ="America/New_York"
$ date --date='TZ="Europe/Paris" 2004-10-31 06:30'
Sun Oct 31 01:30:00 EDT 2004
@end example
In this example, the @option{--date} operand begins with its own
@env{TZ} setting, so the rest of that operand is processed according
to @samp{Europe/Paris} rules, treating the string @samp{2004-10-31
06:30} as if it were in Paris. However, since the output of the
@command{date} command is processed according to the overall time zone
rules, it uses New York time. (Paris was normally six hours ahead of
New York in 2004, but this example refers to a brief Halloween period
when the gap was five hours.)
A @env{TZ} value is a rule that typically names a location in the
@uref{http://www.twinsun.com/tz/tz-link.htm, @samp{tz} database}.
A recent catalog of location names appears in the
@uref{http://twiki.org/cgi-bin/xtra/tzdate, TWiki Date and Time
Gateway}. A few non-@acronym{GNU} hosts require a colon before a
location name in a @env{TZ} setting, e.g.,
@samp{TZ=":America/New_York"}.
The @samp{tz} database includes a wide variety of locations ranging
from @samp{Arctic/Longyearbyen} to @samp{Antarctica/South_Pole}, but
if you are at sea and have your own private time zone, or if you are
using a non-@acronym{GNU} host that does not support the @samp{tz}
database, you may need to use a @acronym{POSIX} rule instead. Simple
@acronym{POSIX} rules like @samp{UTC0} specify a time zone without
daylight saving time; other rules can specify simple daylight saving
regimes. @xref{TZ Variable,, Specifying the Time Zone with @code{TZ},
libc, The GNU C Library}.
@node Authors of get_date
@section Authors of @code{get_date}
@cindex authors of @code{get_date}
@cindex Bellovin, Steven M.
@cindex Salz, Rich
@cindex Berets, Jim
@cindex MacKenzie, David
@cindex Meyering, Jim
@cindex Eggert, Paul
@code{get_date} was originally implemented by Steven M. Bellovin
(@email{smb@@research.att.com}) while at the University of North Carolina
at Chapel Hill. The code was later tweaked by a couple of people on
Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
and Jim Berets (@email{jberets@@bbn.com}) in August, 1990. Various
revisions for the @sc{gnu} system were made by David MacKenzie, Jim Meyering,
Paul Eggert and others.
@cindex Pinard, F.
@cindex Berry, K.
This chapter was originally produced by Fran@,{c}ois Pinard
(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).

View File

@@ -1,16 +1,32 @@
Each file has a set of @dfn{permissions} that control the kinds of
access that users have to that file. The permissions for a file are
also called its @dfn{access mode}. They can be represented either in
@c File mode bits
@c Copyright (C) 1994, 1996, 1999-2001, 2003-2006,
@c 2008-2009 Free Software Foundation, Inc.
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.3 or
@c any later version published by the Free Software Foundation; with no
@c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
@c Texts. A copy of the license is included in the ``GNU Free
@c Documentation License'' file as part of this distribution.
Each file has a set of @dfn{file mode bits} that control the kinds of
access that users have to that file. They can be represented either in
symbolic form or as an octal number.
@menu
* Mode Structure:: Structure of file permissions.
* Symbolic Modes:: Mnemonic permissions representation.
* Numeric Modes:: Permissions as octal numbers.
* Mode Structure:: Structure of file mode bits.
* Symbolic Modes:: Mnemonic representation of file mode bits.
* Numeric Modes:: File mode bits as octal numbers.
* Directory Setuid and Setgid:: Set-user-ID and set-group-ID on directories.
@end menu
@node Mode Structure
@section Structure of File Permissions
@section Structure of File Mode Bits
The file mode bits have two parts: the @dfn{file permission bits},
which control ordinary access to the file, and @dfn{special mode
bits}, which affect only some files.
There are three kinds of permissions that a user can have for a file:
@@ -24,7 +40,7 @@ list the contents of the directory.
permission to write to (change) the file. For directories, this means
permission to create and remove files in the directory.
@item
@cindex execute permission
@cindex execute/search permission
permission to execute the file (run it as a program). For directories,
this means permission to access files in the directory.
@end enumerate
@@ -50,58 +66,66 @@ file system the file is created on, and the way the file is created. You
can change the owner and group of a file by using the @command{chown} and
@command{chgrp} commands.
In addition to the three sets of three permissions listed above, a
file's permissions have three special components, which affect only
executable files (programs) and, on some systems, directories:
In addition to the three sets of three permissions listed above, the
file mode bits have three special components, which affect only
executable files (programs) and, on most systems, directories:
@enumerate
@item
@cindex set-user-ID
@cindex setuid
set the process's effective user ID to that of the file upon execution
(called the @dfn{setuid bit}). No effect on directories.
Set the process's effective user ID to that of the file upon execution
(called the @dfn{set-user-ID bit}, or sometimes the @dfn{setuid bit}).
For directories on a few systems, give files created in the directory
the same owner as the directory, no matter who creates them, and set
the set-user-ID bit of newly-created subdirectories.
@item
@cindex set-group-ID
@cindex setgid
set the process's effective group ID to that of the file upon execution
(called the @dfn{setgid bit}). For directories on some systems, put
files created in the directory into the same group as the directory, no
matter what group the user who creates them is in.
Set the process's effective group ID to that of the file upon execution
(called the @dfn{set-group-ID bit}, or sometimes the @dfn{setgid bit}).
For directories on most systems, give files created in the directory
the same group as the directory, no matter what group the user who
creates them is in, and set the set-group-ID bit of newly-created
subdirectories.
@item
@cindex sticky
@cindex swap space, saving text image in
@cindex text image, saving in swap space
@cindex restricted deletion flag
prevent users from removing or renaming a file in a directory
Prevent unprivileged users from removing or renaming a file in a directory
unless they own the file or the directory; this is called the
@dfn{restricted deletion flag} for the directory.
For regular files on some systems, save the program's text image on the
@dfn{restricted deletion flag} for the directory, and is commonly
found on world-writable directories like @file{/tmp}.
For regular files on some older systems, save the program's text image on the
swap device so it will load more quickly when run; this is called the
@dfn{sticky bit}.
@end enumerate
In addition to the permissions listed above, there may be file attributes
specific to the file system, e.g: access control lists (ACLs), whether a
file is compressed, whether a file can be modified (immutability), whether
In addition to the file mode bits listed above, there may be file attributes
specific to the file system, e.g., access control lists (ACLs), whether a
file is compressed, whether a file can be modified (immutability), and whether
a file can be dumped. These are usually set using programs
specific to the file system. For example:
@c should probably say a lot more about ACLs... someday
@table @asis
@item ext2
On @acronym{GNU} and @acronym{GNU}/Linux the file permissions
(``attributes'') specific to
On @acronym{GNU} and @acronym{GNU}/Linux the file attributes specific to
the ext2 file system are set using @command{chattr}.
@item FFS
On FreeBSD the file permissions (``flags'') specific to the FFS
file system are set using @command{chrflags}.
On FreeBSD the file flags specific to the FFS
file system are set using @command{chflags}.
@end table
Although a file's permission ``bits'' allow an operation on that file,
Even if a file's mode bits allow an operation on that file,
that operation may still fail, because:
@itemize
@item
the file-system-specific permissions do not permit it;
the file-system-specific attributes or flags do not permit it; or
@item
the file system is mounted as read-only.
@@ -115,9 +139,9 @@ may have just run @code{chmod a+w FILE}.
@section Symbolic Modes
@cindex symbolic modes
@dfn{Symbolic modes} represent changes to files' permissions as
@dfn{Symbolic modes} represent changes to files' mode bits as
operations on single-character symbols. They allow you to modify either
all or selected parts of files' permissions, optionally based on
all or selected parts of files' mode bits, optionally based on
their previous values, and perhaps on the current @code{umask} as well
(@pxref{Umask and Protection}).
@@ -137,7 +161,7 @@ symbolic modes.
@menu
* Setting Permissions:: Basic operations on permissions.
* Copying Permissions:: Copying existing permissions.
* Changing Special Permissions:: Special permissions.
* Changing Special Mode Bits:: Special mode bits.
* Conditional Executability:: Conditionally affecting executability.
* Multiple Changes:: Making multiple changes.
* Umask and Protection:: The effect of the umask.
@@ -148,7 +172,7 @@ symbolic modes.
The basic symbolic operations on a file's permissions are adding,
removing, and setting the permission that certain users have to read,
write, and execute the file. These operations have the following
write, and execute or search the file. These operations have the following
format:
@example
@@ -213,18 +237,19 @@ the permission the @var{users} have to read the file;
@cindex write permission, symbolic
the permission the @var{users} have to write to the file;
@item x
@cindex execute permission, symbolic
the permission the @var{users} have to execute the file.
@cindex execute/search permission, symbolic
the permission the @var{users} have to execute the file,
or search it if it is a directory.
@end table
For example, to give everyone permission to read and write a file,
For example, to give everyone permission to read and write a regular file,
but not to execute it, use:
@example
a=rw
@end example
To remove write permission for from all users other than the file's
To remove write permission for all users other than the file's
owner, use:
@example
@@ -275,38 +300,42 @@ it to mode 666 (@samp{rw-rw-rw-}). If the file had started out as mode
(@samp{rwxr--r-x}). The @samp{-} and @samp{=} operations work
analogously.
@node Changing Special Permissions
@subsection Changing Special Permissions
@node Changing Special Mode Bits
@subsection Changing Special Mode Bits
@cindex changing special permissions
In addition to changing a file's read, write, and execute permissions,
you can change its special permissions. @xref{Mode Structure}, for a
summary of these permissions.
@cindex changing special mode bits
In addition to changing a file's read, write, and execute/search permissions,
you can change its special mode bits. @xref{Mode Structure}, for a
summary of these special mode bits.
To change a file's permission to set the user ID on execution, use
To change the file mode bits to set the user ID on execution, use
@samp{u} in the @var{users} part of the symbolic mode and
@samp{s} in the @var{permissions} part.
To change a file's permission to set the group ID on execution, use
To change the file mode bits to set the group ID on execution, use
@samp{g} in the @var{users} part of the symbolic mode and
@samp{s} in the @var{permissions} part.
To change a file's permission to set the restricted deletion flag or sticky bit,
omit the @var{users} part of the symbolic mode (or use @samp{a}) and put
To set both user and group ID on execution, omit the @var{users} part
of the symbolic mode (or use @samp{a}) and use @samp{s} in the
@var{permissions} part.
To change the file mode bits to set the restricted deletion flag or sticky bit,
omit the @var{users} part of the symbolic mode (or use @samp{a}) and use
@samp{t} in the @var{permissions} part.
For example, to add set-user-ID permission to a program,
For example, to set the set-user-ID mode bit of a program,
you can use the mode:
@example
u+s
@end example
To remove both set-user-ID and set-group-ID permission from
To remove both set-user-ID and set-group-ID mode bits from
it, you can use the mode:
@example
ug-s
a-s
@end example
To set the restricted deletion flag or sticky bit, you can use
@@ -320,8 +349,8 @@ The combination @samp{o+s} has no effect. On @acronym{GNU} systems
the combinations @samp{u+t} and @samp{g+t} have no effect, and
@samp{o+t} acts like plain @samp{+t}.
The @samp{=} operator is not very useful with special permissions; for
example, the mode:
The @samp{=} operator is not very useful with special mode bits.
For example, the mode:
@example
o=t
@@ -329,15 +358,18 @@ o=t
@noindent
does set the restricted deletion flag or sticky bit, but it also
removes all read, write, and execute permissions that users not in the
removes all read, write, and execute/search permissions that users not in the
file's group might have had for it.
@xref{Directory Setuid and Setgid}, for additional rules concerning
set-user-ID and set-group-ID bits and directories.
@node Conditional Executability
@subsection Conditional Executability
@cindex conditional executability
There is one more special type of symbolic permission: if you use
@samp{X} instead of @samp{x}, execute permission is affected only if the
@samp{X} instead of @samp{x}, execute/search permission is affected only if the
file is a directory or already had execute permission.
For example, this mode:
@@ -356,7 +388,7 @@ anyone could execute them before.
@cindex multiple changes to permissions
The format of symbolic modes is actually more complex than described
above (@pxref{Setting Permissions}). It provides two ways to make
multiple changes to files' permissions.
multiple changes to files' mode bits.
The first way is to specify multiple @var{operation} and
@var{permissions} parts after a @var{users} part in the symbolic mode.
@@ -370,7 +402,7 @@ og+rX-w
@noindent
gives users other than the owner of the file read permission and, if
it is a directory or if someone already had execute permission
to it, gives them execute permission; and it also denies them write
to it, gives them execute/search permission; and it also denies them write
permission to the file. It does not affect the permission that the
owner of the file has for it. The above mode is equivalent to
the two modes:
@@ -396,7 +428,7 @@ u=rwx,g=rx,o=
@end example
@noindent
sets all of the non-special permissions for the file explicitly. (It
sets all of the permission bits for the file explicitly. (It
gives users who are not in the file's group no permission at all for
it.)
@@ -408,7 +440,7 @@ a+r,g+x-w
@noindent
gives all users permission to read the file, and gives users who are in
the file's group permission to execute it, as well, but not permission
the file's group permission to execute/search it as well, but not permission
to write to it. The above mode could be written in several different
ways; another is:
@@ -457,52 +489,116 @@ the file to all users.
@section Numeric Modes
@cindex numeric modes
@cindex file permissions, numeric
@cindex file mode bits, numeric
@cindex octal numbers for file modes
As an
alternative to giving a symbolic mode, you can give an octal (base 8)
number that represents the new mode.
number that represents the mode.
This number is always interpreted in octal; you do not have to add a
leading 0, as you do in C. Mode 0055 is the same as mode 55.
leading @samp{0}, as you do in C. Mode @samp{0055} is the same as
mode @samp{55}.
A numeric mode is usually shorter than the corresponding symbolic
mode, but it is limited in that it cannot take into account a file's
previous permissions; it can only set them absolutely.
mode, but it is limited in that normally it cannot take into account the
previous file mode bits; it can only set them absolutely.
(As discussed in the next section, the set-user-ID and set-group-ID
bits of directories are an exception to this general limitation.)
The permissions granted to the user,
to other users in the file's group,
and to other users not in the file's group each require three
bits, which are represented as one octal digit. The three special
permissions also require one bit each, and they are as a group
mode bits also require one bit each, and they are as a group
represented as another octal digit. Here is how the bits are arranged,
starting with the lowest valued bit:
@example
Value in Corresponding
Mode Permission
Mode Mode Bit
Other users not in the file's group:
1 Execute
1 Execute/search
2 Write
4 Read
Other users in the file's group:
10 Execute
10 Execute/search
20 Write
40 Read
The file's owner:
100 Execute
100 Execute/search
200 Write
400 Read
Special permissions:
Special mode bits:
1000 Restricted deletion flag or sticky bit
2000 Set group ID on execution
4000 Set user ID on execution
@end example
For example, numeric mode 4755 corresponds to symbolic mode
@samp{u=rwxs,go=rx}, and numeric mode 664 corresponds to symbolic mode
@samp{ug=rw,o=r}. Numeric mode 0 corresponds to symbolic mode
For example, numeric mode @samp{4755} corresponds to symbolic mode
@samp{u=rwxs,go=rx}, and numeric mode @samp{664} corresponds to symbolic mode
@samp{ug=rw,o=r}. Numeric mode @samp{0} corresponds to symbolic mode
@samp{a=}.
@node Directory Setuid and Setgid
@section Directories and the Set-User-ID and Set-Group-ID Bits
On most systems, if a directory's set-group-ID bit is set, newly
created subfiles inherit the same group as the directory, and newly
created subdirectories inherit the set-group-ID bit of the parent
directory. On a few systems, a directory's set-user-ID bit has a
similar effect on the ownership of new subfiles and the set-user-ID
bits of new subdirectories. These mechanisms let users share files
more easily, by lessening the need to use @command{chmod} or
@command{chown} to share new files.
These convenience mechanisms rely on the set-user-ID and set-group-ID
bits of directories. If commands like @command{chmod} and
@command{mkdir} routinely cleared these bits on directories, the
mechanisms would be less convenient and it would be harder to share
files. Therefore, a command like @command{chmod} does not affect the
set-user-ID or set-group-ID bits of a directory unless the user
specifically mentions them in a symbolic mode, or sets them in
a numeric mode. For example, on systems that support
set-group-ID inheritance:
@example
# These commands leave the set-user-ID and
# set-group-ID bits of the subdirectories alone,
# so that they retain their default values.
mkdir A B C
chmod 755 A
chmod 0755 B
chmod u=rwx,go=rx C
mkdir -m 755 D
mkdir -m 0755 E
mkdir -m u=rwx,go=rx F
@end example
If you want to try to set these bits, you must mention them
explicitly in the symbolic or numeric modes, e.g.:
@example
# These commands try to set the set-user-ID
# and set-group-ID bits of the subdirectories.
mkdir G H
chmod 6755 G
chmod u=rwx,go=rx,a+s H
mkdir -m 6755 I
mkdir -m u=rwx,go=rx,a+s J
@end example
If you want to try to clear these bits, you must mention them
explicitly in a symbolic mode, e.g.:
@example
# This command tries to clear the set-user-ID
# and set-group-ID bits of the directory D.
chmod a-s D
@end example
This behavior is a @acronym{GNU} extension. Portable scripts should
not rely on requests to set or clear these bits on directories, as
@acronym{POSIX} allows implementations to ignore these requests.

231
gl/lib/mbsalign.c Normal file
View File

@@ -0,0 +1,231 @@
/* Align/Truncate a string in a given screen width
Copyright (C) 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Pádraig Brady. */
#include <config.h>
#include "mbsalign.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#include <wchar.h>
#include <wctype.h>
#ifndef MIN
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
/* Replace non printable chars.
Return 1 if replacement made, 0 otherwise. */
static bool
wc_ensure_printable (wchar_t *wchars)
{
bool replaced = false;
wchar_t *wc = wchars;
while (*wc)
{
if (!iswprint ((wint_t) *wc))
{
*wc = 0xFFFD; /* L'\uFFFD' (replacement char) */
replaced = true;
}
wc++;
}
return replaced;
}
/* Truncate wchar string to width cells.
* Returns number of cells used. */
static size_t
wc_truncate (wchar_t *wc, size_t width)
{
size_t cells = 0;
int next_cells = 0;
while (*wc)
{
next_cells = wcwidth (*wc);
if (next_cells == -1) /* non printable */
{
*wc = 0xFFFD; /* L'\uFFFD' (replacement char) */
next_cells = 1;
}
if (cells + next_cells > width)
break;
cells += next_cells;
wc++;
}
*wc = L'\0';
return cells;
}
/* FIXME: move this function to gnulib as it's missing on:
OpenBSD 3.8, IRIX 5.3, Solaris 2.5.1, mingw, BeOS */
static int
rpl_wcswidth (const wchar_t *s, size_t n)
{
int ret = 0;
while (n-- > 0 && *s != L'\0')
{
int nwidth = wcwidth (*s++);
if (nwidth == -1) /* non printable */
return -1;
if (ret > (INT_MAX - nwidth)) /* overflow */
return -1;
ret += nwidth;
}
return ret;
}
/* Write N_SPACES space characters to DEST while ensuring
nothing is written beyond DEST_END. A terminating NUL
is always added to DEST.
A pointer to the terminating NUL is returned. */
static char*
mbs_align_pad (char *dest, const char* dest_end, size_t n_spaces)
{
/* FIXME: Should we pad with "figure space" (\u2007)
if non ascii data present? */
while (n_spaces-- && (dest < dest_end))
*dest++ = ' ';
*dest = '\0';
return dest;
}
/* Align a string, SRC, in a field of *WIDTH columns, handling multi-byte
characters; write the result into the DEST_SIZE-byte buffer, DEST.
ALIGNMENT specifies whether to left- or right-justify or to center.
If SRC requires more than *WIDTH columns, truncate it to fit.
When centering, the number of trailing spaces may be one less than the
number of leading spaces. The FLAGS parameter is unused at present.
Return the length in bytes required for the final result, not counting
the trailing NUL. A return value of DEST_SIZE or larger means there
wasn't enough space. DEST will be NUL terminated in any case.
Return (size_t) -1 upon error (invalid multi-byte sequence in SRC,
or malloc failure).
Update *WIDTH to indicate how many columns were used before padding. */
size_t
mbsalign (const char *src, char *dest, size_t dest_size,
size_t *width, mbs_align_t align, int flags)
{
size_t ret = -1;
size_t src_size = strlen (src) + 1;
char *newstr = NULL;
wchar_t *str_wc = NULL;
const char *str_to_print = src;
size_t n_cols = src_size - 1;
size_t n_used_bytes = n_cols; /* Not including NUL */
size_t n_spaces = 0;
bool conversion = false;
bool wc_enabled = false;
/* In multi-byte locales convert to wide characters
to allow easy truncation. Also determine number
of screen columns used. */
if (MB_CUR_MAX > 1)
{
size_t src_chars = mbstowcs (NULL, src, 0);
if (src_chars == (size_t) -1)
goto mbsalign_cleanup;
src_chars += 1; /* make space for NUL */
str_wc = malloc (src_chars * sizeof (wchar_t));
if (str_wc == NULL)
goto mbsalign_cleanup;
if (mbstowcs (str_wc, src, src_chars) > 0)
{
str_wc[src_chars - 1] = L'\0';
wc_enabled = true;
conversion = wc_ensure_printable (str_wc);
n_cols = rpl_wcswidth (str_wc, src_chars);
}
}
/* If we transformed or need to truncate the source string
then create a modified copy of it. */
if (conversion || (n_cols > *width))
{
newstr = malloc (src_size);
if (newstr == NULL)
goto mbsalign_cleanup;
str_to_print = newstr;
if (wc_enabled)
{
n_cols = wc_truncate (str_wc, *width);
n_used_bytes = wcstombs (newstr, str_wc, src_size);
}
else
{
n_cols = *width;
n_used_bytes = n_cols;
memcpy (newstr, src, n_cols);
newstr[n_cols] = '\0';
}
}
if (*width > n_cols)
n_spaces = *width - n_cols;
/* indicate to caller how many cells needed (not including padding). */
*width = n_cols;
/* indicate to caller how many bytes needed (not including NUL). */
ret = n_used_bytes + (n_spaces * 1);
/* Write as much NUL terminated output to DEST as possible. */
if (dest_size != 0)
{
char *dest_end = dest + dest_size - 1;
size_t start_spaces = n_spaces / 2 + n_spaces % 2;
size_t end_spaces = n_spaces / 2;
switch (align)
{
case MBS_ALIGN_CENTER:
start_spaces = n_spaces / 2 + n_spaces % 2;
end_spaces = n_spaces / 2;
break;
case MBS_ALIGN_LEFT:
start_spaces = 0;
end_spaces = n_spaces;
break;
case MBS_ALIGN_RIGHT:
start_spaces = n_spaces;
end_spaces = 0;
break;
}
dest = mbs_align_pad (dest, dest_end, start_spaces);
dest = mempcpy(dest, str_to_print, MIN (n_used_bytes, dest_end - dest));
mbs_align_pad (dest, dest_end, end_spaces);
}
mbsalign_cleanup:
free (str_wc);
free (newstr);
return ret;
}

23
gl/lib/mbsalign.h Normal file
View File

@@ -0,0 +1,23 @@
/* Align/Truncate a string in a given screen width
Copyright (C) 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
#include <stddef.h>
typedef enum { MBS_ALIGN_LEFT, MBS_ALIGN_RIGHT, MBS_ALIGN_CENTER } mbs_align_t;
size_t
mbsalign (const char *src, char *dest, size_t dest_size,
size_t *width, mbs_align_t align, int flags);

142
gl/lib/mgetgroups.c Normal file
View File

@@ -0,0 +1,142 @@
/* mgetgroups.c -- return a list of the groups a user is in
Copyright (C) 2007-2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Extracted from coreutils' src/id.c. */
#include <config.h>
#include "mgetgroups.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#if HAVE_GETGROUPLIST
# include <grp.h>
#endif
#include "getugroups.h"
#include "xalloc.h"
static GETGROUPS_T *
realloc_groupbuf (GETGROUPS_T *g, size_t num)
{
if (xalloc_oversized (num, sizeof (*g)))
{
errno = ENOMEM;
return NULL;
}
return realloc (g, num * sizeof (*g));
}
/* Like getugroups, but store the result in malloc'd storage.
Set *GROUPS to the malloc'd list of all group IDs of which USERNAME
is a member. If GID is not -1, store it first. GID should be the
group ID (pw_gid) obtained from getpwuid, in case USERNAME is not
listed in the groups database (e.g., /etc/groups). Upon failure,
don't modify *GROUPS, set errno, and return -1. Otherwise, return
the number of groups. */
int
mgetgroups (char const *username, gid_t gid, GETGROUPS_T **groups)
{
int max_n_groups;
int ng;
GETGROUPS_T *g;
#if HAVE_GETGROUPLIST
/* We prefer to use getgrouplist if available, because it has better
performance characteristics.
In glibc 2.3.2, getgrouplist is buggy. If you pass a zero as the
length of the output buffer, getgrouplist will still write to the
buffer. Contrary to what some versions of the getgrouplist
manpage say, this doesn't happen with nonzero buffer sizes.
Therefore our usage here just avoids a zero sized buffer. */
if (username)
{
enum { N_GROUPS_INIT = 10 };
max_n_groups = N_GROUPS_INIT;
g = realloc_groupbuf (NULL, max_n_groups);
if (g == NULL)
return -1;
while (1)
{
GETGROUPS_T *h;
int last_n_groups = max_n_groups;
/* getgrouplist updates max_n_groups to num required. */
ng = getgrouplist (username, gid, g, &max_n_groups);
/* Some systems (like Darwin) have a bug where they
never increase max_n_groups. */
if (ng < 0 && last_n_groups == max_n_groups)
max_n_groups *= 2;
if ((h = realloc_groupbuf (g, max_n_groups)) == NULL)
{
int saved_errno = errno;
free (g);
errno = saved_errno;
return -1;
}
g = h;
if (0 <= ng)
{
*groups = g;
/* On success some systems just return 0 from getgrouplist,
so return max_n_groups rather than ng. */
return max_n_groups;
}
}
}
/* else no username, so fall through and use getgroups. */
#endif
max_n_groups = (username
? getugroups (0, NULL, username, gid)
: getgroups (0, NULL));
/* If we failed to count groups with NULL for a buffer,
try again with a non-NULL one, just in case. */
if (max_n_groups < 0)
max_n_groups = 5;
g = realloc_groupbuf (NULL, max_n_groups);
if (g == NULL)
return -1;
ng = (username
? getugroups (max_n_groups, g, username, gid)
: getgroups (max_n_groups, g));
if (ng < 0)
{
int saved_errno = errno;
free (g);
errno = saved_errno;
return -1;
}
*groups = g;
return ng;
}

19
gl/lib/mgetgroups.h Normal file
View File

@@ -0,0 +1,19 @@
/* Get a list of all group IDs associated with a specified user ID.
Copyright (C) 2007, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
int mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups);

300
gl/lib/rand-isaac.c Normal file
View File

@@ -0,0 +1,300 @@
/* Bob Jenkins's cryptographic random number generator, ISAAC.
Copyright (C) 1999-2006, 2009 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
Written by Colin Plumb. */
/*
* --------------------------------------------------------------------
* We need a source of random numbers for some data.
* Cryptographically secure is desirable, but it's not life-or-death
* so I can be a little bit experimental in the choice of RNGs here.
*
* This generator is based somewhat on RC4, but has analysis
* <http://burtleburtle.net/bob/rand/isaacafa.html>
* pointing to it actually being better. I like it because it's nice
* and fast, and because the author did good work analyzing it.
* --------------------------------------------------------------------
*/
#include <config.h>
#include "rand-isaac.h"
#include <string.h>
#include <unistd.h>
#include "gethrxtime.h"
/* This index operation is more efficient on many processors */
#define ind(mm, x) \
(* (uint32_t *) ((char *) (mm) \
+ ((x) & (ISAAC_WORDS - 1) * sizeof (uint32_t))))
/*
* The central step. This uses two temporaries, x and y. mm is the
* whole state array, while m is a pointer to the current word. off is
* the offset from m to the word ISAAC_WORDS/2 words away in the mm array,
* i.e. +/- ISAAC_WORDS/2.
*/
#define isaac_step(mix, a, b, mm, m, off, r) \
( \
a = ((a) ^ (mix)) + (m)[off], \
x = *(m), \
*(m) = y = ind (mm, x) + (a) + (b), \
*(r) = b = ind (mm, (y) >> ISAAC_LOG) + x \
)
/* Use and update *S to generate random data to fill R. */
void
isaac_refill (struct isaac_state *s, uint32_t r[ISAAC_WORDS])
{
uint32_t a, b; /* Caches of a and b */
uint32_t x, y; /* Temps needed by isaac_step macro */
uint32_t *m = s->mm; /* Pointer into state array */
a = s->a;
b = s->b + (++s->c);
do
{
isaac_step (a << 13, a, b, s->mm, m, ISAAC_WORDS / 2, r);
isaac_step (a >> 6, a, b, s->mm, m + 1, ISAAC_WORDS / 2, r + 1);
isaac_step (a << 2, a, b, s->mm, m + 2, ISAAC_WORDS / 2, r + 2);
isaac_step (a >> 16, a, b, s->mm, m + 3, ISAAC_WORDS / 2, r + 3);
r += 4;
}
while ((m += 4) < s->mm + ISAAC_WORDS / 2);
do
{
isaac_step (a << 13, a, b, s->mm, m, -ISAAC_WORDS / 2, r);
isaac_step (a >> 6, a, b, s->mm, m + 1, -ISAAC_WORDS / 2, r + 1);
isaac_step (a << 2, a, b, s->mm, m + 2, -ISAAC_WORDS / 2, r + 2);
isaac_step (a >> 16, a, b, s->mm, m + 3, -ISAAC_WORDS / 2, r + 3);
r += 4;
}
while ((m += 4) < s->mm + ISAAC_WORDS);
s->a = a;
s->b = b;
}
/*
* The basic seed-scrambling step for initialization, based on Bob
* Jenkins' 256-bit hash.
*/
#define mix(a,b,c,d,e,f,g,h) \
( a ^= b << 11, d += a, \
b += c, b ^= c >> 2, e += b, \
c += d, c ^= d << 8, f += c, \
d += e, d ^= e >> 16, g += d, \
e += f, e ^= f << 10, h += e, \
f += g, f ^= g >> 4, a += f, \
g += h, g ^= h << 8, b += g, \
h += a, h ^= a >> 9, c += h, \
a += b )
/* The basic ISAAC initialization pass. */
static void
isaac_mix (struct isaac_state *s, uint32_t const seed[/* ISAAC_WORDS */])
{
int i;
uint32_t a = s->iv[0];
uint32_t b = s->iv[1];
uint32_t c = s->iv[2];
uint32_t d = s->iv[3];
uint32_t e = s->iv[4];
uint32_t f = s->iv[5];
uint32_t g = s->iv[6];
uint32_t h = s->iv[7];
for (i = 0; i < ISAAC_WORDS; i += 8)
{
a += seed[i];
b += seed[i + 1];
c += seed[i + 2];
d += seed[i + 3];
e += seed[i + 4];
f += seed[i + 5];
g += seed[i + 6];
h += seed[i + 7];
mix (a, b, c, d, e, f, g, h);
s->mm[i] = a;
s->mm[i + 1] = b;
s->mm[i + 2] = c;
s->mm[i + 3] = d;
s->mm[i + 4] = e;
s->mm[i + 5] = f;
s->mm[i + 6] = g;
s->mm[i + 7] = h;
}
s->iv[0] = a;
s->iv[1] = b;
s->iv[2] = c;
s->iv[3] = d;
s->iv[4] = e;
s->iv[5] = f;
s->iv[6] = g;
s->iv[7] = h;
}
#if 0 /* Provided for reference only; not used in this code */
/*
* Initialize the ISAAC RNG with the given seed material.
* Its size MUST be a multiple of ISAAC_BYTES, and may be
* stored in the s->mm array.
*
* This is a generalization of the original ISAAC initialization code
* to support larger seed sizes. For seed sizes of 0 and ISAAC_BYTES,
* it is identical.
*/
static void
isaac_init (struct isaac_state *s, uint32_t const *seed, size_t seedsize)
{
static uint32_t const iv[8] =
{
0x1367df5a, 0x95d90059, 0xc3163e4b, 0x0f421ad8,
0xd92a4a78, 0xa51a3c49, 0xc4efea1b, 0x30609119};
int i;
# if 0
/* The initialization of iv is a precomputed form of: */
for (i = 0; i < 7; i++)
iv[i] = 0x9e3779b9; /* the golden ratio */
for (i = 0; i < 4; ++i) /* scramble it */
mix (iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7]);
# endif
s->a = s->b = s->c = 0;
for (i = 0; i < 8; i++)
s->iv[i] = iv[i];
if (seedsize)
{
/* First pass (as in reference ISAAC code) */
isaac_mix (s, seed);
/* Second and subsequent passes (extension to ISAAC) */
while (seedsize -= ISAAC_BYTES)
{
seed += ISAAC_WORDS;
for (i = 0; i < ISAAC_WORDS; i++)
s->mm[i] += seed[i];
isaac_mix (s, s->mm);
}
}
else
{
/* The no seed case (as in reference ISAAC code) */
for (i = 0; i < ISAAC_WORDS; i++)
s->mm[i] = 0;
}
/* Final pass */
isaac_mix (s, s->mm);
}
#endif
/* Initialize *S to a somewhat-random value. */
static void
isaac_seed_start (struct isaac_state *s)
{
static uint32_t const iv[8] =
{
0x1367df5a, 0x95d90059, 0xc3163e4b, 0x0f421ad8,
0xd92a4a78, 0xa51a3c49, 0xc4efea1b, 0x30609119
};
#if 0
/* The initialization of iv is a precomputed form of: */
int i;
for (i = 0; i < 7; i++)
iv[i] = 0x9e3779b9; /* the golden ratio */
for (i = 0; i < 4; ++i) /* scramble it */
mix (iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7]);
#endif
memset (s->mm, 0, sizeof s->mm);
memcpy (s->iv, iv, sizeof s->iv);
/* s->c gets used for a data pointer during the seeding phase */
s->a = s->b = s->c = 0;
}
/* Add a buffer of seed material. */
static void
isaac_seed_data (struct isaac_state *s, void const *buffer, size_t size)
{
unsigned char const *buf = buffer;
unsigned char *p;
size_t avail;
size_t i;
avail = sizeof s->mm - s->c; /* s->c is used as a write pointer */
/* Do any full buffers that are necessary */
while (size > avail)
{
p = (unsigned char *) s->mm + s->c;
for (i = 0; i < avail; i++)
p[i] ^= buf[i];
buf += avail;
size -= avail;
isaac_mix (s, s->mm);
s->c = 0;
avail = sizeof s->mm;
}
/* And the final partial block */
p = (unsigned char *) s->mm + s->c;
for (i = 0; i < size; i++)
p[i] ^= buf[i];
s->c = size;
}
/* End of seeding phase; get everything ready to produce output. */
static void
isaac_seed_finish (struct isaac_state *s)
{
isaac_mix (s, s->mm);
isaac_mix (s, s->mm);
/* Now reinitialize c to start things off right */
s->c = 0;
}
#define ISAAC_SEED(s,x) isaac_seed_data (s, &(x), sizeof (x))
/* Initialize *S to a somewhat-random value; this starts seeding,
seeds with somewhat-random data, and finishes seeding. */
void
isaac_seed (struct isaac_state *s)
{
isaac_seed_start (s);
{ pid_t t = getpid (); ISAAC_SEED (s, t); }
{ pid_t t = getppid (); ISAAC_SEED (s, t); }
{ uid_t t = getuid (); ISAAC_SEED (s, t); }
{ gid_t t = getgid (); ISAAC_SEED (s, t); }
{
xtime_t t = gethrxtime ();
ISAAC_SEED (s, t);
}
isaac_seed_finish (s);
}

43
gl/lib/rand-isaac.h Normal file
View File

@@ -0,0 +1,43 @@
/* Bob Jenkins's cryptographic random number generator, ISAAC.
Copyright (C) 1999-2005, 2009 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
Written by Colin Plumb. */
#ifndef RAND_ISAAC_H
# define RAND_ISAAC_H
# include <stdint.h>
/* Size of the state tables to use. ISAAC_LOG should be at least 3,
and smaller values give less security. */
# define ISAAC_LOG 8
# define ISAAC_WORDS (1 << ISAAC_LOG)
# define ISAAC_BYTES (ISAAC_WORDS * sizeof (uint32_t))
/* RNG state variables. The members of this structure are private. */
struct isaac_state
{
uint32_t mm[ISAAC_WORDS]; /* Main state array */
uint32_t iv[8]; /* Seeding initial vector */
uint32_t a, b, c; /* Extra index variables */
};
void isaac_seed (struct isaac_state *);
void isaac_refill (struct isaac_state *, uint32_t[ISAAC_WORDS]);
#endif

223
gl/lib/randint.c Normal file
View File

@@ -0,0 +1,223 @@
/* Generate random integers.
Copyright (C) 2006, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#include <config.h>
#include "randint.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#if TEST
# include <inttypes.h>
# include <stdio.h>
int
main (int argc, char **argv)
{
randint i;
randint n = strtoumax (argv[1], NULL, 10);
randint choices = strtoumax (argv[2], NULL, 10);
char const *name = argv[3];
struct randint_source *ints = randint_all_new (name, SIZE_MAX);
for (i = 0; i < n; i++)
printf ("%"PRIuMAX"\n", randint_choose (ints, choices));
return (randint_all_free (ints) == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
#endif
#include "xalloc.h"
/* A source of random data for generating random integers. */
struct randint_source
{
/* The source of random bytes. */
struct randread_source *source;
/* RANDNUM is a buffered random integer, whose information has not
yet been delivered to the caller. It is uniformly distributed in
the range 0 <= RANDNUM <= RANDMAX. If RANDMAX is zero, then
RANDNUM must be zero (and in some sense it is not really
"random"). */
randint randnum;
randint randmax;
};
/* Create a new randint_source from SOURCE. */
struct randint_source *
randint_new (struct randread_source *source)
{
struct randint_source *s = xmalloc (sizeof *s);
s->source = source;
s->randnum = s->randmax = 0;
return s;
}
/* Create a new randint_source by creating a randread_source from
NAME and ESTIMATED_BYTES. Return NULL (setting errno) if
unsuccessful. */
struct randint_source *
randint_all_new (char const *name, size_t bytes_bound)
{
struct randread_source *source = randread_new (name, bytes_bound);
return (source ? randint_new (source) : NULL);
}
/* Return the random data source of *S. */
struct randread_source *
randint_get_source (struct randint_source const *s)
{
return s->source;
}
/* HUGE_BYTES is true on hosts hosts where randint and unsigned char
have the same width and where shifting by the word size therefore
has undefined behavior. */
enum { HUGE_BYTES = RANDINT_MAX == UCHAR_MAX };
/* Return X shifted left by CHAR_BIT bits. */
static inline randint shift_left (randint x)
{
return HUGE_BYTES ? 0 : x << CHAR_BIT;
}
/* Return X shifted right by CHAR_BIT bits. */
static inline randint
shift_right (randint x)
{
return HUGE_BYTES ? 0 : x >> CHAR_BIT;
}
/* Consume random data from *S to generate a random number in the range
0 .. GENMAX. */
randint
randint_genmax (struct randint_source *s, randint genmax)
{
struct randread_source *source = s->source;
randint randnum = s->randnum;
randint randmax = s->randmax;
randint choices = genmax + 1;
for (;;)
{
if (randmax < genmax)
{
/* Calculate how many input bytes will be needed, and read
the bytes. */
size_t i = 0;
randint rmax = randmax;
unsigned char buf[sizeof randnum];
do
{
rmax = shift_left (rmax) + UCHAR_MAX;
i++;
}
while (rmax < genmax);
randread (source, buf, i);
/* Increase RANDMAX by appending random bytes to RANDNUM and
UCHAR_MAX to RANDMAX until RANDMAX is no less than
GENMAX. This may lose up to CHAR_BIT bits of information
if shift_right (RANDINT_MAX) < GENMAX, but it is not
worth the programming hassle of saving these bits since
GENMAX is rarely that large in practice. */
i = 0;
do
{
randnum = shift_left (randnum) + buf[i];
randmax = shift_left (randmax) + UCHAR_MAX;
i++;
}
while (randmax < genmax);
}
if (randmax == genmax)
{
s->randnum = s->randmax = 0;
return randnum;
}
else
{
/* GENMAX < RANDMAX, so attempt to generate a random number
by taking RANDNUM modulo GENMAX+1. This will choose
fairly so long as RANDNUM falls within an integral
multiple of GENMAX+1; otherwise, LAST_USABLE_CHOICE < RANDNUM,
so discard this attempt and try again.
Since GENMAX cannot be RANDINT_MAX, CHOICES cannot be
zero and there is no need to worry about dividing by
zero. */
randint excess_choices = randmax - genmax;
randint unusable_choices = excess_choices % choices;
randint last_usable_choice = randmax - unusable_choices;
randint reduced_randnum = randnum % choices;
if (randnum <= last_usable_choice)
{
s->randnum = randnum / choices;
s->randmax = excess_choices / choices;
return reduced_randnum;
}
/* Retry, but retain the randomness from the fact that RANDNUM fell
into the range LAST_USABLE_CHOICE+1 .. RANDMAX. */
randnum = reduced_randnum;
randmax = unusable_choices - 1;
}
}
}
/* Clear *S so that it no longer contains undelivered random data. */
void
randint_free (struct randint_source *s)
{
memset (s, 0, sizeof *s);
free (s);
}
/* Likewise, but also clear the underlying randread object. Return
0 if successful, -1 (setting errno) otherwise. */
int
randint_all_free (struct randint_source *s)
{
int r = randread_free (s->source);
int e = errno;
randint_free (s);
errno = e;
return r;
}

51
gl/lib/randint.h Normal file
View File

@@ -0,0 +1,51 @@
/* Generate random integers.
Copyright (C) 2006, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#ifndef RANDINT_H
# define RANDINT_H 1
# include <stdint.h>
# include "randread.h"
/* An unsigned integer type, used for random integers, and its maximum
value. */
typedef uintmax_t randint;
# define RANDINT_MAX UINTMAX_MAX
struct randint_source;
struct randint_source *randint_new (struct randread_source *);
struct randint_source *randint_all_new (char const *, size_t);
struct randread_source *randint_get_source (struct randint_source const *);
randint randint_genmax (struct randint_source *, randint genmax);
/* Consume random data from *S to generate a random number in the range
0 .. CHOICES-1. CHOICES must be nonzero. */
static inline randint
randint_choose (struct randint_source *s, randint choices)
{
return randint_genmax (s, choices - 1);
}
void randint_free (struct randint_source *);
int randint_all_free (struct randint_source *);
#endif

102
gl/lib/randperm.c Normal file
View File

@@ -0,0 +1,102 @@
/* Generate random permutations.
Copyright (C) 2006, 2007, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#include <config.h>
#include "randperm.h"
#include <limits.h>
#include "xalloc.h"
/* Return the ceiling of the log base 2 of N. If N is zero, return
an unspecified value. */
static size_t
ceil_lg (size_t n)
{
size_t b = 0;
for (n--; n != 0; n /= 2)
b++;
return b;
}
/* Return an upper bound on the number of random bytes needed to
generate the first H elements of a random permutation of N
elements. H must not exceed N. */
size_t
randperm_bound (size_t h, size_t n)
{
/* Upper bound on number of bits needed to generate the first number
of the permutation. */
size_t lg_n = ceil_lg (n);
/* Upper bound on number of bits needed to generated the first H elements. */
size_t ar = lg_n * h;
/* Convert the bit count to a byte count. */
size_t bound = (ar + CHAR_BIT - 1) / CHAR_BIT;
return bound;
}
/* From R, allocate and return a malloc'd array of the first H elements
of a random permutation of N elements. H must not exceed N.
Return NULL if H is zero. */
size_t *
randperm_new (struct randint_source *r, size_t h, size_t n)
{
size_t *v;
switch (h)
{
case 0:
v = NULL;
break;
case 1:
v = xmalloc (sizeof *v);
v[0] = randint_choose (r, n);
break;
default:
{
size_t i;
v = xnmalloc (n, sizeof *v);
for (i = 0; i < n; i++)
v[i] = i;
for (i = 0; i < h; i++)
{
size_t j = i + randint_choose (r, n - i);
size_t t = v[i];
v[i] = v[j];
v[j] = t;
}
v = xnrealloc (v, h, sizeof *v);
}
break;
}
return v;
}

4
gl/lib/randperm.h Normal file
View File

@@ -0,0 +1,4 @@
#include "randint.h"
#include <stddef.h>
size_t randperm_bound (size_t, size_t);
size_t *randperm_new (struct randint_source *, size_t, size_t);

287
gl/lib/randread.c Normal file
View File

@@ -0,0 +1,287 @@
/* Generate buffers of random data.
Copyright (C) 2006, 2008-2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#include <config.h>
#include "randread.h"
#include <errno.h>
#include <error.h>
#include <exitfail.h>
#include <quotearg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "rand-isaac.h"
#include "stdio-safer.h"
#include "unlocked-io.h"
#include "xalloc.h"
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __attribute__(x) /* empty */
# endif
#endif
#ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif
#ifndef MIN
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
#if _STRING_ARCH_unaligned
# define ALIGNED_POINTER(ptr, type) true
#else
# define alignof(type) offsetof (struct { char c; type x; }, x)
# define ALIGNED_POINTER(ptr, type) ((size_t) (ptr) % alignof (type) == 0)
#endif
/* The maximum buffer size used for reads of random data. Using the
value 2 * ISAAC_BYTES makes this the largest power of two that
would not otherwise cause struct randread_source to grow. */
#define RANDREAD_BUFFER_SIZE (2 * ISAAC_BYTES)
/* A source of random data for generating random buffers. */
struct randread_source
{
/* Stream to read random bytes from. If null, the current
implementation uses an internal PRNG (ISAAC). */
FILE *source;
/* Function to call, and its argument, if there is an input error or
end of file when reading from the stream; errno is nonzero if
there was an error. If this function returns, it should fix the
problem before returning. The default handler assumes that
handler_arg is the file name of the source. */
void (*handler) (void const *);
void const *handler_arg;
/* The buffer for SOURCE. It's kept here to simplify storage
allocation and to make it easier to clear out buffered random
data. */
union
{
/* The stream buffer, if SOURCE is not null. */
char c[RANDREAD_BUFFER_SIZE];
/* The buffered ISAAC pseudorandom buffer, if SOURCE is null. */
struct isaac
{
/* The number of bytes that are buffered at the end of data.b. */
size_t buffered;
/* State of the ISAAC generator. */
struct isaac_state state;
/* Up to a buffer's worth of pseudorandom data. */
union
{
uint32_t w[ISAAC_WORDS];
unsigned char b[ISAAC_BYTES];
} data;
} isaac;
} buf;
};
/* The default error handler. */
static void ATTRIBUTE_NORETURN
randread_error (void const *file_name)
{
if (file_name)
error (exit_failure, errno,
_(errno == 0 ? "%s: end of file" : "%s: read error"),
quotearg_colon (file_name));
abort ();
}
/* Simply return a new randread_source object with the default error
handler. */
static struct randread_source *
simple_new (FILE *source, void const *handler_arg)
{
struct randread_source *s = xmalloc (sizeof *s);
s->source = source;
s->handler = randread_error;
s->handler_arg = handler_arg;
return s;
}
/* Create and initialize a random data source from NAME, or use a
reasonable default source if NAME is null. BYTES_BOUND is an upper
bound on the number of bytes that will be needed. If zero, it is a
hard bound; otherwise it is just an estimate.
If NAME is not null, NAME is saved for use as the argument of the
default handler. Unless a non-default handler is used, NAME's
lifetime should be at least that of the returned value.
Return NULL (setting errno) on failure. */
struct randread_source *
randread_new (char const *name, size_t bytes_bound)
{
if (bytes_bound == 0)
return simple_new (NULL, NULL);
else
{
FILE *source = NULL;
struct randread_source *s;
if (name)
if (! (source = fopen_safer (name, "rb")))
return NULL;
s = simple_new (source, name);
if (source)
setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
else
{
s->buf.isaac.buffered = 0;
isaac_seed (&s->buf.isaac.state);
}
return s;
}
}
/* Set S's handler and its argument. HANDLER (HANDLER_ARG) is called
when there is a read error or end of file from the random data
source; errno is nonzero if there was an error. If HANDLER
returns, it should fix the problem before returning. The default
handler assumes that handler_arg is the file name of the source; it
does not return. */
void
randread_set_handler (struct randread_source *s, void (*handler) (void const *))
{
s->handler = handler;
}
void
randread_set_handler_arg (struct randread_source *s, void const *handler_arg)
{
s->handler_arg = handler_arg;
}
/* Place SIZE random bytes into the buffer beginning at P, using
the stream in S. */
static void
readsource (struct randread_source *s, unsigned char *p, size_t size)
{
for (;;)
{
size_t inbytes = fread (p, sizeof *p, size, s->source);
int fread_errno = errno;
p += inbytes;
size -= inbytes;
if (size == 0)
break;
errno = (ferror (s->source) ? fread_errno : 0);
s->handler (s->handler_arg);
}
}
/* Place SIZE pseudorandom bytes into the buffer beginning at P, using
the buffered ISAAC generator in ISAAC. */
static void
readisaac (struct isaac *isaac, unsigned char *p, size_t size)
{
size_t inbytes = isaac->buffered;
for (;;)
{
if (size <= inbytes)
{
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
isaac->buffered = inbytes - size;
return;
}
memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, inbytes);
p += inbytes;
size -= inbytes;
/* If P is aligned, write to *P directly to avoid the overhead
of copying from the buffer. */
if (ALIGNED_POINTER (p, uint32_t))
{
uint32_t *wp = (uint32_t *) p;
while (ISAAC_BYTES <= size)
{
isaac_refill (&isaac->state, wp);
wp += ISAAC_WORDS;
size -= ISAAC_BYTES;
if (size == 0)
{
isaac->buffered = 0;
return;
}
}
p = (unsigned char *) wp;
}
isaac_refill (&isaac->state, isaac->data.w);
inbytes = ISAAC_BYTES;
}
}
/* Consume random data from *S to generate a random buffer BUF of size
SIZE. */
void
randread (struct randread_source *s, void *buf, size_t size)
{
if (s->source)
readsource (s, buf, size);
else
readisaac (&s->buf.isaac, buf, size);
}
/* Clear *S so that it no longer contains undelivered random data, and
deallocate any system resources associated with *S. Return 0 if
successful, a negative number (setting errno) if not (this is rare,
but can occur in theory if there is an input error). */
int
randread_free (struct randread_source *s)
{
FILE *source = s->source;
memset (s, 0, sizeof *s);
free (s);
return (source ? fclose (source) : 0);
}

33
gl/lib/randread.h Normal file
View File

@@ -0,0 +1,33 @@
/* Generate buffers of random data.
Copyright (C) 2006, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#ifndef RANDREAD_H
# define RANDREAD_H 1
# include <stddef.h>
struct randread_source;
struct randread_source *randread_new (char const *, size_t);
void randread (struct randread_source *, void *, size_t);
void randread_set_handler (struct randread_source *, void (*) (void const *));
void randread_set_handler_arg (struct randread_source *, void const *);
int randread_free (struct randread_source *);
#endif

View File

@@ -1,10 +1,10 @@
/* root-dev-ino.c -- get the device and inode numbers for `/'.
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
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.
the Free Software Foundation, either version 3 of the License, 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
@@ -12,17 +12,15 @@
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <config.h>
#include "root-dev-ino.h"
#include <stdlib.h>
#include "root-dev-ino.h"
/* Call lstat to get the device and inode numbers for `/'.
Upon failure, return NULL. Otherwise, set the members of

47
gl/lib/root-dev-ino.h Normal file
View File

@@ -0,0 +1,47 @@
/* Root device and inode number checking.
Copyright (C) 2003, 2006, 2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
#ifndef ROOT_DEV_INO_H
# define ROOT_DEV_INO_H 1
# include "dev-ino.h"
# include "same-inode.h"
struct dev_ino *
get_root_dev_ino (struct dev_ino *root_d_i);
/* These macros are common to the programs that support the
--preserve-root and --no-preserve-root options. */
# define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \
(Root_dev_ino && SAME_INODE (*Dir_statbuf, *Root_dev_ino))
# define ROOT_DEV_INO_WARN(Dirname) \
do \
{ \
if (STREQ (Dirname, "/")) \
error (0, 0, _("it is dangerous to operate recursively on %s"), \
quote (Dirname)); \
else \
error (0, 0, \
_("it is dangerous to operate recursively on %s (same as %s)"), \
quote_n (0, Dirname), quote_n (1, "/")); \
error (0, 0, _("use --no-preserve-root to override this failsafe")); \
} \
while (0)
#endif

View File

@@ -1,24 +1,28 @@
/* tempname.c - generate the name of a temporary file.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify
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.
the Free Software Foundation; either version 3 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
/* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */
#if !_LIBC
# include <config.h>
# include "tempname.h"
# include "randint.h"
#endif
#include <sys/types.h>
@@ -37,29 +41,19 @@
# define TMP_MAX 238328
#endif
#ifndef __GT_FILE
# define __GT_FILE 0
# define __GT_BIGFILE 1
# define __GT_FILE 1
# define __GT_DIR 2
# define __GT_NOCREATE 3
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#if HAVE_SYS_TIME_H || _LIBC
# include <sys/time.h>
#endif
#if HAVE_STDINT_H || _LIBC
# include <stdint.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <sys/time.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -67,13 +61,12 @@
#if _LIBC
# define struct_stat64 struct stat64
#else
# include "stat-macros.h"
# define struct_stat64 struct stat
# define __open open
# define __gen_tempname gen_tempname
# define __getpid getpid
# define __gettimeofday gettimeofday
# define __mkdir mkdir
# define __open open
# define __open64 open
# define __lxstat64(version, file, buf) lstat (file, buf)
# define __xstat64(version, file, buf) stat (file, buf)
#endif
@@ -82,34 +75,7 @@
# define __secure_getenv getenv
#endif
#ifdef _LIBC
# include <hp-timing.h>
# if HP_TIMING_AVAIL
# define RANDOM_BITS(Var) \
if (__builtin_expect (value == UINT64_C (0), 0)) \
{ \
/* If this is the first time this function is used initialize \
the variable we accumulate the value in to some somewhat \
random value. If we'd not do this programs at startup time \
might have a reduced set of possible names, at least on slow \
machines. */ \
struct timeval tv; \
__gettimeofday (&tv, NULL); \
value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \
} \
HP_TIMING_NOW (Var)
# endif
#endif
/* Use the widest available unsigned type if uint64_t is not
available. The algorithm below extracts a number less than 62**6
(approximately 2**35.725) from uint64_t, so ancient hosts where
uintmax_t is only 32 bits lose about 3.725 bits of randomness,
which is better than not having mkstemp at all. */
#if !defined UINT64_MAX && !defined uint64_t
# define uint64_t uintmax_t
#endif
#if _LIBC
/* Return nonzero if DIR is an existent directory. */
static int
direxists (const char *dir)
@@ -126,7 +92,7 @@ direxists (const char *dir)
enough space in TMPL. */
int
__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
int try_tmpdir)
int try_tmpdir)
{
const char *d;
size_t dlen, plen;
@@ -140,30 +106,30 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
{
plen = strlen (pfx);
if (plen > 5)
plen = 5;
plen = 5;
}
if (try_tmpdir)
{
d = __secure_getenv ("TMPDIR");
if (d != NULL && direxists (d))
dir = d;
dir = d;
else if (dir != NULL && direxists (dir))
/* nothing */ ;
/* nothing */ ;
else
dir = NULL;
dir = NULL;
}
if (dir == NULL)
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
dir = P_tmpdir;
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
dir = "/tmp";
else
{
__set_errno (ENOENT);
return -1;
}
{
__set_errno (ENOENT);
return -1;
}
}
dlen = strlen (dir);
@@ -180,36 +146,41 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
return 0;
}
#endif /* _LIBC */
static inline bool
check_x_suffix (char const *s, size_t len)
{
return strspn (s, "X") == len;
}
/* These are the characters used in temporary file names. */
static const char letters[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
/* Generate a temporary file name based on TMPL. TMPL must match the
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
/* Generate a temporary file name based on TMPL. TMPL must end in a
a sequence of at least X_SUFFIX_LEN "X"s. The name constructed
does not exist at the time of the call to __gen_tempname. TMPL is
overwritten with the result.
KIND may be one of:
__GT_NOCREATE: simply verify that the name does not exist
at the time of the call.
at the time of the call.
__GT_FILE: create the file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
__GT_BIGFILE: same as __GT_FILE but use open64().
and return a read-write fd. The file is mode 0600.
__GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */
int
__gen_tempname (char *tmpl, int kind)
gen_tempname_len (char *tmpl, int flags, int kind, size_t x_suffix_len)
{
int len;
size_t len;
char *XXXXXX;
static uint64_t value;
uint64_t random_time_bits;
unsigned int count;
int fd = -1;
int save_errno = errno;
struct_stat64 st;
struct randint_source *rand_src;
/* A lower bound on the number of temporary files to attempt to
generate. The maximum total number of temporary file names that
@@ -217,101 +188,107 @@ __gen_tempname (char *tmpl, int kind)
necessary to try all these combinations. Instead if a reasonable
number of names is tried (we define reasonable as 62**3) fail to
give the system administrator the chance to remove the problems. */
unsigned int attempts_min = 62 * 62 * 62;
#define ATTEMPTS_MIN (62 * 62 * 62)
/* The number of times to attempt to generate a temporary file. To
conform to POSIX, this must be no smaller than TMP_MAX. */
unsigned int attempts = attempts_min < TMP_MAX ? TMP_MAX : attempts_min;
#if ATTEMPTS_MIN < TMP_MAX
unsigned int attempts = TMP_MAX;
#else
unsigned int attempts = ATTEMPTS_MIN;
#endif
len = strlen (tmpl);
if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
if (len < x_suffix_len || ! check_x_suffix (&tmpl[len - x_suffix_len],
x_suffix_len))
{
__set_errno (EINVAL);
return -1;
}
rand_src = randint_all_new (NULL, 8);
if (! rand_src)
return -1;
/* This is where the Xs start. */
XXXXXX = &tmpl[len - 6];
XXXXXX = &tmpl[len - x_suffix_len];
/* Get some more or less random data. */
#ifdef RANDOM_BITS
RANDOM_BITS (random_time_bits);
#else
# if HAVE_GETTIMEOFDAY || _LIBC
{
struct timeval tv;
__gettimeofday (&tv, NULL);
random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
}
# else
random_time_bits = time (NULL);
# endif
#endif
value += random_time_bits ^ __getpid ();
for (count = 0; count < attempts; value += 7777, ++count)
for (count = 0; count < attempts; ++count)
{
uint64_t v = value;
size_t i;
/* Fill in the random bits. */
XXXXXX[0] = letters[v % 62];
v /= 62;
XXXXXX[1] = letters[v % 62];
v /= 62;
XXXXXX[2] = letters[v % 62];
v /= 62;
XXXXXX[3] = letters[v % 62];
v /= 62;
XXXXXX[4] = letters[v % 62];
v /= 62;
XXXXXX[5] = letters[v % 62];
for (i = 0; i < x_suffix_len; i++)
{
XXXXXX[i] = letters[randint_genmax (rand_src, sizeof letters - 2)];
}
switch (kind)
{
case __GT_FILE:
fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
{
case __GT_FILE:
fd = __open (tmpl,
(flags & ~0777) | O_RDWR | O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR);
break;
case __GT_BIGFILE:
fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_DIR:
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
break;
case __GT_DIR:
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
break;
case __GT_NOCREATE:
/* This case is backward from the other three. This function
succeeds if __xstat fails because the name does not exist.
Note the continue to bypass the common logic at the bottom
of the loop. */
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
{
if (errno == ENOENT)
{
__set_errno (save_errno);
fd = 0;
goto done;
}
else
{
/* Give up now. */
fd = -1;
goto done;
}
}
continue;
case __GT_NOCREATE:
/* This case is backward from the other three. __gen_tempname
succeeds if __xstat fails because the name does not exist.
Note the continue to bypass the common logic at the bottom
of the loop. */
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
{
if (errno == ENOENT)
{
__set_errno (save_errno);
return 0;
}
else
/* Give up now. */
return -1;
}
continue;
default:
assert (! "invalid KIND in __gen_tempname");
}
default:
assert (! "invalid KIND in __gen_tempname");
}
if (fd >= 0)
{
__set_errno (save_errno);
return fd;
}
{
__set_errno (save_errno);
goto done;
}
else if (errno != EEXIST)
return -1;
{
fd = -1;
goto done;
}
}
randint_all_free (rand_src);
/* We got out of the loop because we ran out of combinations to try. */
__set_errno (EEXIST);
return -1;
done:
{
int saved_errno = errno;
randint_all_free (rand_src);
__set_errno (saved_errno);
}
return fd;
}
int
__gen_tempname (char *tmpl, int flags, int kind)
{
return gen_tempname_len (tmpl, flags, kind, 6);
}

42
gl/lib/tempname.h Normal file
View File

@@ -0,0 +1,42 @@
/* Create a temporary file or directory.
Copyright (C) 2006, 2007, 2009 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
the Free Software Foundation; either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
/* header written by Eric Blake */
/* In gnulib, always prefer large files. GT_FILE maps to
__GT_BIGFILE, not __GT_FILE, for a reason. */
#define GT_FILE 1
#define GT_DIR 2
#define GT_NOCREATE 3
/* Generate a temporary file name based on TMPL. TMPL must match the
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
does not exist at the time of the call to gen_tempname. TMPL is
overwritten with the result.
KIND may be one of:
GT_NOCREATE: simply verify that the name does not exist
at the time of the call.
GT_FILE: create a large file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */
#include <stddef.h>
extern int gen_tempname (char *tmpl, int flags, int kind);
extern int gen_tempname_len (char *tmpl, int flags, int kind,
size_t x_suffix_len);

41
gl/lib/xfreopen.c Normal file
View File

@@ -0,0 +1,41 @@
/* a wrapper for frepoen
Copyright (C) 2008-2009 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
the Free Software Foundation, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "xfreopen.h"
#include <errno.h>
#include "error.h"
#include "exitfail.h"
#include "quote.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
void
xfreopen (char const *filename, char const *mode, FILE *fp)
{
if (!freopen (filename, mode, fp))
{
char const *f = (filename ? filename
: (fp == stdin ? _("stdin")
: (fp == stdout ? _("stdout")
: (fp == stderr ? _("stderr")
: _("unknown stream")))));
error (exit_failure, errno, _("failed to reopen %s with mode %s"),
quote_n (0, f), quote_n (1, mode));
}
}

2
gl/lib/xfreopen.h Normal file
View File

@@ -0,0 +1,2 @@
#include <stdio.h>
void xfreopen (char const *filename, char const *mode, FILE *fp);

View File

@@ -1,10 +1,11 @@
# rmdir.m4 serial 3
dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
#serial 3
dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_RMDIR],
AC_DEFUN([gl_MGETGROUPS],
[
AC_REPLACE_FUNCS(rmdir)
AC_CHECK_FUNCS([getgrouplist])
AC_LIBOBJ([mgetgroups])
])

View File

@@ -1,12 +1,11 @@
#serial 1
dnl Copyright (C) 2005 Free Software Foundation, Inc.
#serial 3
dnl Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ROOT_DEV_INO],
[
AC_LIBSOURCES([root-dev-ino.c, root-dev-ino.h, dev-ino.h])
AC_LIBOBJ([root-dev-ino])
dnl Prerequisites

View File

@@ -0,0 +1,13 @@
diff --git a/modules/getloadavg b/modules/getloadavg
index 2fbeb40..b79aaca 100644
--- a/modules/getloadavg
+++ b/modules/getloadavg
@@ -16,7 +16,7 @@ stdbool
fcntl-safer
configure.ac:
-gl_GETLOADAVG([$gl_source_base])
+gl_GETLOADAVG([lib])
gl_STDLIB_MODULE_INDICATOR([getloadavg])
Makefile.am:

26
gl/modules/mbsalign Normal file
View File

@@ -0,0 +1,26 @@
Description:
Align/Truncate a string in a given screen width.
Files:
lib/mbsalign.c
lib/mbsalign.h
Depends-on:
wchar
wctype
wcwidth
mempcpy
configure.ac:
Makefile.am:
lib_SOURCES += mbsalign.c mbsalign.h
Include:
"mbsalign.h"
License:
LGPL
Maintainer:
Pádraig Brady

24
gl/modules/mgetgroups Normal file
View File

@@ -0,0 +1,24 @@
Description:
Return the group IDs of a user in malloc'd storage.
Files:
lib/mgetgroups.c
lib/mgetgroups.h
m4/mgetgroups.m4
Depends-on:
getugroups
xalloc
configure.ac:
gl_MGETGROUPS
Makefile.am:
Include:
License:
LGPL
Maintainer:
Jim Meyering

Some files were not shown because too many files have changed in this diff Show More