mkinstalldirs revision 69626
169626Sru#! /bin/sh
269626Sru# mkinstalldirs --- make directory hierarchy
369626Sru# Author: Noah Friedman <friedman@prep.ai.mit.edu>
469626Sru# Created: 1993-05-16
569626Sru# Public domain
669626Sru
769626Sru# $Id: mkinstalldirs,v 1.1.1.1 2000/02/06 09:34:43 wlemb Exp $
869626Sru
969626Sruerrstatus=0
1069626Sru
1169626Srufor file
1269626Srudo
1369626Sru   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
1469626Sru   shift
1569626Sru
1669626Sru   pathcomp=
1769626Sru   for d
1869626Sru   do
1969626Sru     pathcomp="$pathcomp$d"
2069626Sru     case "$pathcomp" in
2169626Sru       -* ) pathcomp=./$pathcomp ;;
2269626Sru     esac
2369626Sru
2469626Sru     if test ! -d "$pathcomp"; then
2569626Sru        echo "mkdir $pathcomp" 1>&2
2669626Sru
2769626Sru        mkdir "$pathcomp" || lasterr=$?
2869626Sru
2969626Sru        if test ! -d "$pathcomp"; then
3069626Sru  	  errstatus=$lasterr
3169626Sru        fi
3269626Sru     fi
3369626Sru
3469626Sru     pathcomp="$pathcomp/"
3569626Sru   done
3669626Srudone
3769626Sru
3869626Sruexit $errstatus
3969626Sru
4069626Sru# mkinstalldirs ends here
41