summaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorkcook <kcook@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-14 01:08:13 +0000
committerkcook <kcook@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-14 01:08:13 +0000
commita03a59f46f8c30169f8530d687dde47d5244259c (patch)
treeec8b23d6b9251ec2410138db8a4a389622a90143 /mkinstalldirs
parentd53d42de646acbff4ba9900f1b53c4e2f310ca84 (diff)
downloadgcc-a03a59f46f8c30169f8530d687dde47d5244259c.tar.gz
2005-07-14 Kelley Cook <kcook@gcc.gnu.org>
* COPYING, compile, config-ml.in, config.guess, config.sub, install-sh, missing, mkinstalldirs, symlink-tree, ylwrap: Sync from upstream sources. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102001 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-xmkinstalldirs26
1 files changed, 17 insertions, 9 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
index 6fbe5e11762..259dbfcd357 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2004-02-15.20
+scriptversion=2005-06-29.22
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
@@ -12,7 +12,7 @@ scriptversion=2004-02-15.20
# <automake-patches@gnu.org>.
errstatus=0
-dirmode=""
+dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@@ -27,7 +27,7 @@ while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
- exit 0
+ exit $?
;;
-m) # -m PERM arg
shift
@@ -37,7 +37,7 @@ while test $# -gt 0 ; do
;;
--version)
echo "$0 $scriptversion"
- exit 0
+ exit $?
;;
--) # stop option processing
shift
@@ -103,13 +103,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 +132,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 +142,7 @@ do
fi
fi
- pathcomp="$pathcomp/"
+ pathcomp=$pathcomp/
done
done