mkinstalldirs
changeset 0 74212992fb08
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mkinstalldirs	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,40 @@
     1.4 +#! /bin/sh
     1.5 +# mkinstalldirs --- make directory hierarchy
     1.6 +# Author: Noah Friedman <friedman@prep.ai.mit.edu>
     1.7 +# Created: 1993-05-16
     1.8 +# Public domain
     1.9 +
    1.10 +# $Id$
    1.11 +
    1.12 +errstatus=0
    1.13 +
    1.14 +for file
    1.15 +do
    1.16 +   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    1.17 +   shift
    1.18 +
    1.19 +   pathcomp=
    1.20 +   for d
    1.21 +   do
    1.22 +     pathcomp="$pathcomp$d"
    1.23 +     case "$pathcomp" in
    1.24 +       -* ) pathcomp=./$pathcomp ;;
    1.25 +     esac
    1.26 +
    1.27 +     if test ! -d "$pathcomp"; then
    1.28 +        echo "mkdir $pathcomp"
    1.29 +
    1.30 +        mkdir "$pathcomp" || lasterr=$?
    1.31 +
    1.32 +        if test ! -d "$pathcomp"; then
    1.33 +  	  errstatus=$lasterr
    1.34 +        fi
    1.35 +     fi
    1.36 +
    1.37 +     pathcomp="$pathcomp/"
    1.38 +   done
    1.39 +done
    1.40 +
    1.41 +exit $errstatus
    1.42 +
    1.43 +# mkinstalldirs ends here