1999-08-24 01:06:48 +00:00
|
|
|
#! /bin/sh
|
|
|
|
# mkinstalldirs --- make directory hierarchy
|
|
|
|
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
|
|
# Created: 1993-05-16
|
|
|
|
# Last modified: 1994-03-25
|
|
|
|
# Public domain
|
2000-07-03 09:24:12 +00:00
|
|
|
#
|
1999-08-24 01:06:48 +00:00
|
|
|
|
|
|
|
errstatus=0
|
2000-07-03 09:24:12 +00:00
|
|
|
umask 022
|
1999-08-24 01:06:48 +00:00
|
|
|
|
2000-07-03 09:24:12 +00:00
|
|
|
for file in ${1+"$@"} ; do
|
1999-08-24 01:06:48 +00:00
|
|
|
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
|
2000-07-03 09:24:12 +00:00
|
|
|
case "$pathcomp" in
|
2007-01-20 07:32:02 +00:00
|
|
|
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
|
|
|
|
;; # DOSISH systems
|
2000-07-03 09:24:12 +00:00
|
|
|
* ) mkdir "$pathcomp" || errstatus=$? ;;
|
|
|
|
esac
|
1999-08-24 01:06:48 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
pathcomp="$pathcomp/"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $errstatus
|
|
|
|
|
|
|
|
# mkinstalldirs ends here
|