diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-07-17 06:06:48 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-07-17 06:06:48 +0000 |
commit | 5f531596a92e1205a700218dedfe7a525eef21c8 (patch) | |
tree | 43198350d38d7a770d9c309265e06e3588b2c762 /modules | |
parent | c7c220336bdebb2f0302e2a618a3537a80f8e979 (diff) | |
download | gnulib-5f531596a92e1205a700218dedfe7a525eef21c8.tar.gz |
Import from coreutils.
* MODULES.html.sh: Add mkancestors.
* modules/mkancesdirs: New module.
* modules/mkdir-p (Files): Remove lib/chdir-safer.c, lib/chdir-safer.h,
lib/same-inode.h, m4/afs.m4, m4/chdir-safer.m4.
The chdir-safer and afs files are now orphans; I'll remove them
unless someone speaks up.
Add lib/dirchownmod.c, lib/dirchownmod.h.
(Depends-on): Remove alloca, chown, save-cwd, dirname.
Add lchown, mkancesdirs.
(Maintainer): Add self.
* lib/dirchownmod.c, lib/dirchownmod.h:
* lib/mkancesdirs.c, lib/mkancesdirs.h: New files.
* lib/mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
save-cwd.h. Instead, include dirchownmod.h and mkancesdirs.h.
(make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
MODE_BITS. Remove options VERBOSE_FMT_STRING, CWD_ERRNO. All
callers changed. Revamp internals significantly, by not
attempting to create directories that are temporarily more
permissive than the final results. Do not attempt to use
save_cwd/restore_cwd; it isn't worth it for mkdir and install.
This removes some race conditions, fixes some bugs, and simplifies
things. Use new dirchownmod function to do owner and mode changes.
* lib/mkdir-p.h: Likewise.
* lib/modechange.c (octal_to_mode): New function.
(struct mode_change): New member mentioned.
(make_node_op_equals): New arg mentioned. All callers changed.
(mode_compile): Keep track of which mode bits the user has explicitly
mentioned.
(mode_adjust): New arg DIR, so that we implement the X op correctly.
New arg PMODE_BITS, to keep track of which mode bits the user
mentioned; it treats S_ISUID and S_ISGID speciall.
All callers changed.
* lib/modechange.h: Likewise.
* mkancesdirs.m4: New file.
* mkdir-p.m4 (gl_MKDIR_PARENTS): Mention dirchownmod.c, dirchownmod.h.
Don't require AC_FUNC_ALLOCA, gl_AFS, gl_CHDIR_SAFER; no longer needed.
Require gl_FUNC_LCHOWN, since dirchownmod.c needs it.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mkancesdirs | 25 | ||||
-rw-r--r-- | modules/mkdir-p | 17 |
2 files changed, 31 insertions, 11 deletions
diff --git a/modules/mkancesdirs b/modules/mkancesdirs new file mode 100644 index 0000000000..73d9b5dfdc --- /dev/null +++ b/modules/mkancesdirs @@ -0,0 +1,25 @@ +Description: +Ensure the existence of the ancestor directories of a file. + +Files: +lib/mkancesdirs.c +lib/mkancesdirs.h +m4/mkancesdirs.m4 + +Depends-on: +dirname +stat-macros + +configure.ac: +gl_MKANCESDIRS + +Makefile.am: + +Include: +"mkancesdirs.h" + +License: +GPL + +Maintainer: +Paul Eggert, Jim Meyering diff --git a/modules/mkdir-p b/modules/mkdir-p index 0ef6f6044a..28cabda217 100644 --- a/modules/mkdir-p +++ b/modules/mkdir-p @@ -2,24 +2,19 @@ Description: Ensure that a directory and its parents exist. Files: -lib/chdir-safer.c -lib/chdir-safer.h +lib/dirchownmod.c +lib/dirchownmod.h lib/lchmod.h lib/mkdir-p.c lib/mkdir-p.h -lib/same-inode.h -m4/afs.m4 -m4/chdir-safer.m4 m4/lchmod.m4 m4/mkdir-p.m4 Depends-on: -alloca -chown -gettext-h -save-cwd -dirname error +gettext-h +lchown +mkancesdirs quote stat-macros stdbool @@ -36,4 +31,4 @@ License: GPL Maintainer: -Jim Meyering +Paul Eggert, Jim Meyering |