Skip to content

Commit

Permalink
Do not test for 'mkdir -p' ... mkdir -p was supposed to prevent race …
Browse files Browse the repository at this point in the history
…conditions,

but the test for mkdir -p was itself a generator of major race conditions (and
wrote on the filesystem etc) - also don't echo what we do


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@14649 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
nico committed Oct 4, 2002
1 parent 9628036 commit 5250b70
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions mkinstalldirs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,13 @@ else
CHOWN_TO=""
fi

MKDIR="mkdir"

defaultIFS='
'
IFS="${IFS-${defaultIFS}}"

errstatus=0
# Test mkdir -p
mkdir -p .test-mkdir || errstatus=$?
rmdir .test-mkdir
if test $errstatus != 0 -o -d "-p"; then
if test -d "-p"; then
rmdir -p
fi
MKDIR="mkdir"
else
MKDIR="mkdir -p"
fi

for file in ${1+"$@"} ; do
oIFS="${IFS}"
Expand All @@ -41,9 +32,9 @@ for file in ${1+"$@"} ; do
pathcomp="${pathcomp}${d}"

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

0 comments on commit 5250b70

Please sign in to comment.