1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/mkinstalldirs Sun Jul 20 11:36:48 2008 +0000
1.5 +# mkinstalldirs --- make directory hierarchy
1.6 +# Author: Noah Friedman <friedman@prep.ai.mit.edu>
1.7 +# Created: 1993-05-16
1.14 +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
1.16 +# process command line arguments
1.17 +while test $# -gt 0 ; do
1.19 + -h | --help | --h*) # -h for help
1.20 + echo "$usage" 1>&2
1.25 + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
1.29 + --) # stop option processing
1.33 + -*) # unknown option
1.34 + echo "$usage" 1>&2
1.37 + *) # first non-opt arg
1.45 + if test -d "$file"; then
1.58 + if mkdir -p -- . 2>/dev/null; then
1.59 + echo "mkdir -p -- $*"
1.60 + exec mkdir -p -- "$@"
1.64 + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
1.65 + echo "mkdir -m $dirmode -p -- $*"
1.66 + exec mkdir -m "$dirmode" -p -- "$@"
1.73 + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
1.79 + pathcomp="$pathcomp$d"
1.81 + -*) pathcomp=./$pathcomp ;;
1.84 + if test ! -d "$pathcomp"; then
1.85 + echo "mkdir $pathcomp"
1.87 + mkdir "$pathcomp" || lasterr=$?
1.89 + if test ! -d "$pathcomp"; then
1.90 + errstatus=$lasterr
1.92 + if test ! -z "$dirmode"; then
1.93 + echo "chmod $dirmode $pathcomp"
1.95 + chmod "$dirmode" "$pathcomp" || lasterr=$?
1.97 + if test ! -z "$lasterr"; then
1.98 + errstatus=$lasterr
1.104 + pathcomp="$pathcomp/"
1.110 +# Local Variables:
1.111 +# mode: shell-script
1.112 +# sh-indentation: 2
1.114 +# mkinstalldirs ends here