Files
heimdal/lib/roken/mkinstalldirs
Assar Westerlund 5515fde49a merge roken independence stuff
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8597 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-07-08 14:22:12 +00:00

41 lines
671 B
Bash
Executable File

#! /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"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here