mkdirhier now just calls mkdir -p
authorIan Lynagh <igloo@earth.li>
Sat, 7 Nov 2009 12:08:47 +0000 (12:08 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 7 Nov 2009 12:08:47 +0000 (12:08 +0000)
The old shell code apparently didn't work properly with /bin/sh=dash

utils/mkdirhier/mkdirhier.sh

index c6261f4..4c5d5f7 100644 (file)
@@ -1,45 +1,4 @@
 #!/bin/sh
 
-#
-# create a hierarchy of directories
-#
-# Based on Noah Friedman's mkinstalldirs..
-#
+mkdir -p ${1+"$@"}
 
-quiet=no
-errs=0
-
-if [ "$1" = "-q" ]
-then
-    shift
-    quiet=yes
-fi
-
-for f in $*; do
-    parts=`echo ":$f" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-    path="";
-    for p in $parts; do
-        path="$path$p"
-        case "$path" in
-          -* ) path=./$path ;;
-        esac
-
-        if test ! -d "$path"; then
-           if [ "$quiet" = "no" ]
-           then
-               echo "mkdir $path" 1>&2
-           fi
-
-           mkdir "$path" || lasterr=$?
-          
-          if test ! -d "$path"; then
-             errs=$lasterr
-           fi 
-        fi
-       path="$path/";
-    done;
-done
-
-exit $errs
-
-# end of story