aboutsummaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorDeposite Pirate2018-09-16 22:54:11 +0200
committerDeposite Pirate2018-09-16 22:54:11 +0200
commit1c7d481d0104add72933c560d957a422e8636d84 (patch)
tree2ef71132559dd018c453f4617d92ce69394e42f0 /mkinstalldirs
Initial commit.
Diffstat (limited to 'mkinstalldirs')
-rw-r--r--mkinstalldirs40
1 files changed, 40 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100644
index 0000000..31f90a0
--- /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.8 1997/06/25 17:03:22 meyering Exp $
+
+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