mkinstalldirs revision 38889
138889Sjdp#! /bin/sh
238889Sjdp# mkinstalldirs --- make directory hierarchy
338889Sjdp# Author: Noah Friedman <friedman@prep.ai.mit.edu>
438889Sjdp# Created: 1993-05-16
538889Sjdp# Last modified: 1994-03-25
638889Sjdp# Public domain
738889Sjdp
838889Sjdperrstatus=0
938889Sjdp
1038889Sjdpfor file in ${1+"$@"} ; do 
1138889Sjdp   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
1238889Sjdp   shift
1338889Sjdp
1438889Sjdp   pathcomp=
1538889Sjdp   for d in ${1+"$@"} ; do
1638889Sjdp     pathcomp="$pathcomp$d"
1738889Sjdp     case "$pathcomp" in
1838889Sjdp       -* ) pathcomp=./$pathcomp ;;
1938889Sjdp     esac
2038889Sjdp
2138889Sjdp     if test ! -d "$pathcomp"; then
2238889Sjdp        echo "mkdir $pathcomp" 1>&2
2338889Sjdp        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
2438889Sjdp     fi
2538889Sjdp
2638889Sjdp     if test ! -d "$pathcomp"; then
2738889Sjdp	errstatus=$lasterr
2838889Sjdp     fi
2938889Sjdp
3038889Sjdp     pathcomp="$pathcomp/"
3138889Sjdp   done
3238889Sjdpdone
3338889Sjdp
3438889Sjdpexit $errstatus
3538889Sjdp
3638889Sjdp# mkinstalldirs ends here
37