1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
freebsd/mkinstalldirs

41 lines
691 B
Plaintext
Raw Normal View History

2002-06-27 22:31:32 +00:00
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
2004-02-26 10:38:49 +00:00
# $Id: mkinstalldirs,v 1.2 2003/11/21 12:48:55 djm Exp $
2002-06-27 22:31:32 +00:00
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
2004-02-26 10:38:49 +00:00
echo "mkdir $pathcomp"
2002-06-27 22:31:32 +00:00
2004-02-26 10:38:49 +00:00
mkdir "$pathcomp" || lasterr=$?
2002-06-27 22:31:32 +00:00
2004-02-26 10:38:49 +00:00
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
2002-06-27 22:31:32 +00:00
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here