freebsd-dev/contrib/ntp/mkinstalldirs

41 lines
722 B
Plaintext
Raw Normal View History

2000-01-28 14:55:50 +00:00
#! /bin/sh
1999-12-09 13:01:21 +00:00
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
2002-11-04 19:36:11 +00:00
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
2000-01-28 14:55:50 +00:00
1999-12-09 13:01:21 +00:00
errstatus=0
2000-01-28 14:55:50 +00:00
for file
do
1999-12-09 13:01:21 +00:00
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
2000-01-28 14:55:50 +00:00
for d
do
1999-12-09 13:01:21 +00:00
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
2000-01-28 14:55:50 +00:00
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
1999-12-09 13:01:21 +00:00
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here