| # mkinstalldirs --- make directory hierarchy |
| # Author: Noah Friedman <friedman@prep.ai.mit.edu> |
| Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." |
| # process command line arguments |
| -h | --help | --h*) # -h for help |
| test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } |
| --) # stop option processing |
| if mkdir -p -- . 2>/dev/null; then |
| if mkdir -m "$dirmode" -p -- . 2>/dev/null; then |
| echo "mkdir -m $dirmode -p -- $*" |
| exec mkdir -m "$dirmode" -p -- "$@" |
| set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` |
| -*) pathcomp=./$pathcomp ;; |
| if test ! -d "$pathcomp"; then |
| mkdir "$pathcomp" || lasterr=$? |
| if test ! -d "$pathcomp"; then |
| if test ! -z "$dirmode"; then |
| echo "chmod $dirmode $pathcomp" |
| chmod "$dirmode" "$pathcomp" || lasterr=$? |
| if test ! -z "$lasterr"; then |
| # mkinstalldirs ends here |