Paul Eggert
f232dfa081
(recurse, force_silent, process_file, process_files, main): Use bool
...
when appropriate.
2004-07-30 04:06:41 +00:00
Jim Meyering
1ce7b61d0e
(main): Standardize on the diagnostics given when someone gives
...
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-21 15:03:35 +00:00
Jim Meyering
7c6999b6f8
(mode_changed): Return false, not 0, now that the function returns `bool'.
2004-06-09 09:06:34 +00:00
Jim Meyering
bc580f6a56
Adjust chmod and chown to be similar if -c or -v are given. In
...
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior. Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.
* src/chmod.c (CH_NOT_APPLIED): New constant.
(describe_change): Handle it.
(process_file): Use it, if a symlink wasn't changed.
(mode_changed): Return bool, not int. Accept new argument
NEW_MODE; all callers changed. This lets us avoid statting the
file unless the new mode has unusual bits.
(process_file): Return -1 on error. With -v, report all errors
verbosely, not just some.
2004-06-09 09:05:02 +00:00
Jim Meyering
ba1a527bdd
Don't include savedir.h -- no longer needed.
2004-03-27 08:43:36 +00:00
Jim Meyering
c5a68e8782
(usage): Use EXIT_SUCCESS, not 0, for clarity.
2004-01-21 22:44:43 +00:00
Jim Meyering
567bfed936
(usage): Describe new options.
2003-11-09 21:03:57 +00:00
Jim Meyering
c3a7cbe225
Include "root-dev-ino.h".
...
(process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
ROOT_DEV_INO_WARN macros.
(get_root_dev_ino): Remove function definition, now that it's
been moved to a separate file.
2003-11-09 20:53:21 +00:00
Jim Meyering
11e97f430c
(AUTHORS): Add my name.
2003-11-04 06:21:03 +00:00
Jim Meyering
96a5d2ce6a
chmod now uses fts to perform a directory traversal when -R is
...
specified. Before, it operated on full path names, and as such
would encounter the PATH_MAX (often 4096) limit.
Include "xfts.h".
(process_file): Rename from change_file_mode.
Adapt to be used with fts.
(process_files): New function.
2003-10-19 18:54:10 +00:00
Jim Meyering
cf4fdf373f
Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
...
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-18 10:05:47 +00:00
Jim Meyering
9be74f6f12
New options: --preserve-root and --no-preserve-root.
...
(change_file_mode): Honor new option.
(change_file_mode): Strip trailing slashes on directory
argument passed to change_dir_mode.
(get_root_dev_ino): New function.
(main): Initialize global, root_dev_ino.
2003-10-12 14:19:25 +00:00
Jim Meyering
4a992bfdd8
(change_file_mode): Don't #ifdef-out a simple use of
...
S_ISLNK. The S_IS* macros are guaranteed to be defined
via system.h.
2003-10-12 07:05:16 +00:00
Jim Meyering
bafd927f03
(WRITTEN_BY): Rename from AUTHORS.
...
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
2003-09-18 22:19:03 +00:00
Jim Meyering
6bcd4b08ba
(main): Call initialize_main.
2003-06-17 18:13:23 +00:00
Jim Meyering
a5f14f167e
Remove all uses of `PARAMS'.
2002-12-15 20:54:29 +00:00
Jim Meyering
4006f4e672
Change exit (0)' to exit (EXIT_SUCCESS)',
...
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-31 08:52:10 +00:00
Jim Meyering
7488703199
Change error (1, ...' to error (EXIT_FAILURE, ...'.
2002-08-30 23:04:53 +00:00
Jim Meyering
d23970e52e
(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.
2002-07-02 09:05:33 +00:00
Jim Meyering
0ef9bacdc7
split long line
2001-12-11 11:49:14 +00:00
Jim Meyering
879adb17cc
(change_file_mode, main):
...
Include the word `fail' in some diagnostics to make it clearer
that they indicate a failure.
s/getting attributes/failed to get attributes/
2001-12-11 11:48:54 +00:00
Jim Meyering
f3ac2e7839
Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
...
instead of hard-coding --help and --version descriptions.
2001-12-02 22:26:57 +00:00
Jim Meyering
b78de3e724
Split usage strings so that --help and --version
...
descriptions are alone in their own string.
2001-11-23 20:10:25 +00:00
Jim Meyering
a5f1ced62a
(usage): Split --help output into smaller pieces.
...
Use fputs, not printf.
2001-11-23 15:41:16 +00:00
Jim Meyering
72dadf240e
(main): Don't strip trailing slashes; POSIX doesn't allow it here.
...
Don't include "dirname.h" when no longer needed.
2001-09-15 10:32:05 +00:00
Jim Meyering
d7c291117c
(change_dir_mode): Remove statp arg; no longer needed.
2001-08-31 09:16:54 +00:00
Jim Meyering
4a94a06aa6
(strip_trailing_slashes): Remove declaration; now in dirname.h.
2001-05-12 09:51:23 +00:00
Jim Meyering
ba94ef5b1b
(mode_changed, change_file_mode):
...
There's no need to invoke both lstat and stat here, so call just
one of the two functions.
2001-05-12 08:04:44 +00:00
Jim Meyering
6202e79712
(mode_changed): New function.
...
(change_file_mode): Use it to determine accurately when -c should
make chmod announce there's been a change.
2000-11-23 15:04:17 +00:00
Jim Meyering
02080dd37e
(main): Better diagnostics.
2000-11-01 17:33:09 +00:00
Jim Meyering
f8e66794d9
(change_file_mode): Perform the chmod even if the
...
file mode permission bits are the same as those that should be set.
Omitting the chmod call would be alright with minimal 1003.1e DS17
ACLs, but eventually there will be other permissions in addition to
rwx. E.g., add and delete for directories, and something analogous
to NT's take ownership permission.
2000-09-30 09:39:41 +00:00
Jim Meyering
8180fd9209
(main): Invoke xalloc_die instead of printing our own message.
2000-08-08 07:07:55 +00:00
Jim Meyering
b53d6da640
Convert "`%s'" in format strings to "%s", and wrap each
...
corresponding argument in a `quote (...)' call.
Add more precise diagnostics.
2000-07-30 16:16:16 +00:00
Jim Meyering
ebd74667bc
(change_file_mode): Save errno from a possibly failed chown,
...
and use that later. Otherwise, errno itself could be clobbered before used.
2000-07-25 22:22:52 +00:00
Jim Meyering
53ec884edb
(change_dir_mode): Don't set errno before
...
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-27 13:10:50 +00:00
Jim Meyering
81b16373ae
Arrange to call close_stdout only upon exit.
2000-05-13 06:49:53 +00:00
Jim Meyering
1645ace5e7
Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'.
1999-11-07 20:00:54 +00:00
Jim Meyering
41a7bbf8e0
(change_dir_mode): Remove cast of savedir arg.
1999-08-08 10:14:01 +00:00
Jim Meyering
5d76644c3e
(describe_change, change_file_mode): Use proper mode_t types and macros.
...
Don't assume the traditional Unix values for mode bits.
1999-04-26 12:51:43 +00:00
Jim Meyering
667799f7e2
Don't include closeout.h or version-etc.h explicitly. Now, they're included via sys2.h.
1999-03-31 05:59:13 +00:00
Jim Meyering
c92de17d2f
define and use AUTHORS
1999-03-26 05:17:17 +00:00
Jim Meyering
06303195c0
No longer include long-options.h.
...
Include version-etc.h instead.
(PROGRAM_NAME): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
1999-03-26 04:11:15 +00:00
Jim Meyering
cec649b346
tweak usage message -- from Karl
1999-03-22 22:36:12 +00:00
Jim Meyering
61fa70ac19
Include long-options.h
...
[long_options]: Remove the "help" and "version" entries.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
1999-03-04 05:09:05 +00:00
Jim Meyering
07c6f5e387
update copyright dates
1999-02-16 04:14:17 +00:00
Jim Meyering
410a3c94e8
(usage): Don't make it static so that it can be called from libfu.a by xargmatch.
1999-01-16 15:33:16 +00:00
Jim Meyering
08cfef16a2
update bug-reporting address
1998-09-19 17:17:58 +00:00
Jim Meyering
ce0ba9e9d9
(long_options): Replace 12 with CHAR_MAX + 1.
1998-08-30 03:02:21 +00:00
Jim Meyering
461aea548a
Include filemode.h.
1998-08-13 02:06:41 +00:00
Jim Meyering
63c0f480ad
Use a single enumerated type, Verbosity, instead of
...
the two booleans, verbose and changes_only. This fixes a bug whereby
--change had the same effect as --verbose.
Plus Paul's close_stdout changes.
1998-01-04 22:41:02 +00:00