*** empty log message ***
[emacs.git] / mkinstalldirs
blob9e4b309b3641837102eb4bd8c2ab937fed3382a5
1 #! /bin/sh
2 # mkinstalldirs --- make directory hierarchy
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
4 # Created: 1993-05-16
5 # Public domain
7 errstatus=0
9 for file
11 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
12 shift
14 pathcomp=
15 for d
17 pathcomp="$pathcomp$d"
18 case "$pathcomp" in
19 -* ) pathcomp=./$pathcomp ;;
20 esac
22 if test ! -d "$pathcomp"; then
23 echo "mkdir $pathcomp" 1>&2
25 (mkdir "$pathcomp" && chmod a+rx "$pathcomp") || lasterr=$?
27 if test ! -d "$pathcomp"; then
28 errstatus=$lasterr
32 pathcomp="$pathcomp/"
33 done
34 done
36 exit $errstatus
38 # mkinstalldirs ends here