mkinstalldirs revision 98937
198937Sdes#! /bin/sh 298937Sdes# mkinstalldirs --- make directory hierarchy 398937Sdes# Author: Noah Friedman <friedman@prep.ai.mit.edu> 498937Sdes# Created: 1993-05-16 598937Sdes# Public domain 698937Sdes 798937Sdes# $Id: mkinstalldirs,v 1.1 2000/05/20 05:33:45 damien Exp $ 898937Sdes 998937Sdeserrstatus=0 1098937Sdes 1198937Sdesfor file 1298937Sdesdo 1398937Sdes set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 1498937Sdes shift 1598937Sdes 1698937Sdes pathcomp= 1798937Sdes for d 1898937Sdes do 1998937Sdes pathcomp="$pathcomp$d" 2098937Sdes case "$pathcomp" in 2198937Sdes -* ) pathcomp=./$pathcomp ;; 2298937Sdes esac 2398937Sdes 2498937Sdes if test ! -d "$pathcomp"; then 2598937Sdes echo "mkdir $pathcomp" 2698937Sdes 2798937Sdes mkdir "$pathcomp" || lasterr=$? 2898937Sdes 2998937Sdes if test ! -d "$pathcomp"; then 3098937Sdes errstatus=$lasterr 3198937Sdes fi 3298937Sdes fi 3398937Sdes 3498937Sdes pathcomp="$pathcomp/" 3598937Sdes done 3698937Sdesdone 3798937Sdes 3898937Sdesexit $errstatus 3998937Sdes 4098937Sdes# mkinstalldirs ends here 41