summaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 14:56:55 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 15:03:41 +0200
commit9f27ae7aee7a12b3c99d0ce7dc4c7384e3189fa2 (patch)
treec22825cb48bbafbb34e67ef1900280e4d1d7aded /mkinstalldirs
parent29be14a4aa2f73bf89396e50e5f5322fa9264b00 (diff)
gc6.0 tarball importgc6_0
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-xmkinstalldirs36
1 files changed, 36 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..cc8783e
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,36 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1994-03-25
+# Public domain
+
+errstatus=0
+
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d in ${1+"$@"} ; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here