Skip to content

Commit

Permalink
Recognize a -c option to tell it to run chown on the created dirs
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@11716 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
Nicola Pero committed Dec 12, 2001
1 parent a412949 commit dc8fb4c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mkinstalldirs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# Make directory hierarchy.
# Written by Noah Friedman <friedman@prep.ai.mit.edu>
# Public domain.
# Modified by Adam Fedor, Nicola Pero

if test "$1"="-c"; then
CHOWN_TO="$2"
shift 2
else
CHOWN_TO=""
fi

defaultIFS='
'
Expand Down Expand Up @@ -34,7 +42,12 @@ for file in ${1+"$@"} ; do

if test ! -d "${pathcomp}"; then
echo "$MKDIR $pathcomp" 1>&2
$MKDIR "${pathcomp}" || errstatus=$?
if test ! -z "${CHOWN_TO}"; then
echo "chown $CHOWN_TO $pathcomp" 1>&2
($MKDIR "${pathcomp}"; chown $CHOWN_TO "${pathcomp}") || errstatus=$?
else
$MKDIR "${pathcomp}" || errstatus=$?
fi;
fi

pathcomp="${pathcomp}/"
Expand Down

0 comments on commit dc8fb4c

Please sign in to comment.