Debian Codegraph @

autofoo/mkinstalldirs

raw
1 #! /bin/sh
2 # mkinstalldirs --- make directory hierarchy
3 # Author: Noah Friedman <[email protected]>
4 # Created: 1993-05-16
5 # Public domain
6
7 # $Id mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
8
9 # $Id: mkinstalldirs,v 1.1 2001/03/21 00:28:29 vanbaal Exp $
10
11 errstatus=0
12
13 for file
14 do
15 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
16 shift
17
18 pathcomp=
19 for d
20 do
21 pathcomp="$pathcomp$d"
22 case "$pathcomp" in
23 -* ) pathcomp=./$pathcomp ;;
24 esac
25
26 if test ! -d "$pathcomp"; then
27 echo "mkdir $pathcomp"
28
29 mkdir "$pathcomp" || lasterr=$?
30
31 if test ! -d "$pathcomp"; then
32 errstatus=$lasterr
33 fi
34 fi
35
36 pathcomp="$pathcomp/"
37 done
38 done
39
40 exit $errstatus
41
42 # mkinstalldirs ends here