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