summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2007-07-29Attempt to copy a regular file, even if stat says it is empty.Jim Meyering
* 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-26sort: Improve sort --random-sort test.Bob Proulx
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-24NEWS: Move the other "sort" entry from the 6.9 section into 6.10 "Bug fixes".Jim Meyering
2007-07-24sort: add a test to exercise the affected code.Jim Meyering
* 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-24sort: avoid unaligned access.Paul Eggert
* 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-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-23* COPYING: Update to Version 3.Jim Meyering
2007-07-23Update c99/c89 patch for new, copyright-change-induced offsets.Jim Meyering
* Makefile.maint (patch-check): Filter out '^Only in...' lines. * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2007-07-22Arrange to rerun configure whenever src/Makefile.am changes.Jim Meyering
* 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-21* bootstrap (slurp): Work even in environments where "ls" defaultsPaul Eggert
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-20Document and add a test for today's sort bug fix.Jim Meyering
* NEWS: Describe the bug fix. * tests/sort/Test.pm (obs-inval): Add a test for today's fix.
2007-07-20* src/sort.c (main): Don't free a pointer to non-malloc'd memory.Andreas Schwab
2007-07-19Fix a portability bug in the new ls-color test.Jim Meyering
* 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"cp -i --update older newer" no longer prompts; same for mvJim Meyering
* 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-17ChangeLog: Mention the correct function name in the 2007-07-08 bootstrapJim Meyering
entry.
2007-07-15ls --color: Don't stat symlinks when neither ORPHAN nor MISSING attribute ↵Jim Meyering
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* coreutils.texi: Revise node structure per new fdl.texi.Jim Meyering
2007-07-14Remove long-deprecated options.Jim Meyering
* 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-14Change interface: make 2nd param _space_-separated, not comma-separatedJim Meyering
* 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* m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.Karel Zak
(gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter. Don't mix comma- and space-separated lists. Patch from Karel Zak.
2007-07-13Warn about non-portable use of unescaped backslash at end of string,Jim Meyering
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-13Use proper backslash-quoting inside backticks.Jim Meyering
* configure.ac: Otherwise we run afoul of strict GNU tr: a string ending in a lone backslash would provoke a failure.
2007-07-12Expand default-no-install prog list in ./configure --help output,Jim Meyering
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-12Clean up include-exclude-prog.m4.Jim Meyering
* 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-11If there's a GPL vN copyright comment, require that N == 3.Jim Meyering
* Makefile.maint (sc_GPL_version): New rule. * tests/misc/arch: Fix the sole violation.
2007-07-10Skip "arch" test if it's not built.Jim Meyering
* 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-10Add support for enabling/disabling installation of specified programs.Jim Meyering
* 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-10New program: archKarel Zak
* 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-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-07-09Compensate for new c99'isms in seq.c.Jim Meyering
* 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-09Fix the automatic number width formatting in seq.P@draigBrady.com
* 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-08Run the coreutils-specific code only if tests/Makefile.am.in exists.Jim Meyering
* bootstrap (mam_template): Move definition out of loop.
2007-07-08Remove .gdb-history.Jim Meyering
2007-07-08Add to .cvsignore and .gitignore files.Jim Meyering
2007-07-08Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.Jim Meyering
* 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-08THANKS: Add Pádraig Brady.Jim Meyering
2007-07-08 Jim Meyering <jim@meyering.net>
2007-07-08Adapt to deeper hierarchy in gnulib.Jim Meyering
* bootstrap (gnulib_tool): If the destination directory doesn't exist, create it. This is required at least for "lib/uniwidth/cjk.h".
2007-07-08Use <wchar.h>, not "wcwidth.h".Jim Meyering
* 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-07Fix typo in comment.Jim Meyering
2007-07-06setuidgid: set all groups, not just the primary one; mgetgroups: new moduleJim Meyering
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-05* bootstrap: Merge in changes from gnulib.Jim Meyering
2007-07-05* src/id.c: Include "getugroups.h" rather than declaring manually.Jim Meyering
2007-07-04Add Paul's ChangeLog for previous patch.Jim Meyering
Restore the m4/.gitignore file I inadvertently removed.
2007-07-04pr -F no longer suppresses the footer or the first two blank header linesPaul Eggert
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-06-23Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.Jim Meyering
* 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-23seq no longer mishandles cases like "seq 0 0.000001 0.000003",Paul Eggert
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-22Add test cases for seq off-by-one problem.Pádraig Brady
2007-06-22* src/stat.c (long_options): Add a FIXME comment to help ensureJim Meyering
that the deprecated and undocumented "--filesystem" option is removed someday.
2007-06-18A few more symlink-related fixes. Fix a bug triggered by cpPaul Eggert
--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-18Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.Jim Meyering
* 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.