1995-02-18 09:27:10 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# mkinstalldirs --- make directory hierarchy
|
|
|
|
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
|
|
# Created: 1993-05-16
|
|
|
|
# Public domain
|
|
|
|
|
|
|
|
errstatus=0
|
|
|
|
|
1995-07-26 12:26:23 +08:00
|
|
|
for file
|
|
|
|
do
|
1995-02-18 09:27:10 +08:00
|
|
|
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
|
|
shift
|
|
|
|
|
|
|
|
pathcomp=
|
1996-05-03 15:37:52 +08:00
|
|
|
for d
|
|
|
|
do
|
1995-02-18 09:27:10 +08:00
|
|
|
pathcomp="$pathcomp$d"
|
|
|
|
case "$pathcomp" in
|
|
|
|
-* ) pathcomp=./$pathcomp ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test ! -d "$pathcomp"; then
|
|
|
|
echo "mkdir $pathcomp" 1>&2
|
1996-05-03 15:37:52 +08:00
|
|
|
|
|
|
|
mkdir "$pathcomp" || lasterr=$?
|
|
|
|
|
|
|
|
if test ! -d "$pathcomp"; then
|
|
|
|
errstatus=$lasterr
|
|
|
|
fi
|
1995-02-18 09:27:10 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
pathcomp="$pathcomp/"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $errstatus
|
|
|
|
|
|
|
|
# mkinstalldirs ends here
|