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
6
7# $Id: mkinstalldirs,v 1.1.1.1 2001/06/24 17:43:16 torcs Exp $
8
9errstatus=0
10
11umask 000
12
13for file
14do
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
38done
39
40exit $errstatus
41
42# mkinstalldirs ends here
43