summaryrefslogtreecommitdiffstats
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2006-12-05 16:52:12 +0000
committerTar Committer <tar@ocjtech.us>2006-12-05 16:52:12 +0000
commit1a7c45398738cdb4eaafdc9e0962272f19d54816 (patch)
tree6863882585a40ef9f65a9bab880a22fdb02c06ab /mkinstalldirs
parenta0be206eb419f63eeb436631cc91b3456dff006f (diff)
downloadrancid-1a7c45398738cdb4eaafdc9e0962272f19d54816.tar.gz
rancid-1a7c45398738cdb4eaafdc9e0962272f19d54816.tar.xz
rancid-1a7c45398738cdb4eaafdc9e0962272f19d54816.zip
Imported from rancid-2.3.2a6.tar.gz.rancid-2.3.2a6
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-xmkinstalldirs25
1 files changed, 18 insertions, 7 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
index 5d26a48..ef7e16f 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2005-02-02.21
+scriptversion=2006-05-11.19
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
@@ -11,8 +11,11 @@ scriptversion=2005-02-02.21
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
+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