summaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1999-10-06 22:10:16 +0000
committerDave Love <fx@gnu.org>1999-10-06 22:10:16 +0000
commit2b6bac153f3c6111711e1308dde13db607d15028 (patch)
tree82ffb1e04342b3330585bf8bae575ca4b67a1cc0 /mkinstalldirs
parent7763df255fb77ef4fde84f5432c3e47c80c8d7dd (diff)
downloademacs-2b6bac153f3c6111711e1308dde13db607d15028.tar.gz
#
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-xmkinstalldirs40
1 files changed, 40 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 00000000000..319086a3a46
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.11 1998/05/19 07:05:25 drepper dead $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here