mkinstalldirs
author Sam Lantinga <slouken@libsdl.org>
Thu, 20 Jun 2002 17:06:38 +0000
changeset 71 e2eb6980be07
parent 0 76be7dab668c
permissions -rwxr-xr-x
Pete Shinners - Thu Jun 20 10:05:54 PDT 2002
* The JPEG loader can now load EXIF format JPEG images
slouken@0
     1
#! /bin/sh
slouken@0
     2
# mkinstalldirs --- make directory hierarchy
slouken@0
     3
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
slouken@0
     4
# Created: 1993-05-16
slouken@0
     5
# Public domain
slouken@0
     6
slouken@0
     7
# $Id$
slouken@0
     8
slouken@0
     9
errstatus=0
slouken@0
    10
slouken@0
    11
for file
slouken@0
    12
do
slouken@0
    13
   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
slouken@0
    14
   shift
slouken@0
    15
slouken@0
    16
   pathcomp=
slouken@0
    17
   for d
slouken@0
    18
   do
slouken@0
    19
     pathcomp="$pathcomp$d"
slouken@0
    20
     case "$pathcomp" in
slouken@0
    21
       -* ) pathcomp=./$pathcomp ;;
slouken@0
    22
     esac
slouken@0
    23
slouken@0
    24
     if test ! -d "$pathcomp"; then
slouken@0
    25
        echo "mkdir $pathcomp"
slouken@0
    26
slouken@0
    27
        mkdir "$pathcomp" || lasterr=$?
slouken@0
    28
slouken@0
    29
        if test ! -d "$pathcomp"; then
slouken@0
    30
  	  errstatus=$lasterr
slouken@0
    31
        fi
slouken@0
    32
     fi
slouken@0
    33
slouken@0
    34
     pathcomp="$pathcomp/"
slouken@0
    35
   done
slouken@0
    36
done
slouken@0
    37
slouken@0
    38
exit $errstatus
slouken@0
    39
slouken@0
    40
# mkinstalldirs ends here