summaryrefslogtreecommitdiff
path: root/mkinstalldirs
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-08 20:18:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-08 20:18:15 +0000
commitbd254de90c7257eb05100eb4f9852c7df63a6239 (patch)
tree6f4af8f0270ab2c36279787b8d928048131ea118 /mkinstalldirs
parent13becb5e7cc300315018d1a5785e3ef2a78482bb (diff)
downloadc-ares-bd254de90c7257eb05100eb4f9852c7df63a6239.tar.gz
c-ares-bd254de90c7257eb05100eb4f9852c7df63a6239.tar.bz2
c-ares-bd254de90c7257eb05100eb4f9852c7df63a6239.zip
added for completeness
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 0000000..d0fd194
--- /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$
+
+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