📄 changelog
字号:
* Version 4.1.3. * src/sys2.h (HELP_OPTION_DESCRIPTION): New macro. (VERSION_OPTION_DESCRIPTION): New macro. * src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c, * src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c, * src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/rm.c, * src/rmdir.c, src/shred.c, src/stat.c, src/sync.c, src/touch.c (usage): Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION instead of hard-coding --help and --version descriptions. * POTFILES.in: Add src/sys2.h. * src/touch.c (touch): Extend the change of 2001-09-15 to work on systems for which errno is set to EPERM in that case. Thus, e.g., `touch /' by non-root gives a better diagnostic on systems like SunOS4. Reported by Volker Borchert. Don't emulate dd's skip=N for *all* character devices; lseek works just fine on non-tape character devices like /dev/mem and /dev/kmem. * src/dd.c (buggy_lseek_support) [__linux__]: Emulate `skip=N' behavior using reads, not lseek for Linux tape devices (major == 9). Kernel lseek support for tapes is broken, up to and including linux-2.4.16. Reported by Herbert Xu.2001-11-27 Jim Meyering <meyering@lucent.com> * tests/ls/rt-1: Compare all lines of output. Update code to use `trap' and more up to date infrastructure. The change of 2001-11-01 introduced a bug whereby some recursive listings didn't have a blank line between per-directory groups of files. * src/ls.c (print_dir): Print a newline before each directory name except the first one, rather than after each except the last, since now (after the changes of 2001-11-01) detecting whether a `pending*' is the last would involve more work. Reported by Andreas Schwab. * tests/ls/recursive: New file. Test for the above. * tests/ls/Makefile.am (TESTS): Add recursive. This change has no net effect. * src/ls.c (main): Remove always-true conjunct and add a comment.2001-11-26 Jim Meyering <meyering@lucent.com> * src/shred.c: Don't include "gtod.h" (main): Don't `call' GETTIMEOFDAY_INIT. * src/ls.c: Likewise.2001-11-24 Jim Meyering <meyering@lucent.com> * Makefile.maint: Include signatures for the xdelta file, too. * Makefile.maint (emit-upload-commands): Rename from emit-rsync-commands. Output only the package name and the prev and current version numbers. * Version 4.1.2. * src/sync.c (usage): Make --help and --version strings start in column 7. * Makefile.cfg (move_if_change): Remove definition. ($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change.2001-11-23 Jim Meyering <meyering@lucent.com> * cp.c, df.c, du.c, install.c, ln.c, ls.c, mkdir.c (usage): * mkfifo.c, mknod.c, mv.c, shred.c, touch.c (usage): Note that ``Mandatory arguments to long options are mandatory for short options too.'' * src/shred.c (usage): Use `output', not `print' in description of the --version option, so this message is consistent with all the rest. * chgrp.c, chmod.c, chown.c, cp.c, dd.c, df.c, dircolors.c (usage): * du.c, install.c, ln.c, ls.c, rm.c, rmdir.c, shred.c, touch.c (usage): Split --help output into smaller pieces. Use fputs, not printf. * src/cp-hash.c: Use opaque type, Hash_table, not `struct hash_table'. * src/du.c: Likewise. * src/remove.c: Likewise.2001-11-22 Jim Meyering <meyering@lucent.com> Don't fail for commands like this: cp a a d/ This change in behavior was introduced in 4.1.1, as part of the 2001-09-28 change. cp and mv still fail for commands like this: rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c * src/copy.c (triple_hash_no_name): New function. (src_info_init): New function. (copy_internal): Warn and return early for the second and subsequent occurrences of the same source file named on the command line. * src/copy.h (struct cp_options) [src_info]: New member. * src/install.c (cp_option_init): Initialize new member. * src/mv.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (do_copy): Call src_info_init. * tests/mv/dup-source: New test for the above. * tests/mv/Makefile.am (TESTS): Add dup-source. * src/copy.c (seen_file): Change type of `stats' parameter to pointer. (copy_internal): Update caller. * src/copy.c (struct F_triple): Rename from dest_info. (seen_file): Rename from seen_dest. Rename parameters accordingly. (record_file): Rename from record_dest. Rename parameters accordingly. (triple_hash): Rename from dest_info_hash. (triple_compare): Rename from dest_info_compare. (triple_free): Rename from dest_info_free. * src/mknod.c (main): Add a literal format string to suppress a warning from gcc's -Wformat-security. copy.c shouldn't maintain static state. * src/copy.c (dest_info): Remove declaration of file-scoped global. (dest_info_init): Require a parameter. Update all callers. (seen_dest): Require a hash table parameter. Update callers. (record_dest): Likewise. * src/copy.h: Include hash.h. (struct cp_options) [dest_info]: New member. * src/install.c (cp_option_init): Initialize new member. * src/mv.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (do_copy): Remove const attribute from declaration of parameter, x.2001-11-17 Jim Meyering <meyering@lucent.com> * tests/chmod/equals: New test for the just-fixed bug in lib/modechange.c. * tests/chmod/Makefile.am (TESTS): Add equals. * configure.ac: Replace use of the one-arg form of AC_INIT with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR.2001-11-12 Jim Meyering <meyering@lucent.com> * tests/rm/r-3: Clean up.2001-11-09 Jim Meyering <meyering@lucent.com> * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no arguments.2001-11-06 Jim Meyering <meyering@lucent.com> * src/dircolors.hin: Remove duplicate entry for .png. Reported by Fr閐閞ic L. W. Meunier.2001-11-03 Jim Meyering <meyering@lucent.com> * Version 4.1.1. * src/ls.c (DEV_INO_PUSH): Avoid unnecessary copies. (dev_ino_pop): Likewise.2001-11-02 Jim Meyering <meyering@lucent.com> * src/ls.c: Rename global: s/trace_dirs/recursive/. (extract_dirs_from_files): Rename parameter: s/recursive/ignore_dot_and_dot_dot/. * src/ls.c: (dev_ino_pop): Cast 2nd arg of obstack_blank to `int' before negating to avoid warning from gcc on systems with 64-bit size_t. * src/ls.c: Use XMALLOC and XREALLOC in a several places. It's cleaner.2001-11-01 Jim Meyering <meyering@lucent.com> * src/ls.c: Include dirfd.h. (print_dir): If dirfd fails, resort to using stat. * tests/ls/infloop: Redirect cmp's stderr to /dev/null. * src/ls.c (struct pending) [st_ino, st_dev]: Remove members. (queue_directory): Remove just-added 3rd parameter and associated code, and update callers. (print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...', and call visit_dir to detect cycles here. Push the dev/inode pair onto the new stack. (dev_ino_obstack): New global. (DEV_INO_PUSH): New macro. (dev_ino_pop): New function. (ASSERT_MATCHING_DEV_INO): New macro. (visit_dir): Take two parameters (dev,ino), not one `pending'. (main): Initialized the dev_ino_obstack. Don't call visit_dir here. Get the dev/ino pair from the new stack, not from the pending entry. Make ls -R detect directory cycles. Add loop detection without incurring an additional stat call per directory processed. To detect loops efficiently (i.e., time: +O(1) per directory processed by ls -R, total additional space: O(max-tree-depth)), record the dev/ino of each `active' directory in a hash table. To know when a directory is no longer active, insert a marker (name == NULL) entry for it in the pending queue. When a marker comes to the front of the queue, that directory is no longer active, and must be removed from the hash table. To remove it, we need to know its dev/ino again. Since by the time a directory has become inactive its files[] info is long gone and it's DIR* is closed, I must either save the dev/ino someplace (pending seemed logical) or recompute them via stat. The following change will convert to using a stack of dev/ino pairs instead, pushing an entry when doing the opendir (use fstat on dirfd (reading)), and popping (when encountering a marker) to get the dev/ino pair to be removed from the hash table. * src/ls.c: Include hash.h, same.h, and xalloc.h. (INITIAL_TABLE_SIZE, LOOP_DETECT): Define. (active_dir_set): New global. (struct dev_ino): Declare. (dev_ino_hash, dev_ino_compare, dev_ino_free): New functions. (visit_dir, free_pending_ent): New functions. (main): Initialize the active_dir_set hash table, if necessary. Don't confuse a marker entry with a real one. Detect loops. Manage the set of active directories. Free the hash table. (queue_directory): Add a new parameter. Ensure that we set the new dev/ino members for each enqueued directory. Update all callers. (print_dir): Don't confuse a marker entry with a real one. (extract_dirs_from_files): Insert a marker entry before inserting the entries for subdirectories. Don't try to print a NULL pointer. * src/ls.c (main): Don't use ARGMATCH_TO_ARGUMENT. This reverts part of the 1998-12-31 change. * tests/ls/dired: New test, for the above. * tests/ls/Makefile.am (TESTS): Add dired.2001-10-24 Jim Meyering <meyering@lucent.com> * src/cp.c (main): Free hash table storage. * src/cp-hash.c (forget_all): Use hash_free, not hash_clear.2001-10-22 Paul Eggert <eggert@twinsun.com> * src/sys2.h (alloca): Define to __builtin_alloca if __GNUC__, to avoid a warning if -Wall.2001-10-21 Paul Eggert <eggert@twinsun.com> * src/dd.c: Remove as many instances of 'unsigned' as possible, as some of them were not conforming to ANSI C, and they made the code hard to read. Avoiding 'unsigned' cuts down on the number of casts. (newline_character, space_character, save_char): Now char, not unsigned char. (obuf): Now char *, not unsigned char *. (ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii): Now char[], not unsigned char[]. (translate_charset, translate_buffer, swab_buffer, skip, copy_simple, copy_with_block, copy_with_unblock): Arg now points to char, not unsigned char. All callers changed. (translate_charset, parse_conversion, apply_translations): Use int index, not unsigned int. (bit_count): Arg is now int, not unsigned int. Callers not changed, as they already assumed this. (translate_buffer): Cast char to unsigned char before using it as a subscript. (swab_buffer): Returns char *, not unsigned char *. (dd_copy): Use char, not unsigned char, for buffers. Use size_t for possibly-large index, not unsigned int.2001-10-21 Jim Meyering <meyering@lucent.com> * src/shred.c (isaac_seed_machdep): Handle SIGSEGV, too. Ick. * tests/mv/Makefile.am (TESTS): Remove i-3. It's not portable. * src/copy.c: Include xreadlink.h. (copy_internal): Don't use PATH_MAX. Rewrite the symlink-copying code to use xreadlink.2001-10-20 Jim Meyering <meyering@lucent.com> * src/touch.c (touch): Extend last change to work on systems for which errno is set to EINVAL. * src/ls.c: Declare some local variables to be `const', where appropriate. (usage): Improve the description of --dereference (-L). * src/rm.c (usage): Clarify description of --directory (-d). Based on a patch from Michael Stone. * man/chmod.x: Describe sticky files and directories. From Michael Stone. * tests/mv/partition-perm: Don't use a umask that removes owner read/write. Use a stricter test for permissions. * tests/cp/link-preserve: Don't use a umask that removes owner read/write. That would induce spurious failures in a probably- outdated version of purify.2001-10-18 Jim Meyering <meyering@lucent.com> * src/mv.c (movefile): Now that remember_copied xstrdup's the file name, free `new_dest'. Plug a leak. * src/cp-hash.c (remember_copied): Use src_to_dest_free to free the entry we couldn't insert. Don't use free'd memory. * src/copy.c (dest_info_free): New function. (dest_info_init): Make the hash table code use it. (record_dest): Store each DEST in malloc'd memory. Hence the above. Use dest_info_free to free the `ent' we couldn't insert.2001-10-14 Jim Meyering <meyering@lucent.com> Now, -P is the same as --no-dereference, per POSIX. Use --parents to get the old meaning. * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: Remove member. (long_opts): Associate --no-dereference with `-P'. (usage): Update description of -P. (main): Remove local, used_P_option, and code to warn that the meaning of -P would be changing.2001-10-13 Jim Meyering <meyering@lucent.com> * src/copy.c (copy_internal): Tighten up and add comments describing the test for when to record (via remember_copied) a <dst_path, source_dev, source_ino> triple. Relax the test that guards the hard-linked-dir check and the hard-link-preserving code. Remove the link-preserving semantics from cp_options.dereference. Clean up the code that preserves links for `cp -d' and `mv'. Introduce new options: --preserve[={mode,ownership,timestamps,links,all}] --no-preserve={mode,ownership,timestamps,links,all} -p and --preserve remain unchanged and are equivalent to `--preserve=mode,ownership,timestamps' * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: New member. (enum) [NO_PRESERVE_ATTRIBUTES_OPTION]: New member. (enum) [PRESERVE_ATTRIBUTES_OPTION]: New member. (long_opts): Separate -d and --no-dereference options. Add `no-preserve'. Separate -p and --preserve options. The long-named --preserve now accepts optional arguments; -p doesn't. (usage): Describe additions and changes. (cp_option_init): Initialize new member, preserve_links, to 0. (decode_preserve_arg): New function. (main) [case 'a']: Set preserve_links to 1. [case 'd']: Set preserve_links to 1. Add `case' for long-named --no-dereference. Handle long-named --no-preserve and --preserve. * src/copy.h (enum Dereference_symlink): Add comments. (struct cp_options) [preserve_links]: New member.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -