1 #! /bin/sh 2 # ******************************************************************** 3 # * COPYRIGHT: 4 # * Copyright (c) 2002-2004, International Business Machines Corporation and 5 # * others. All Rights Reserved. 6 # ******************************************************************** 7 # mkinstalldirs --- make directory hierarchy 8 # Author: Noah Friedman <friedman (at] prep.ai.mit.edu> 9 # Created: 1993-05-16 10 # Public domain 11 12 errstatus=0 13 14 for file 15 do 16 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 17 shift 18 19 pathcomp= 20 for d 21 do 22 pathcomp="$pathcomp$d" 23 case "$pathcomp" in 24 -* ) pathcomp=./$pathcomp ;; 25 esac 26 27 if test ! -d "$pathcomp"; then 28 echo "mkdir $pathcomp" 29 30 mkdir "$pathcomp" || lasterr=$? 31 32 if test ! -d "$pathcomp"; then 33 errstatus=$lasterr 34 fi 35 fi 36 37 pathcomp="$pathcomp/" 38 done 39 done 40 41 exit $errstatus 42 43 # mkinstalldirs ends here 44