ncursesw-morphos/mkdirs.sh

52 lines
1.3 KiB
Bash
Raw Normal View History

1998-03-01 12:21:12 +08:00
#! /bin/sh
# $Id: mkdirs.sh,v 1.5 2007/03/25 22:29:46 tom Exp $
# -----------------------------------------------------------------------------
1997-05-15 12:00:00 +08:00
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Last modified: 1994-03-25
# Public domain
# -----------------------------------------------------------------------------
1997-05-15 12:00:00 +08:00
errstatus=0
2000-07-09 10:46:08 +08:00
umask 022
1997-05-15 12:00:00 +08:00
2000-07-09 10:46:08 +08:00
for file in ${1+"$@"} ; do
1997-05-15 12:00:00 +08:00
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
2000-07-09 10:46:08 +08:00
case "$pathcomp" in
2002-10-13 11:35:53 +08:00
[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
;; # DOSISH systems
* )
mkdir "$pathcomp"
errstatus=$?
if test $errstatus != 0
then
# may have failed if invoked in a parallel "make -j# install"
if test -d "$pathcomp"
then
errstatus=0
fi
fi
;;
2000-07-09 10:46:08 +08:00
esac
1997-05-15 12:00:00 +08:00
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here