aboutsummaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
Diffstat (limited to 'mkinstalldirs')
-rw-r--r--mkinstalldirs26
1 files changed, 9 insertions, 17 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
index 259dbfcd..6fbe5e11 100644
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,7 +1,7 @@
1#! /bin/sh 1#! /bin/sh
2# mkinstalldirs --- make directory hierarchy 2# mkinstalldirs --- make directory hierarchy
3 3
4scriptversion=2005-06-29.22 4scriptversion=2004-02-15.20
5 5
6# Original author: Noah Friedman <friedman@prep.ai.mit.edu> 6# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
7# Created: 1993-05-16 7# Created: 1993-05-16
@@ -12,7 +12,7 @@ scriptversion=2005-06-29.22
12# <automake-patches@gnu.org>. 12# <automake-patches@gnu.org>.
13 13
14errstatus=0 14errstatus=0
15dirmode= 15dirmode=""
16 16
17usage="\ 17usage="\
18Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 18Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@@ -27,7 +27,7 @@ while test $# -gt 0 ; do
27 case $1 in 27 case $1 in
28 -h | --help | --h*) # -h for help 28 -h | --help | --h*) # -h for help
29 echo "$usage" 29 echo "$usage"
30 exit $? 30 exit 0
31 ;; 31 ;;
32 -m) # -m PERM arg 32 -m) # -m PERM arg
33 shift 33 shift
@@ -37,7 +37,7 @@ while test $# -gt 0 ; do
37 ;; 37 ;;
38 --version) 38 --version)
39 echo "$0 $scriptversion" 39 echo "$0 $scriptversion"
40 exit $? 40 exit 0
41 ;; 41 ;;
42 --) # stop option processing 42 --) # stop option processing
43 shift 43 shift
@@ -103,21 +103,13 @@ esac
103 103
104for file 104for file
105do 105do
106 case $file in 106 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
107 /*) pathcomp=/ ;;
108 *) pathcomp= ;;
109 esac
110 oIFS=$IFS
111 IFS=/
112 set fnord $file
113 shift 107 shift
114 IFS=$oIFS
115 108
109 pathcomp=
116 for d 110 for d
117 do 111 do
118 test "x$d" = x && continue 112 pathcomp="$pathcomp$d"
119
120 pathcomp=$pathcomp$d
121 case $pathcomp in 113 case $pathcomp in
122 -*) pathcomp=./$pathcomp ;; 114 -*) pathcomp=./$pathcomp ;;
123 esac 115 esac
@@ -132,7 +124,7 @@ do
132 else 124 else
133 if test ! -z "$dirmode"; then 125 if test ! -z "$dirmode"; then
134 echo "chmod $dirmode $pathcomp" 126 echo "chmod $dirmode $pathcomp"
135 lasterr= 127 lasterr=""
136 chmod "$dirmode" "$pathcomp" || lasterr=$? 128 chmod "$dirmode" "$pathcomp" || lasterr=$?
137 129
138 if test ! -z "$lasterr"; then 130 if test ! -z "$lasterr"; then
@@ -142,7 +134,7 @@ do
142 fi 134 fi
143 fi 135 fi
144 136
145 pathcomp=$pathcomp/ 137 pathcomp="$pathcomp/"
146 done 138 done
147done 139done
148 140