"Fossies" - the Fresh Open Source Software Archive

Member "apr-1.7.0/build/mkdir.sh" (13 Mar 2019, 1202 Bytes) of package /linux/www/apr-1.7.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "mkdir.sh": 1.6.5_vs_1.7.0.

    1 #!/bin/sh
    2 ## 
    3 ##  mkdir.sh -- make directory hierarchy
    4 ##
    5 ##  Based on `mkinstalldirs' from Noah Friedman <friedman@prep.ai.mit.edu>
    6 ##  as of 1994-03-25, which was placed in the Public Domain.
    7 ##  Cleaned up for Apache's Autoconf-style Interface (APACI)
    8 ##  by Ralf S. Engelschall <rse@apache.org>
    9 ##
   10 #
   11 # This script falls under the Apache License.
   12 # See http://www.apache.org/docs/LICENSE
   13 
   14 
   15 umask 022
   16 errstatus=0
   17 for file in ${1+"$@"} ; do 
   18     set fnord `echo ":$file" |\
   19                sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'`
   20     shift
   21     pathcomp=
   22     for d in ${1+"$@"}; do
   23         pathcomp="$pathcomp$d"
   24         case "$pathcomp" in
   25             -* ) pathcomp=./$pathcomp ;;
   26             ?: ) pathcomp="$pathcomp/" 
   27                  continue ;;
   28         esac
   29         if test ! -d "$pathcomp"; then
   30             thiserrstatus=0
   31             mkdir "$pathcomp" || thiserrstatus=$?
   32             # ignore errors due to races if a parallel mkdir.sh already
   33             # created the dir
   34             if test $thiserrstatus != 0 && test ! -d "$pathcomp" ; then
   35                 errstatus=$thiserrstatus
   36             fi
   37         fi
   38         pathcomp="$pathcomp/"
   39     done
   40 done
   41 exit $errstatus
   42