summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-02-17install: add --compare (-C) option to install file only when necessaryKamil Dudka
* 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-17nl: correct long-option name for -v in usageOndřej Vašík
* nl.c (usage): Use --starting-line-number, not --first-page for -v
2009-02-15doc: id: make --help and .man more descriptiveJim Meyering
* 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-14seq: Fix equal width calculation when '.' added to last numberPádraig Brady
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-13du,chgrp,chmod,chown: use FTS_DEFER_STATJim Meyering
* 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-13maint: mention how to run a single test in HACKING docsPádraig Brady
* 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-11ln: add details to --help textEric Blake
* 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-10ls: clean up after wrapped+colored file names with clear-to-EOLJim Meyering
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* tests/test-lib.sh: Use skip_test_... in place of echo...;exit 77.Jim Meyering
2009-02-10tests: avoid skipping stty-* testsNix
* tests/test-lib.sh (require_controlling_input_terminal_): Check stdout, not stdin.
2009-02-09touch: deprecate --file option: equivalent to --reference (-r)Jim Meyering
* src/touch.c: Mark long-undocumented --file for removal in 2010. (main): Warn upon use of --file.
2009-02-06tests: fix dd skip=greater_max_file_size test on Solaris 10Pádraig Brady
* 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-05avoid spurious parentheses/arith-op-related warnings from newer gccJim Meyering
* src/copy.c (set_owner): Use && rather than &. * src/stty.c (main): Likewise. * src/wc.c (wc): Likewise.
2009-02-02maint: tighten atoi/atof-prohibiting regexp, clean up .x-sc- fileJim Meyering
* maint.mk (sc_prohibit_atoi_atof): Require "(" after token. * .x-sc_prohibit_atoi_atof: Remove names that no longer contain a match.
2009-02-02doc: preserve --help line breaks in 'REPORTING BUGS' man page sectionJim Meyering
* man/help2man: Insert .br between adjacent lines.
2009-02-02* src/system.h (emit_bug_reporting_address): Remove periods.Jim Meyering
2009-02-02update copyright dates from recent changesJim Meyering
* 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* maint.mk (sc_redundant_const): Use $(_prohibit_regexp).Jim Meyering
2009-02-02date doc: warn at -d about LC_TIMEjidanni@jidanni.org
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-02document sort --ignore-case --unique interactionjidanni@jidanni.org
2009-01-31maint: detect useless inclusion of c-ctype.hJim Meyering
* maint.mk (sc_prohibit_c_ctype_without_use): New rule.
2009-01-29maint: teach "make syntax-check" to print each check name as it's runJim Meyering
* 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-29maint: silence some syntax-check rulesJim Meyering
* cfg.mk (sc_strftime_check): Silence the rule. (sc_tight_scope): Likewise. * src/Makefile.am (check-AUTHORS): Likewise.
2009-01-29maint: factor syntax-check rulesJim Meyering
* maint.mk (_ignore_case): New macro. (_prohibit_regexp): Use it. Factor many existing syntax-check rules to use $(_prohibit_regexp).
2009-01-29cp/mv: add xattr supportKamil Dudka
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-28system.h: add a comment re autoconf's new AC_PACKAGE_URLJim Meyering
* src/system.h (emit_bug_reporting_address): Add a comment suggesting to use AC_PACKAGE_URL once we require autoconf-2.64.
2009-01-28tests: Fixup shred-passes testPádraig Brady
* tests/misc/shred-passes: Set the $fail variable correctly. The issue was noticed by Jim Meyering.
2009-01-28tests: Add a test to verify shred's default operationsPádraig Brady
* 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-28dd: Better handle user specified offsets that are too bigPádraig Brady
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-27doc: emit better bug-reporting info, to help help2manJim Meyering
* 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-27doc: ensure that emit_bug_reporting_address changes propagate to *.1Jim Meyering
* man/Makefile.am ($(MAN)): Depend on system.h.
2009-01-27doc: restore "REPORTING BUGS" section to generated man pagesJim Meyering
* 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-26tests: generalize install-transform-checkJim Meyering
* maint.mk (install-transform-check): Generalize to work also in a project that installs manuals in a section other than "1".
2009-01-23build: resolve conflict with new declaration from version-etc.hJim Meyering
* 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-22doc: shred: Correct docs on default number of overwrites.Pádraig Brady
* 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-22shred: change default number of overwrites from 25 to 3Pádraig Brady
* 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-21m4: don't use AC_REQUIRE([AC_C_BIGENDIAN])Jim Meyering
* 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-19no longer define *_FILENO constantsJim Meyering
* src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Remove definitions. Now guaranteed by gnulib.
2009-01-19build: use dist-xz, not dist-lzma, cont'dJim Meyering
* README-hacking: mention XZ utils * README-prereq: Add a FIXME comment.
2009-01-19tests: tail-2/infloop-1 is racyJim Meyering
* tests/tail-2/infloop-1: Add a comment to that effect.
2009-01-18build: use dist-xz, not dist-lzmaJim Meyering
* configure.ac (AM_INIT_AUTOMAKE): s/dist-lzma/dist-xz/. Requires recent "xz" from git://ctrl.tukaani.org/lzma-utils.git
2009-01-16maint: remove obsolete sc_author_mark_check ruleJim Meyering
* maint.mk (sc_author_mark_check): Remove rule. "and" no longer appears in the definition of AUTHORS.
2009-01-16Merge branch 'master' of git://git.sv.gnu.org/coreutilsJim Meyering
2009-01-16maint: enforce existing prohibition: no cvs $keywords$Jim Meyering
* maint.mk (sc_prohibit_cvs_keyword): New rule.
2009-01-16echo, printf, test: remove unused #include directivesJim Meyering
* src/echo.c: Don't include "long-options.h". No longer used. * src/printf.c: Likewise. * src/test.c: Likewise.
2009-01-16pathchk: avoid -Wsign-compare warningsPádraig Brady
* src/pathchk.c: Compare pathconf limits to _signed_ MAX constants, as pathconf returns signed values.
2009-01-16pr: avoid -Wsign-compare warningsPádraig Brady
* src/pr.c: Use unsigned variables in unsigned comparisons.
2009-01-16shred: avoid -Wsign-compare warningsPádraig Brady
* 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-16simplify mgetgroups() and avoid -Wsign-compare warningsPádraig Brady
* 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-14test, echo, printf: don't accept option abbreviationEric Blake
* src/test.c (main): Directly parse accepted options, thus avoiding abbreviations. * src/echo.c (main): Likewise. * src/printf.c (main): Likewise.