2006-11-26 04:11:12 -07:00
|
|
|
#! /bin/sh
|
2007-08-25 12:53:27 -06:00
|
|
|
# $Id: mkdirs.sh,v 1.1.1.2 2007/08/25 18:54:02 matthieu Exp $
|
|
|
|
# -----------------------------------------------------------------------------
|
2006-11-26 04:11:12 -07:00
|
|
|
# mkinstalldirs --- make directory hierarchy
|
|
|
|
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
|
|
# Created: 1993-05-16
|
|
|
|
# Last modified: 1994-03-25
|
|
|
|
# Public domain
|
2007-08-25 12:53:27 -06:00
|
|
|
# -----------------------------------------------------------------------------
|
2006-11-26 04:11:12 -07:00
|
|
|
|
|
|
|
errstatus=0
|
|
|
|
umask 022
|
|
|
|
|
|
|
|
for file in ${1+"$@"} ; do
|
|
|
|
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
|
|
shift
|
|
|
|
|
|
|
|
pathcomp=
|
|
|
|
for d in ${1+"$@"} ; do
|
|
|
|
pathcomp="$pathcomp$d"
|
|
|
|
case "$pathcomp" in
|
|
|
|
-* ) pathcomp=./$pathcomp ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test ! -d "$pathcomp"; then
|
|
|
|
echo "mkdir $pathcomp" 1>&2
|
|
|
|
case "$pathcomp" in
|
|
|
|
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
|
2007-08-25 12:53:27 -06:00
|
|
|
;; # DOSISH systems
|
|
|
|
* )
|
|
|
|
mkdir "$pathcomp"
|
|
|
|
errstatus=$?
|
|
|
|
if test $errstatus != 0
|
|
|
|
then
|
|
|
|
# may have failed if invoked in a parallel "make -j# install"
|
|
|
|
if test -d "$pathcomp"
|
|
|
|
then
|
|
|
|
errstatus=0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
2006-11-26 04:11:12 -07:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
pathcomp="$pathcomp/"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $errstatus
|
|
|
|
|
|
|
|
# mkinstalldirs ends here
|