summaryrefslogtreecommitdiffstats
path: root/build/mkdir.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:23:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:23:09 +0000
commit30d479c28c831a0d4f1fdb54a9e346b0fc176be1 (patch)
treeaa35d7414ce9f1326abf6f723f6dfa5b0aa08b1d /build/mkdir.sh
parentInitial commit. (diff)
downloadapr-30d479c28c831a0d4f1fdb54a9e346b0fc176be1.tar.xz
apr-30d479c28c831a0d4f1fdb54a9e346b0fc176be1.zip
Adding upstream version 1.7.2.upstream/1.7.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/mkdir.sh')
-rwxr-xr-xbuild/mkdir.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/build/mkdir.sh b/build/mkdir.sh
new file mode 100755
index 0000000..3b730ff
--- /dev/null
+++ b/build/mkdir.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+##
+## mkdir.sh -- make directory hierarchy
+##
+## Based on `mkinstalldirs' from Noah Friedman <friedman@prep.ai.mit.edu>
+## as of 1994-03-25, which was placed in the Public Domain.
+## Cleaned up for Apache's Autoconf-style Interface (APACI)
+## by Ralf S. Engelschall <rse@apache.org>
+##
+#
+# This script falls under the Apache License.
+# See http://www.apache.org/docs/LICENSE
+
+
+umask 022
+errstatus=0
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" |\
+ sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'`
+ shift
+ pathcomp=
+ for d in ${1+"$@"}; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ ?: ) pathcomp="$pathcomp/"
+ continue ;;
+ esac
+ if test ! -d "$pathcomp"; then
+ thiserrstatus=0
+ mkdir "$pathcomp" || thiserrstatus=$?
+ # ignore errors due to races if a parallel mkdir.sh already
+ # created the dir
+ if test $thiserrstatus != 0 && test ! -d "$pathcomp" ; then
+ errstatus=$thiserrstatus
+ fi
+ fi
+ pathcomp="$pathcomp/"
+ done
+done
+exit $errstatus
+