X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fmkinstalldirs;h=ef7e16fdafe243ab5e368763bd4cda18c5872c1f;hb=721177c2425ccfd2e017abc5e51ba4157e2a8edf;hp=7f4333b3137dcca1b5e0dc29dc8cfb3ac0d2ad3d;hpb=82beda827f870714b416ed46566105eafd24725e;p=gnulib.git diff --git a/build-aux/mkinstalldirs b/build-aux/mkinstalldirs index 7f4333b31..ef7e16fda 100755 --- a/build-aux/mkinstalldirs +++ b/build-aux/mkinstalldirs @@ -1,7 +1,7 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -scriptversion=2005-05-14.22 +scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 @@ -11,8 +11,11 @@ scriptversion=2005-05-14.22 # bugs to or send patches to # . +nl=' +' +IFS=" "" $nl" errstatus=0 -dirmode="" +dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... @@ -103,13 +106,21 @@ esac for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file shift + IFS=$oIFS - pathcomp= for d do - pathcomp="$pathcomp$d" + test "x$d" = x && continue + + pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac @@ -124,7 +135,7 @@ do else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" - lasterr="" + lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then @@ -134,7 +145,7 @@ do fi fi - pathcomp="$pathcomp/" + pathcomp=$pathcomp/ done done