2000-05-20 05:33:44 +00:00
|
|
|
#! /bin/sh
|
|
|
|
# mkinstalldirs --- make directory hierarchy
|
|
|
|
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
|
|
# Created: 1993-05-16
|
|
|
|
# Public domain
|
|
|
|
|
|
|
|
errstatus=0
|
|
|
|
|
|
|
|
for file
|
|
|
|
do
|
|
|
|
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
|
|
shift
|
|
|
|
|
|
|
|
pathcomp=
|
|
|
|
for d
|
|
|
|
do
|
|
|
|
pathcomp="$pathcomp$d"
|
|
|
|
case "$pathcomp" in
|
|
|
|
-* ) pathcomp=./$pathcomp ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test ! -d "$pathcomp"; then
|
2003-11-21 12:48:55 +00:00
|
|
|
echo "mkdir $pathcomp"
|
2000-05-20 05:33:44 +00:00
|
|
|
|
2003-11-21 12:48:55 +00:00
|
|
|
mkdir "$pathcomp" || lasterr=$?
|
2000-05-20 05:33:44 +00:00
|
|
|
|
2003-11-21 12:48:55 +00:00
|
|
|
if test ! -d "$pathcomp"; then
|
|
|
|
errstatus=$lasterr
|
|
|
|
fi
|
2000-05-20 05:33:44 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
pathcomp="$pathcomp/"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $errstatus
|
|
|
|
|
|
|
|
# mkinstalldirs ends here
|