Commit Graph
15857 Commits
Author SHA1 Message Date
Jim Meyering b2816db207 . 2002-06-07 14:44:02 +00:00
Jim Meyering 2e6f8bf01e *** empty log message *** 2002-06-07 14:43:41 +00:00
Jim Meyering a3eb51b0e2 (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.
2002-06-07 14:43:36 +00:00
Jim Meyering 6d3ea70cf7 *** empty log message *** 2002-06-07 14:39:21 +00:00
Jim Meyering b965b62436 (remove_entry): Use DT_IS_DIR only if
HAVE_STRUCT_DIRENT_D_TYPE is defined.
2002-06-07 14:39:09 +00:00
Jim Meyering 8bd3e55a54 . 2002-06-06 07:48:26 +00:00
Jim Meyering cb93da5115 *** empty log message *** 2002-06-03 11:07:02 +00:00
Jim Meyering 9897e1994c (rm invocation): Add the warning (also in the --help output)
that the contents of a removed file are often recoverable.
2002-06-03 11:06:58 +00:00
Jim Meyering 52fc0276d7 *** empty log message *** 2002-06-02 21:30:07 +00:00
Jim Meyering ce73721712 (enum RM_status) [RM_NONEMPTY_DIR]: New member.
(UPDATE_STATUS): New macro.
Include save-cwd.h.
(struct File_spec): Remove declaration.
Update prototypes.
2002-06-02 21:28:41 +00:00
Jim Meyering 0f6d0c6016 (main): Adapt to new calling sequence for rm. 2002-06-02 20:50:33 +00:00
Jim Meyering a4b18d8961 (do_move): Adapt to new calling sequence for rm. 2002-06-02 20:50:20 +00:00
Jim Meyering fb205872c1 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'.
2002-06-02 20:49:03 +00:00
Jim Meyering a4ff1d036d *** empty log message *** 2002-06-02 20:45:46 +00:00
Jim Meyering 26693888de . 2002-06-02 20:39:20 +00:00
Jim Meyering 63a8743830 (TESTS): Add rm5. 2002-06-02 20:39:00 +00:00
Jim Meyering 2ef6aec8ce Adjust, now that we no longer report `removing all entries of directory ...'. 2002-06-02 20:37:43 +00:00
Jim Meyering d38d008a1d adjust 2002-06-02 20:36:19 +00:00
Jim Meyering 09184490e9 don't give a diagnostic about each parent 2002-06-02 20:35:07 +00:00
Jim Meyering c27d78e6e0 *** empty log message *** 2002-06-01 09:38:48 +00:00
Jim Meyering 3b96dac1d7 Remove use of D_TYPE_IN_DIRENT, now that that symbol has been renamed. 2002-06-01 09:38:41 +00:00
Jim Meyering c96356eba9 *** empty log message *** 2002-06-01 09:37:58 +00:00
Jim Meyering 1d478cbd05 (jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename macro:
s/D_TYPE_IN_DIRENT/HAVE_STRUCT_DIRENT_D_TYPE/.
2002-06-01 09:37:53 +00:00
Jim Meyering 10d0bbfbc7 *** empty log message *** 2002-06-01 08:41:31 +00:00
Jim Meyering 76c7142a55 *** empty log message *** 2002-05-30 07:50:19 +00:00
Jim Meyering e913eebe7c (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.
2002-05-30 07:49:56 +00:00
Jim Meyering 79278d0cad . 2002-05-29 13:16:40 +00:00
Jim Meyering 8af3bb0443 more acronyms 2002-05-28 10:03:56 +00:00
Jim Meyering e8b70f2823 *** empty log message *** 2002-05-28 08:50:57 +00:00
Jim Meyering 79e4cbd57a (jm_FUNC_READDIR): Undefine mkdir', not rmdir'. 2002-05-28 08:50:53 +00:00
Jim Meyering 0057fa16a4 use a better test 2002-05-27 21:38:21 +00:00
Jim Meyering 924d623ac8 *** empty log message *** 2002-05-27 20:05:16 +00:00
Jim Meyering 636fceb22a Use @acronym in place of most uses of @sc. 2002-05-27 20:05:03 +00:00
Jim Meyering ab0ab21b2e (check-texinfo): Adapt to reflect that now we use @acronym{POSIX}. 2002-05-27 20:01:03 +00:00
Jim Meyering 625d533476 *** empty log message *** 2002-05-27 16:44:12 +00:00
Jim Meyering 2eef2b57dd (AC_FUNC_GETTIMEOFDAY_CLOBBER): Also replace localtime. 2002-05-27 16:44:07 +00:00
Jim Meyering faa8bced59 *** empty log message *** 2002-05-27 16:43:00 +00:00
Jim Meyering d2be1268c4 Fix a problem seen only on nonconforming systems whereby ls.c's
use of localtime, and then of gettimeofday would cause trouble:
the localtime call used to initialize rpl_gettimeofday's save
mechanism would clobber ls's current local time information so
that in any long listing the first file would always be listed
with date 1970-01-01.  Analysis by Volker Borchert.

(localtime): Undefine.
(rpl_localtime): New function.
2002-05-27 16:42:55 +00:00
Jim Meyering c75c72a9fc *** empty log message *** 2002-05-27 15:09:34 +00:00
Jim Meyering fc1018de0e (jm_FUNC_READDIR): Undefine `rmdir' so we don't try to
use the replacement function; it wouldn't resolve at link time.
Reported by Volker Borchert.
2002-05-27 15:09:29 +00:00
Jim Meyering 7ec9be427c *** empty log message *** 2002-05-26 15:29:17 +00:00
Jim Meyering 5e15547dad Use @acronym in place of most uses of @sc. 2002-05-26 15:29:10 +00:00
Jim Meyering e9f9963e6b fix typo: s/S_TYPEISTMO/S_TYPEISMQ/ 2002-05-25 22:42:05 +00:00
Jim Meyering ad9071c4ba fix typo 2002-05-25 22:39:13 +00:00
Jim Meyering 0ef5b0241e remove typo 2002-05-25 22:39:07 +00:00
Jim Meyering ef71f8a52d Adapt for changed format of --verbose output. 2002-05-24 16:40:33 +00:00
Jim Meyering 4c9753bdf7 . 2002-05-24 14:09:45 +00:00
Jim Meyering e8e002ad91 *** empty log message *** 2002-05-24 09:01:11 +00:00
Jim Meyering 36efe03850 *** empty log message *** 2002-05-24 08:59:17 +00:00
Jim Meyering 37877a3b9c renamed from nice 2002-05-24 08:37:05 +00:00