michael@0: #! /bin/sh michael@0: # ******************************************************************** michael@0: # * COPYRIGHT: michael@0: # * Copyright (c) 2002-2004, International Business Machines Corporation and michael@0: # * others. All Rights Reserved. michael@0: # ******************************************************************** michael@0: # mkinstalldirs --- make directory hierarchy michael@0: # Author: Noah Friedman michael@0: # Created: 1993-05-16 michael@0: # Public domain michael@0: michael@0: errstatus=0 michael@0: michael@0: for file michael@0: do michael@0: set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` michael@0: shift michael@0: michael@0: pathcomp= michael@0: for d michael@0: do michael@0: pathcomp="$pathcomp$d" michael@0: case "$pathcomp" in michael@0: -* ) pathcomp=./$pathcomp ;; michael@0: esac michael@0: michael@0: if test ! -d "$pathcomp"; then michael@0: echo "mkdir $pathcomp" michael@0: michael@0: mkdir "$pathcomp" || lasterr=$? michael@0: michael@0: if test ! -d "$pathcomp"; then michael@0: errstatus=$lasterr michael@0: fi michael@0: fi michael@0: michael@0: pathcomp="$pathcomp/" michael@0: done michael@0: done michael@0: michael@0: exit $errstatus michael@0: michael@0: # mkinstalldirs ends here