Jim Meyering [Thu, 16 Jun 2005 09:15:23 +0000 (09:15 +0000)]
Finally remove support for --version-control=S (-V).
It was deprecated nearly 6 years ago and has been warning
users to switch to --backup=S since fileutils-4.0j.
Paul Eggert [Tue, 14 Jun 2005 23:56:49 +0000 (23:56 +0000)]
(make_dir): Remove. All uses replaced by mkdir.
(make_dir_parents): Last arg is now int * (for errno), not bool *.
Rewrite "mkdir -p" algorithm to avoid the need for "stat"
each time through the loop. Do not diagnose restore_cwd failure;
that is the caller's job (and perhaps the caller does not care).
Paul Eggert [Tue, 14 Jun 2005 23:55:47 +0000 (23:55 +0000)]
(create_parents): Remove static var (now local to 'main').
(main): Standardize on a diagnostic for restore_cwd failure,
and report errno.
Don't bother to check cwd_errno unless create_parents.
Use mkdir rather than make_dir; it's simpler.
Paul Eggert [Tue, 14 Jun 2005 23:55:24 +0000 (23:55 +0000)]
(main): Standardize on a diagnostic for
restore_cwd failure, and report errno.
(install_file_in_file_parents): Fail if restore_cwd fails and
one of the files is relative. This fixes a bug (albeit unlikely).
Paul Eggert [Tue, 14 Jun 2005 18:35:38 +0000 (18:35 +0000)]
(CLEANUP_CWD, CLEANUP): Remove.
(make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
If the file already exists but is not a directory, don't bother
to try to make its parents.
Close potential file descriptor leak if we can't chdir("/") (!).
Don't always return true if chdir($PWD) fails; return true only
if the requested action was done successfully (except for the
chdir($PWD)).
Don't log final directory unless we actually made it.
Refactor to avoid duplicate code to fix up permissions.
Don't attempt to fix up parent permissions if chdir($PWD) fails.
Jim Meyering [Tue, 14 Jun 2005 06:54:39 +0000 (06:54 +0000)]
Provide an alternative to exiting immediately upon save_cwd or
restore_cwd failure. Now, an application can arrange e.g.,
to perform a longjump in that case.
* openat.c: Include dirname.h.
Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
(rpl_openat, fdopendir, fstatat): Call openat_save_die
and openat_restore_die rather than calling error directly.
Don't include "error.h" or "exitfail.h"; they're no longer needed.
* openat-die.c (openat_save_die, openat_restore_die): New file.
* openat.h (openat_save_die, openat_restore_die): Declare and define.
Jim Meyering [Mon, 13 Jun 2005 10:19:18 +0000 (10:19 +0000)]
(main): When make_dir_parents changes the current working
directory, give a diagnostic about each subsequent failure to create
a dot-relative directory.
(install_file_in_file_parents): Update make_dir_parents caller.
Jim Meyering [Mon, 13 Jun 2005 10:17:36 +0000 (10:17 +0000)]
(main): When make_dir_parents changes the current working
directory, give a diagnostic about each subsequent failure to create
a dot-relative directory.
Jim Meyering [Mon, 13 Jun 2005 10:15:19 +0000 (10:15 +0000)]
(make_dir_parents): New parameter: different_working_dir,
to tell caller if/when we change the working directory and are
unable to return to the initial one.
Paul Eggert [Fri, 10 Jun 2005 19:31:45 +0000 (19:31 +0000)]
(any_has_acl): New var.
(clear_files): Clear it.
(gobble_file): Set it if a file has an ACL.
(print_long_format): Omit needless space unless some file has an ACL.
Paul Eggert [Thu, 2 Jun 2005 05:15:07 +0000 (05:15 +0000)]
Don't use "path" or "filename".
(struct file_name): Renamed from struct Path. All uses changed.
(file_name_free): Renamed from path_free. All uses changed.
(file_name_init): Renamed from path_init. All uses changed.
(file_name_prepend): Renamed from path_prepend. All uses changed.
Paul Eggert [Thu, 2 Jun 2005 05:12:17 +0000 (05:12 +0000)]
Don't use "path" or "filename".
(usage): Don't use "path" to describe a file name.
(remove_empty_parents): Renamed from empty_paths.
All uses changed.
(longopts): Add comment that --path is deprecated.