Jim Meyering [Fri, 21 Jun 2002 13:20:39 +0000 (13:20 +0000)]
tiny tweaks
Jim Meyering [Fri, 21 Jun 2002 13:19:31 +0000 (13:19 +0000)]
(stat invocation): New section. From Michael Meskes.
Jim Meyering [Fri, 21 Jun 2002 12:48:36 +0000 (12:48 +0000)]
.
Jim Meyering [Fri, 21 Jun 2002 12:48:06 +0000 (12:48 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:48:00 +0000 (12:48 +0000)]
(wget-update): Checkout into config/.
Warn when skipping a file.
Jim Meyering [Fri, 21 Jun 2002 12:34:49 +0000 (12:34 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:34:44 +0000 (12:34 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:34:36 +0000 (12:34 +0000)]
Include sys/statvfs.h.
[!HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H]: Include sys/param.h
and sys/mount.h, to get decl of struct statfs on NetBSD 1.5.2.
(NAMEMAX_FORMAT, STRUCT_STATVFS): Define.
(HAVE_STRUCT_STATXFS_F_TYPE, SB_F_NAMEMAX): Define.
Remove `static' attribute from decl of program_name.
(human_fstype): Use f_basetype or f_fstypename if available.
(print_human_time): Use nstrftime and an ISO format string, in
place of strftime with `%c'. The latter is too locale-dependent.
(print_statfs): Deal with lots of portability issues: some fields
are available only with statfs, others only with statvfs, and
some are available in both, but with different types.
(do_statfs) [DEFAULT_FORMAT_TERSE]: Factor out.
[DEFAULT_FORMAT_VERBOSE]: Likewise.
Jim Meyering [Fri, 21 Jun 2002 12:16:27 +0000 (12:16 +0000)]
.
Jim Meyering [Fri, 21 Jun 2002 12:15:39 +0000 (12:15 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:13:51 +0000 (12:13 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:12:08 +0000 (12:12 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 12:12:00 +0000 (12:12 +0000)]
(jm_CHECK_ALL_HEADERS): Check for hurd.h.
Jim Meyering [Fri, 21 Jun 2002 12:10:02 +0000 (12:10 +0000)]
Change all `preserving ...' diagnostics to
`failed to preserve ...' to make the failure clearer.
Jim Meyering [Fri, 21 Jun 2002 12:06:17 +0000 (12:06 +0000)]
Include hurd.h.
(copy_internal): Preserve the stat.st_author field.
Jim Meyering [Fri, 21 Jun 2002 07:20:49 +0000 (07:20 +0000)]
*** empty log message ***
Jim Meyering [Fri, 21 Jun 2002 07:20:36 +0000 (07:20 +0000)]
(LOGIN_NAME_MAX): Define if not already defined.
(ID_LENGTH_MAX): Define.
(ST_DM_MODE): New macro. Code moved from...
(print_long_format): ...here.
(print_long_format): Itemize and comment the individual parts
of init_bigbuf. Use the above *_MAX macros.
Jim Meyering [Thu, 20 Jun 2002 15:58:18 +0000 (15:58 +0000)]
Change `defined(X)' syntax to `defined X' in cpp directives.
Jim Meyering [Wed, 19 Jun 2002 11:13:29 +0000 (11:13 +0000)]
*** empty log message ***
Jim Meyering [Wed, 19 Jun 2002 11:12:59 +0000 (11:12 +0000)]
Report an error if neither S_ISREG nor
S_IFREG is defined, instead of using a test specific to glibc
2.2. This should be safe, since POSIX requires S_ISREG and
Unix Version 7 had S_IFREG. We don't need to check for
<sys/types.h> since we don't use any symbols that it defines.
Jim Meyering [Mon, 17 Jun 2002 07:06:29 +0000 (07:06 +0000)]
Interpret a permissions string of
drwxr-xr-x (DOS/Windows) as meaning the cwd is not setgid.
Reported by Rich Dawe.
Jim Meyering [Mon, 17 Jun 2002 07:06:19 +0000 (07:06 +0000)]
*** empty log message ***
Jim Meyering [Sun, 16 Jun 2002 19:18:22 +0000 (19:18 +0000)]
use newer testing framework
Jim Meyering [Sat, 15 Jun 2002 16:04:16 +0000 (16:04 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 16:03:57 +0000 (16:03 +0000)]
Include <sys/types.h> before system.h.
Jim Meyering [Sat, 15 Jun 2002 14:05:31 +0000 (14:05 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 14:05:25 +0000 (14:05 +0000)]
ls --author
Jim Meyering [Sat, 15 Jun 2002 13:43:20 +0000 (13:43 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 13:42:54 +0000 (13:42 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 13:42:22 +0000 (13:42 +0000)]
(jm_CHECK_ALL_TYPES): Check for st_author.
Jim Meyering [Sat, 15 Jun 2002 13:41:46 +0000 (13:41 +0000)]
(st_author) [! HAVE_STRUCT_STAT_ST_AUTHOR]: New macro.
(print_author): New var.
(AUTHOR_OPTION): New enum val.
(long_options, decode_switches, print_long_format, usage):
Support --author.
(format_user): New function.
(print_long_format): Use it. Make print buffer a bit bigger.
Jim Meyering [Sat, 15 Jun 2002 13:26:42 +0000 (13:26 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 13:26:38 +0000 (13:26 +0000)]
(ls invocation): Document new option: --author.
Jim Meyering [Sat, 15 Jun 2002 10:19:36 +0000 (10:19 +0000)]
use trap stuff from sample-test
Jim Meyering [Sat, 15 Jun 2002 10:17:35 +0000 (10:17 +0000)]
use trap stuff from sample-test
Jim Meyering [Sat, 15 Jun 2002 10:16:22 +0000 (10:16 +0000)]
now that $tmp has two components, use mkdir's -p option to create it
Jim Meyering [Sat, 15 Jun 2002 10:15:00 +0000 (10:15 +0000)]
now that $tmp has two components, use mkdir's -p option to create it
Jim Meyering [Sat, 15 Jun 2002 10:04:30 +0000 (10:04 +0000)]
use trap stuff from sample-test
Jim Meyering [Sat, 15 Jun 2002 09:58:37 +0000 (09:58 +0000)]
use trap stuff from sample-test
Jim Meyering [Sat, 15 Jun 2002 09:54:28 +0000 (09:54 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 09:54:08 +0000 (09:54 +0000)]
(trap): in chmod, use u+rwx, not 700
Jim Meyering [Sat, 15 Jun 2002 09:46:43 +0000 (09:46 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 09:46:32 +0000 (09:46 +0000)]
(trap): Make sure the temporary hierarchy is writable before removing it.
Jim Meyering [Sat, 15 Jun 2002 09:45:05 +0000 (09:45 +0000)]
Use better trap.
trap 'status=$?; cd $pwd; chmod -R 700 $t0; rm -rf $t0 && exit $status' 0
Jim Meyering [Sat, 15 Jun 2002 09:41:47 +0000 (09:41 +0000)]
Use quoted here doc by default,
so e.g., backticks don't need to be escaped.
Jim Meyering [Sat, 15 Jun 2002 09:40:25 +0000 (09:40 +0000)]
(TESTS): Add perm-1.
Jim Meyering [Sat, 15 Jun 2002 09:40:07 +0000 (09:40 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 08:47:55 +0000 (08:47 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 08:47:25 +0000 (08:47 +0000)]
.
Jim Meyering [Sat, 15 Jun 2002 08:47:12 +0000 (08:47 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 08:46:59 +0000 (08:46 +0000)]
(lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
so that each temporary file name is unique and valid in the first
8 characters, for operation under DOS.
Jim Meyering [Sat, 15 Jun 2002 08:43:45 +0000 (08:43 +0000)]
(FILE_TYPE_H): Guard entire contents with #ifndef.
For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
have been included before this file.
Jim Meyering [Sat, 15 Jun 2002 08:40:55 +0000 (08:40 +0000)]
For GNU libc 2.2 and newer, ensure that <sys/types.h>
has been included before this file.
Jim Meyering [Sat, 15 Jun 2002 08:04:23 +0000 (08:04 +0000)]
.
Jim Meyering [Sat, 15 Jun 2002 08:03:24 +0000 (08:03 +0000)]
Change temp file names to accommodate DOS 8.3 file name limitation.
Jim Meyering [Sat, 15 Jun 2002 08:02:16 +0000 (08:02 +0000)]
Change temp. file name: s/\.err/_err/, for DOS.
Jim Meyering [Sat, 15 Jun 2002 08:01:41 +0000 (08:01 +0000)]
Change temp file names to accommodate DOS 8.3 file name limitation.
Jim Meyering [Sat, 15 Jun 2002 08:01:20 +0000 (08:01 +0000)]
Remove leading `.' from temp. names.
Jim Meyering [Sat, 15 Jun 2002 07:56:40 +0000 (07:56 +0000)]
Change temp file names to accommodate DOS 8.3 file name limitation.
Jim Meyering [Sat, 15 Jun 2002 07:37:29 +0000 (07:37 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 07:37:21 +0000 (07:37 +0000)]
(S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK is defined.
Jim Meyering [Sat, 15 Jun 2002 07:36:57 +0000 (07:36 +0000)]
(S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK is defined.
Jim Meyering [Sat, 15 Jun 2002 06:54:05 +0000 (06:54 +0000)]
*** empty log message ***
Jim Meyering [Sat, 15 Jun 2002 06:53:57 +0000 (06:53 +0000)]
(S_ISNAM): Add to list of S_IS* macros.
Rearrange #if directives for each S_IS macro.
From diffutils-2.8.2.
Jim Meyering [Fri, 14 Jun 2002 07:53:01 +0000 (07:53 +0000)]
*** empty log message ***
Jim Meyering [Fri, 14 Jun 2002 07:52:32 +0000 (07:52 +0000)]
Use the version from diffutils-2.8.2.
Jim Meyering [Thu, 13 Jun 2002 09:30:02 +0000 (09:30 +0000)]
update from master sources
Jim Meyering [Wed, 12 Jun 2002 08:02:12 +0000 (08:02 +0000)]
tweak expected message
Jim Meyering [Wed, 12 Jun 2002 08:01:48 +0000 (08:01 +0000)]
(do_move): Give one diagnostic, not two, when unable to
unlink a destination file. This bug was introduced in fileutils-3.16l.
$ /bin/mv /etc/passwd /tmp
/bin/mv: cannot unlink `/etc/passwd': Permission denied
/bin/mv: cannot remove `/etc/passwd': Permission denied
[Exit 1]
Jim Meyering [Wed, 12 Jun 2002 08:00:50 +0000 (08:00 +0000)]
(rm): Fix typo in assertion.
Jim Meyering [Fri, 7 Jun 2002 14:57:19 +0000 (14:57 +0000)]
tweak output: s/ directory//
Jim Meyering [Fri, 7 Jun 2002 14:49:33 +0000 (14:49 +0000)]
*** empty log message ***
Jim Meyering [Fri, 7 Jun 2002 14:49:21 +0000 (14:49 +0000)]
Also accept the permission-denied diagnostic
issued by some losing systems. Reported by Volker Borchert.
Jim Meyering [Fri, 7 Jun 2002 14:44:02 +0000 (14:44 +0000)]
.
Jim Meyering [Fri, 7 Jun 2002 14:43:41 +0000 (14:43 +0000)]
*** empty log message ***
Jim Meyering [Fri, 7 Jun 2002 14:43:36 +0000 (14:43 +0000)]
(jm_PREREQ_STAT): Check for sys/param.h and sys/mount.h.
They're needed at least for NetBSD 1.5.2.
($statxfs_includes): Include those same headers.
($statxfs_includes): Include sys/vfs.h if available.
($statxfs_includes): Likewise for sys/statvfs.h.
Check for the following members in both structs statfs and statvfs:
f_basetype, f_type, f_fsid.__val, f_namemax, f_namelen.
Jim Meyering [Fri, 7 Jun 2002 14:39:21 +0000 (14:39 +0000)]
*** empty log message ***
Jim Meyering [Fri, 7 Jun 2002 14:39:09 +0000 (14:39 +0000)]
(remove_entry): Use DT_IS_DIR only if
HAVE_STRUCT_DIRENT_D_TYPE is defined.
Jim Meyering [Thu, 6 Jun 2002 07:48:26 +0000 (07:48 +0000)]
.
Jim Meyering [Mon, 3 Jun 2002 11:07:02 +0000 (11:07 +0000)]
*** empty log message ***
Jim Meyering [Mon, 3 Jun 2002 11:06:58 +0000 (11:06 +0000)]
(rm invocation): Add the warning (also in the --help output)
that the contents of a removed file are often recoverable.
Jim Meyering [Sun, 2 Jun 2002 21:30:07 +0000 (21:30 +0000)]
*** empty log message ***
Jim Meyering [Sun, 2 Jun 2002 21:28:41 +0000 (21:28 +0000)]
(enum RM_status) [RM_NONEMPTY_DIR]: New member.
(UPDATE_STATUS): New macro.
Include save-cwd.h.
(struct File_spec): Remove declaration.
Update prototypes.
Jim Meyering [Sun, 2 Jun 2002 20:50:33 +0000 (20:50 +0000)]
(main): Adapt to new calling sequence for rm.
Jim Meyering [Sun, 2 Jun 2002 20:50:20 +0000 (20:50 +0000)]
(do_move): Adapt to new calling sequence for rm.
Jim Meyering [Sun, 2 Jun 2002 20:49:03 +0000 (20:49 +0000)]
Merge in all changes from no-recursion branch.
* src/remove.c (enum Ternary): Define type.
(prompt): Add a parameter. Adjust callers.
(remove_entry): Attempt rmdir here, only if a directory is
`known' to be empty. Significant rework.
(remove_dir): Propagate failure `up' also when rmdir fails.
In interactive mode, prompt only once about an empty directory.
* src/remove.c (enum Prompt_action): Define.
(prompt): Two new parameters. Adjust all callers.
Performance.
* src/remove.c (remove_entry) [!ROOT_CAN_UNLINK_DIRS]:
Don't call rmdir here.
* src/remove.c (AD_pop_and_chdir): Don't use errno (it's not valid)
in diagnostic for changed dev/ino.
(remove_entry): Tweak diagnostic.
* src/remove.c (ROOT_CAN_UNLINK_DIRS): Define.
(AD_pop_and_chdir): Propagate status as we traverse back `up' the tree.
(DO_UNLINK, DO_RMDIR): Define.
(remove_entry) [ROOT_CAN_UNLINK_DIRS]: Add code so this works also on
systems where root can use `unlink' to remove directories.
* src/remove.c: Include file-type.h.
Include file type in prompt when asking whether to remove file.
Based on a patch from Paul Eggert.
* src/remove.c (prompt): Add comment.
* src/remove.c (remove_dir): Fix another (known) leak.
* src/remove.c (hash_freer): New function.
(AD_mark_helper): Use it.
(AD_mark_as_unremovable): xstrdup the filename argument.
(remove_dir): Free directory name.
* src/remove.c (remove_entry): Fail also when trying to remove a
directory without the --recursive option.
Change a diagnostic, s/unlink/remove/, now that it can apply also
to a directory.
* src/remove.c (is_empty_dir): New function.
(prompt): New function, factored out of...
(remove_entry): ...here. Call it.
(remove_dir): Call prompt before rmdir.
* src/remove.c (remove_entry): Add support for prompting (e.g., -i).
* src/remove.h (UPDATE_STATUS): New macro.
* src/remove.c [AD_ent] (status): New member. This lets us propagate
the status from a subdirectory to its parent via AD_pop_and_chdir.
(AD_push_initial): Set it.
(AD_push): Likewise.
(remove_cwd_entries): Change return type to enum RM_status, and
adjust all callers.
(rm): Use UPDATE_STATUS rather than open-coding it.
* src/remove.c (remove_entry): New function, factored out of...
(remove_cwd_entries): ...here, and...
(rm_1): ...here.
* src/remove.c (remove_cwd_entries): Add support for --verbose.
(remove_dir): Likewise.
(rm_1): Likewise.
* src/remove.c (rm): Free cwd_state, if necessary.
* src/remove.c (rm_1): Remove now useless (always true)
user_specified_name parameter. Adjust sole caller.
* src/remove.c (rm): New function. This interface allows
one to remove multiple arguments at a time. This is important in
that it allows us to hide the remove_init/remove_fini functions and
the cwd_state parameter.
(rm_1): Renamed from rm.
(remove_init, remove_fini): Remove functions. Each body is now
part of `rm'.
Jim Meyering [Sun, 2 Jun 2002 20:45:46 +0000 (20:45 +0000)]
*** empty log message ***
Jim Meyering [Sun, 2 Jun 2002 20:39:20 +0000 (20:39 +0000)]
.
Jim Meyering [Sun, 2 Jun 2002 20:39:00 +0000 (20:39 +0000)]
(TESTS): Add rm5.
Jim Meyering [Sun, 2 Jun 2002 20:37:43 +0000 (20:37 +0000)]
Adjust, now that we no longer report `removing all entries of directory ...'.
Jim Meyering [Sun, 2 Jun 2002 20:36:19 +0000 (20:36 +0000)]
adjust
Jim Meyering [Sun, 2 Jun 2002 20:35:07 +0000 (20:35 +0000)]
don't give a diagnostic about each parent
Jim Meyering [Sat, 1 Jun 2002 09:38:48 +0000 (09:38 +0000)]
*** empty log message ***
Jim Meyering [Sat, 1 Jun 2002 09:38:41 +0000 (09:38 +0000)]
Remove use of D_TYPE_IN_DIRENT, now that that symbol has been renamed.
Jim Meyering [Sat, 1 Jun 2002 09:37:58 +0000 (09:37 +0000)]
*** empty log message ***
Jim Meyering [Sat, 1 Jun 2002 09:37:53 +0000 (09:37 +0000)]
(jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename macro:
s/D_TYPE_IN_DIRENT/HAVE_STRUCT_DIRENT_D_TYPE/.
Jim Meyering [Sat, 1 Jun 2002 08:41:31 +0000 (08:41 +0000)]
*** empty log message ***
Jim Meyering [Thu, 30 May 2002 07:50:19 +0000 (07:50 +0000)]
*** empty log message ***
Jim Meyering [Thu, 30 May 2002 07:49:56 +0000 (07:49 +0000)]
(copy_reg): Use a temporary to avoid a warning
from gcc -W about comparison between signed and unsigned.
(copy_internal): Likewise, but use a cast.
Jim Meyering [Wed, 29 May 2002 13:16:40 +0000 (13:16 +0000)]
.