platform/upstream/coreutils.git
16 years agoEnsure that $(VERSION) is up to date for dist-related targets.
Jim Meyering [Sun, 2 Sep 2007 09:37:57 +0000 (11:37 +0200)]
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>
16 years agobootstrap: uses rsync to download the .po files
Jim Meyering [Sun, 2 Sep 2007 07:38:39 +0000 (09:38 +0200)]
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.

16 years ago* bootstrap (gnulib_tool): Make sha1sum check quietly.
Jim Meyering [Sat, 1 Sep 2007 17:00:09 +0000 (19:00 +0200)]
* bootstrap (gnulib_tool): Make sha1sum check quietly.

Signed-off-by: Jim Meyering <jim@meyering.net>
16 years agoEnsure that snapshot version changes make it to groups, too.
Jim Meyering [Sat, 1 Sep 2007 09:20:53 +0000 (11:20 +0200)]
Ensure that snapshot version changes make it to groups, too.

* src/Makefile.am (groups): Depend on Makefile.

16 years agoMake groups-version executable,
Jim Meyering [Sat, 1 Sep 2007 09:20:42 +0000 (11:20 +0200)]
Make groups-version executable,

* tests/misc/groups-version: ... as it was in the patch.

16 years agoTest yesterday's change to groups.
Eric Blake [Fri, 31 Aug 2007 21:22:24 +0000 (23:22 +0200)]
Test yesterday's change to groups.

* tests/misc/groups-version: New test.
* tests/misc/Makefile.am (TESTS): Add groups-version.

16 years agoSolve the unnecessary-.po-file-regeneration problem once and for all.
Jim Meyering [Fri, 31 Aug 2007 20:17:53 +0000 (22:17 +0200)]
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.

16 years agoShorten the snapshot version string by removing the "g".
Jim Meyering [Thu, 30 Aug 2007 21:13:06 +0000 (23:13 +0200)]
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.

16 years agoPerform the s,rm,/bin/rm, fix-up properly. No more kludge.
Jim Meyering [Thu, 30 Aug 2007 08:47:11 +0000 (10:47 +0200)]
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>
16 years agoMake inter-release --version output more useful.
Jim Meyering [Sat, 25 Aug 2007 22:48:41 +0000 (00:48 +0200)]
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>
16 years ago* src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).
Eric Blake [Thu, 30 Aug 2007 03:02:24 +0000 (21:02 -0600)]
* src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).

16 years agoUse PACKAGE_NAME instead of GNU_PACKAGE.
Eric Blake [Thu, 30 Aug 2007 15:11:59 +0000 (17:11 +0200)]
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.

16 years agoEnsure that TMPDIR is valid. Otherwise, it would cause test failures.
Jim Meyering [Tue, 28 Aug 2007 22:17:27 +0000 (00:17 +0200)]
Ensure that TMPDIR is valid.  Otherwise, it would cause test failures.
* tests/misc/tty-eof: Set TMPDIR=.
* tests/misc/sort-compress: Likewise.

16 years agoUse EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
Jim Meyering [Tue, 28 Aug 2007 22:13:16 +0000 (00:13 +0200)]
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.

16 years ago* src/test.c (usage): Say that [ honors --help and --version, but test does not.
Jim Meyering [Tue, 28 Aug 2007 16:41:41 +0000 (18:41 +0200)]
* src/test.c (usage): Say that [ honors --help and --version, but test does not.

16 years agoBy default, do not install hostname anymore; no kidding, this time.
Jim Meyering [Tue, 28 Aug 2007 16:24:48 +0000 (18:24 +0200)]
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.

16 years agoReflect renaming: mreadlink-with-size -> areadlink-with-size.
Jim Meyering [Tue, 28 Aug 2007 07:11:36 +0000 (09:11 +0200)]
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.

16 years agoAdd file system type names and magic numbers from "man 2 statfs".
Jim Meyering [Mon, 27 Aug 2007 22:14:20 +0000 (00:14 +0200)]
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.

16 years agoAdd some file system type names and magic numbers from glibc.
Jim Meyering [Mon, 27 Aug 2007 21:46:49 +0000 (23:46 +0200)]
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.

16 years agotests/misc/fold: Fix a typo: missing \ in a never-seen diagnostic
Jim Meyering [Sun, 26 Aug 2007 16:44:29 +0000 (18:44 +0200)]
tests/misc/fold: Fix a typo: missing \ in a never-seen diagnostic

16 years agoAvoid case-insensitive clash in one-page-per-node html docs.
Eric Blake [Sat, 25 Aug 2007 22:49:52 +0000 (00:49 +0200)]
Avoid case-insensitive clash in one-page-per-node html docs.

* coreutils.texi (Concept index): Rename from Index.

16 years ago* src/dircolors.hin: Add .dz and .svgz as archive suffixes.
Jim Meyering [Sat, 25 Aug 2007 18:47:03 +0000 (20:47 +0200)]
* src/dircolors.hin: Add .dz and .svgz as archive suffixes.

16 years agoRemove all .cvsignore files from version control.
Jim Meyering [Fri, 24 Aug 2007 22:27:11 +0000 (00:27 +0200)]
Remove all .cvsignore files from version control.

16 years agobootstrap: Ignore more.
Jim Meyering [Fri, 24 Aug 2007 21:54:54 +0000 (23:54 +0200)]
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.

16 years agoNo longer version-control .???ignore files in lib/, m4/, and po/.
Jim Meyering [Fri, 24 Aug 2007 21:53:19 +0000 (23:53 +0200)]
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.

16 years agobootstrap: when fetching .po files, do not remove .gmo files.
Jim Meyering [Fri, 24 Aug 2007 20:42:25 +0000 (22:42 +0200)]
bootstrap: when fetching .po files, do not remove .gmo files.

* bootstrap (get_translations): Don't remove *.gmo files!
They can be expensive to regenerate.

16 years agoCreate .gitignore and/or .cvsignore from scratch, if absent.
Jim Meyering [Fri, 24 Aug 2007 20:40:23 +0000 (22:40 +0200)]
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.

16 years ago* src/system.h (fseeko, ftello): Remove now-unneeded definitions.
Jim Meyering [Fri, 24 Aug 2007 12:55:24 +0000 (14:55 +0200)]
* src/system.h (fseeko, ftello): Remove now-unneeded definitions.

16 years ago* src/od.c (LDBL_DIG): Remove now-unneeded definition.
Jim Meyering [Fri, 24 Aug 2007 12:51:55 +0000 (14:51 +0200)]
* src/od.c (LDBL_DIG): Remove now-unneeded definition.

16 years agoArrange to use tag names like vM.N, rather than COREUTILS-M_N.
Jim Meyering [Fri, 24 Aug 2007 12:07:06 +0000 (14:07 +0200)]
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).

16 years ago* src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
Jim Meyering [Thu, 23 Aug 2007 14:33:11 +0000 (16:33 +0200)]
* src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
Suggestion from Dan Nicolaescu.

16 years agoDon't let ln be a party to destroying user data.
Jim Meyering [Thu, 23 Aug 2007 09:51:01 +0000 (11:51 +0200)]
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>
16 years agoMove functions from copy.c into new modules, since ln needs them, too.
Jim Meyering [Thu, 23 Aug 2007 08:47:16 +0000 (10:47 +0200)]
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>
16 years agobootstrap: generate more names and fix a bug
Jim Meyering [Thu, 23 Aug 2007 07:50:58 +0000 (09:50 +0200)]
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.

16 years ago* Makefile.maint (patch-check): Don't remove temporaries upon failure.
Jim Meyering [Thu, 23 Aug 2007 07:46:14 +0000 (09:46 +0200)]
* Makefile.maint (patch-check): Don't remove temporaries upon failure.

16 years ago* src/c99-to-c89.diff: Adjust offsets.
Jim Meyering [Wed, 22 Aug 2007 21:49:51 +0000 (23:49 +0200)]
* src/c99-to-c89.diff: Adjust offsets.

16 years agoChange "rm --verbose -r a//" not to print extra slashes in a///b
Jim Meyering [Wed, 22 Aug 2007 18:02:34 +0000 (20:02 +0200)]
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.

16 years agoDon't include "getline.h".
Jim Meyering [Wed, 22 Aug 2007 14:56:13 +0000 (16:56 +0200)]
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.

16 years ago* src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.
Jim Meyering [Wed, 22 Aug 2007 09:20:41 +0000 (11:20 +0200)]
* src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.

16 years agoBy default, do not install hostname anymore.
Jim Meyering [Tue, 21 Aug 2007 08:34:33 +0000 (10:34 +0200)]
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.

16 years agoClarify touch documentation of file arguments.
Bob Proulx [Tue, 21 Aug 2007 04:04:45 +0000 (22:04 -0600)]
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.

16 years agoNEWS: note that a cp -p bug fixed in 6.7 affected releases before 6.0.
Paul Eggert [Mon, 20 Aug 2007 15:27:53 +0000 (17:27 +0200)]
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.

16 years agoAvoid consuming too much seekable input when yesno is used.
Eric Blake [Mon, 20 Aug 2007 15:01:18 +0000 (17:01 +0200)]
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.

16 years agoUse new "idcache.h" header.
Jim Meyering [Sat, 18 Aug 2007 06:59:10 +0000 (08:59 +0200)]
Use new "idcache.h" header.

* src/ls.c: Remove ancient declarations of getuser and getgroup.
Include "idcache.h", instead.

16 years agoRun each Coreutils.pm-based test in its own subdirectory.
Jim Meyering [Sat, 18 Aug 2007 06:50:00 +0000 (08:50 +0200)]
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.

16 years agoConsolidate od tests.
Jim Meyering [Thu, 16 Aug 2007 17:18:29 +0000 (19:18 +0200)]
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.

16 years ago* tests/ls/time-1: Include sample-test boilerplate code.
Jim Meyering [Thu, 16 Aug 2007 13:50:00 +0000 (15:50 +0200)]
* tests/ls/time-1: Include sample-test boilerplate code.
Remove the then-unnecessary, hard-coded envvar "unset" commands.

16 years agood --skip (-j) works even on files in /proc, when the kernel lies
Jim Meyering [Wed, 15 Aug 2007 20:44:45 +0000 (22:44 +0200)]
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.

16 years ago* src/printf.c (usage): Adjust summary to also mention OPTIONs.
Jim Meyering [Wed, 15 Aug 2007 08:05:22 +0000 (10:05 +0200)]
* src/printf.c (usage): Adjust summary to also mention OPTIONs.
From Karl Berry.

16 years agoAdd tests for the just-fixed "od -j N FILE" bug.
Jim Meyering [Tue, 14 Aug 2007 08:17:52 +0000 (10:17 +0200)]
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.

16 years agood: fix a bug that arises when skipping exact length of file
Jim Meyering [Tue, 14 Aug 2007 07:46:32 +0000 (09:46 +0200)]
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.

16 years agoAccommodate more xstrtol changes.
Paul Eggert [Sat, 11 Aug 2007 06:30:43 +0000 (08:30 +0200)]
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.

16 years agoAdapt to gnulib's latest xstrtol change.
Jim Meyering [Wed, 8 Aug 2007 18:02:55 +0000 (20:02 +0200)]
Adapt to gnulib's latest xstrtol change.
* POTFILES.in: Use lib/xstrtol-error.c, not lib/xstrtol.h.

16 years agoEncapsulate a static variable.
Jim Meyering [Sun, 5 Aug 2007 08:30:23 +0000 (10:30 +0200)]
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.

16 years ago* POTFILES.in: Remove lib/human.c.
Jim Meyering [Sat, 4 Aug 2007 11:45:34 +0000 (13:45 +0200)]
* POTFILES.in: Remove lib/human.c.

16 years agoExercise xstrtol's diagnostics via pr's --pages option.
Jim Meyering [Sat, 4 Aug 2007 11:45:21 +0000 (13:45 +0200)]
Exercise xstrtol's diagnostics via pr's --pages option.
* tests/misc/xstrtol: New file.
* tests/misc/Makefile.am (TESTS): Add xstrtol.

16 years agoAdapt to new human and xstrtol API.
Paul Eggert [Sat, 4 Aug 2007 11:36:59 +0000 (13:36 +0200)]
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.

16 years agoAdjust one more test to accommodate the recent fts change.
Jim Meyering [Thu, 2 Aug 2007 17:48:03 +0000 (19:48 +0200)]
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.

16 years agoAdjust the other two "no-x" tests and unify all three.
Jim Meyering [Thu, 2 Aug 2007 17:27:07 +0000 (19:27 +0200)]
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.

16 years agoAdapt du's no-x test not to fail on older Linux systems.
Jim Meyering [Thu, 2 Aug 2007 16:52:40 +0000 (18:52 +0200)]
Adapt du's no-x test not to fail on older Linux systems.
* tests/du/no-x: Accept a third variant of the diagnostic.

16 years agodu: print size (probably incomplete) of each inaccessible directory
Jim Meyering [Tue, 31 Jul 2007 08:46:31 +0000 (10:46 +0200)]
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>
16 years agoAdd a test for du not counting size of inaccessible directories.
Jim Meyering [Tue, 31 Jul 2007 07:49:05 +0000 (09:49 +0200)]
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>
16 years agoAdjust indentation to reflect today's change.
Jim Meyering [Sun, 29 Jul 2007 13:47:11 +0000 (15:47 +0200)]
Adjust indentation to reflect today's change.

16 years agoAttempt to copy a regular file, even if stat says it is empty.
Jim Meyering [Sat, 28 Jul 2007 16:49:04 +0000 (18:49 +0200)]
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é.

16 years agosort: Improve sort --random-sort test.
Bob Proulx [Thu, 26 Jul 2007 08:26:13 +0000 (02:26 -0600)]
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>
16 years agoNEWS: Move the other "sort" entry from the 6.9 section into 6.10 "Bug fixes".
Jim Meyering [Tue, 24 Jul 2007 08:00:59 +0000 (10:00 +0200)]
NEWS: Move the other "sort" entry from the 6.9 section into 6.10 "Bug fixes".

16 years agosort: add a test to exercise the affected code.
Jim Meyering [Tue, 24 Jul 2007 07:59:14 +0000 (09:59 +0200)]
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.

16 years agosort: avoid unaligned access.
Paul Eggert [Tue, 24 Jul 2007 07:40:55 +0000 (09:40 +0200)]
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>.

16 years agoUpdate all copyright notices to use the newer form.
Jim Meyering [Mon, 23 Jul 2007 12:35:58 +0000 (14:35 +0200)]
Update all copyright notices to use the newer form.

16 years ago* COPYING: Update to Version 3.
Jim Meyering [Mon, 23 Jul 2007 12:31:01 +0000 (14:31 +0200)]
* COPYING: Update to Version 3.

16 years agoUpdate c99/c89 patch for new, copyright-change-induced offsets.
Jim Meyering [Mon, 23 Jul 2007 12:07:02 +0000 (14:07 +0200)]
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.

17 years agoArrange to rerun configure whenever src/Makefile.am changes.
Jim Meyering [Sun, 22 Jul 2007 16:26:23 +0000 (18:26 +0200)]
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>
17 years ago* bootstrap (slurp): Work even in environments where "ls" defaults
Paul Eggert [Sat, 21 Jul 2007 13:00:54 +0000 (15:00 +0200)]
* 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.

17 years agoDocument and add a test for today's sort bug fix.
Jim Meyering [Fri, 20 Jul 2007 16:42:23 +0000 (18:42 +0200)]
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.

17 years ago* src/sort.c (main): Don't free a pointer to non-malloc'd memory.
Andreas Schwab [Fri, 20 Jul 2007 14:29:06 +0000 (16:29 +0200)]
* src/sort.c (main): Don't free a pointer to non-malloc'd memory.

17 years agoFix a portability bug in the new ls-color test.
Jim Meyering [Thu, 19 Jul 2007 08:17:39 +0000 (10:17 +0200)]
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.

17 years ago"cp -i --update older newer" no longer prompts; same for mv
Jim Meyering [Thu, 19 Jul 2007 08:14:41 +0000 (10:14 +0200)]
"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.

17 years agoChangeLog: Mention the correct function name in the 2007-07-08 bootstrap
Jim Meyering [Tue, 17 Jul 2007 07:16:59 +0000 (09:16 +0200)]
ChangeLog: Mention the correct function name in the 2007-07-08 bootstrap
entry.

17 years agols --color: Don't stat symlinks when neither ORPHAN nor MISSING attribute has a color.
Jim Meyering [Sun, 15 Jul 2007 20:13:16 +0000 (22:13 +0200)]
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.

17 years ago* coreutils.texi: Revise node structure per new fdl.texi.
Jim Meyering [Sun, 15 Jul 2007 20:11:45 +0000 (22:11 +0200)]
* coreutils.texi: Revise node structure per new fdl.texi.

17 years agoRemove long-deprecated options.
Jim Meyering [Sat, 30 Jun 2007 17:43:53 +0000 (19:43 +0200)]
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>
17 years agoChange interface: make 2nd param _space_-separated, not comma-separated
Jim Meyering [Sat, 14 Jul 2007 08:02:57 +0000 (10:02 +0200)]
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.

17 years ago* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
Karel Zak [Sat, 14 Jul 2007 07:38:42 +0000 (09:38 +0200)]
* 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.

17 years agoWarn about non-portable use of unescaped backslash at end of string,
Jim Meyering [Fri, 13 Jul 2007 16:37:16 +0000 (18:37 +0200)]
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.

17 years agoUse proper backslash-quoting inside backticks.
Jim Meyering [Fri, 13 Jul 2007 12:12:01 +0000 (14:12 +0200)]
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.

17 years agoExpand default-no-install prog list in ./configure --help output,
Jim Meyering [Thu, 12 Jul 2007 18:58:53 +0000 (20:58 +0200)]
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.

17 years agoClean up include-exclude-prog.m4.
Jim Meyering [Thu, 12 Jul 2007 09:41:32 +0000 (11:41 +0200)]
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.

17 years agoIf there's a GPL vN copyright comment, require that N == 3.
Jim Meyering [Wed, 11 Jul 2007 09:25:57 +0000 (11:25 +0200)]
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.

17 years agoSkip "arch" test if it's not built.
Jim Meyering [Tue, 10 Jul 2007 20:37:48 +0000 (22:37 +0200)]
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>
17 years agoAdd support for enabling/disabling installation of specified programs.
Jim Meyering [Tue, 10 Jul 2007 20:37:05 +0000 (22:37 +0200)]
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.

17 years agoNew program: arch
Karel Zak [Tue, 5 Jun 2007 21:29:32 +0000 (23:29 +0200)]
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>
17 years agoChange "version 2" to "version 3" in all copyright notices.
Jim Meyering [Tue, 10 Jul 2007 10:21:15 +0000 (12:21 +0200)]
Change "version 2" to "version 3" in all copyright notices.

17 years agoCompensate for new c99'isms in seq.c.
Jim Meyering [Mon, 9 Jul 2007 17:24:15 +0000 (19:24 +0200)]
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.

17 years agoFix the automatic number width formatting in seq.
P@draigBrady.com [Mon, 9 Jul 2007 15:07:38 +0000 (16:07 +0100)]
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>
17 years agoRun the coreutils-specific code only if tests/Makefile.am.in exists.
Jim Meyering [Sun, 8 Jul 2007 18:09:59 +0000 (20:09 +0200)]
Run the coreutils-specific code only if tests/Makefile.am.in exists.
* bootstrap (mam_template): Move definition out of loop.

17 years agoRemove .gdb-history.
Jim Meyering [Sun, 8 Jul 2007 17:12:48 +0000 (19:12 +0200)]
Remove .gdb-history.

17 years agoAdd to .cvsignore and .gitignore files.
Jim Meyering [Sun, 8 Jul 2007 15:25:05 +0000 (17:25 +0200)]
Add to .cvsignore and .gitignore files.

17 years agoCreate symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
Jim Meyering [Sun, 8 Jul 2007 15:24:29 +0000 (17:24 +0200)]
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/.

17 years agoTHANKS: Add Pádraig Brady.
Jim Meyering [Sun, 8 Jul 2007 14:42:16 +0000 (16:42 +0200)]
THANKS: Add Pádraig Brady.

2007-07-08  Jim Meyering  <jim@meyering.net>

17 years agoAdapt to deeper hierarchy in gnulib.
Jim Meyering [Sun, 8 Jul 2007 10:42:05 +0000 (12:42 +0200)]
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".