view mkinstalldirs @ 69501:c22f46390a8f

(locate-command, locate-make-command-line) (locate-fcodes-file, locate-update-command) (locate-prompt-for-command, locate, locate-with-filter) (locate-get-file-positions): Doc fixes. (locate-buffer-name, locate-header-face): Remove leading `*' in defcustom. (locate-filter-output): Use `keep-lines' instead of its alias `delete-non-matching-lines'. (locate-get-filename, locate-get-dirname): Add introductory comment. (locate-find-directory-other-window): Give appropriate error message if used outside main listing.
author Luc Teirlinck <teirllm@auburn.edu>
date Thu, 16 Mar 2006 01:43:59 +0000
parents 746c40973d25
children 730155197b96 eb7e8d483840
line wrap: on
line source

#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain

errstatus=0

for file
do
   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
   shift

   pathcomp=
   for d
   do
     pathcomp="$pathcomp$d"
     case "$pathcomp" in
       -* ) pathcomp=./$pathcomp ;;
     esac

     if test ! -d "$pathcomp"; then
        echo "mkdir $pathcomp" 1>&2

        (mkdir "$pathcomp" && chmod a+rx "$pathcomp") || lasterr=$?

        if test ! -d "$pathcomp"; then
  	  errstatus=$lasterr
        fi
     fi

     pathcomp="$pathcomp/"
   done
done

exit $errstatus

# mkinstalldirs ends here