HardenedBSD/contrib/cvs/mkinstalldirs

41 lines
724 B
Plaintext
Raw Normal View History

2001-08-10 11:43:22 +02:00
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
2001-08-10 11:43:22 +02:00
# $Id: mkinstalldirs,v 1.4 2001/04/12 13:02:39 dprice Exp $
errstatus=0
2001-08-10 11:43:22 +02:00
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
2001-08-10 11:43:22 +02:00
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
2001-08-10 11:43:22 +02:00
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here