etlegacy-libs/curl/mkinstalldirs

40 lines
683 B
Text
Raw Normal View History

2012-06-01 15:23:17 +00:00
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
2015-01-23 15:30:59 +00:00
# Created: 1993-05-16
# Public domain
2015-01-23 15:30:59 +00:00
errstatus=0
2015-01-23 15:30:59 +00:00
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
2012-06-01 15:23:17 +00:00
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
2012-06-01 15:23:17 +00:00
if test ! -d "$pathcomp"; then
echo "mkdir -m0755 $pathcomp" 1>&2
2012-06-01 15:23:17 +00:00
mkdir -m0755 "$pathcomp" || lasterr=$?
2012-06-01 15:23:17 +00:00
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
2012-06-01 15:23:17 +00:00
pathcomp="$pathcomp/"
done
2012-06-01 15:23:17 +00:00
done
exit $errstatus
# mkinstalldirs ends here