diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 13:54:38 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 13:54:38 -0700 |
commit | b8e6c26b7b9608dffc84645f17fe4cf534af18dd (patch) | |
tree | 61d9fff2984aa043471a1c305cfc4c76d7a099fb /mkinstalldirs | |
download | c-ares-b8e6c26b7b9608dffc84645f17fe4cf534af18dd.tar.gz c-ares-b8e6c26b7b9608dffc84645f17fe4cf534af18dd.tar.bz2 c-ares-b8e6c26b7b9608dffc84645f17fe4cf534af18dd.zip |
Imported Upstream version 1.7.5upstream/1.7.5
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-x | mkinstalldirs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..3bc1836 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,39 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + + +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 |