mkinstalldirs
author Sam Lantinga <slouken@libsdl.org>
Sun, 17 Nov 2002 17:55:45 +0000
changeset 541 796f2fe699be
parent 0 74212992fb08
permissions -rwxr-xr-x
Support 1-bit alpha on surfaces passed to SDL_WM_SetIcon() (thanks Glenn!)
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