libpng/mkinstalldirs

41 lines
722 B
Plaintext
Raw Normal View History

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