glib/mkinstalldirs

41 lines
676 B
Plaintext
Raw Normal View History

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