mkinstalldirs revision 38889
1119610Sache#! /bin/sh
2119610Sache# mkinstalldirs --- make directory hierarchy
3157184Sache# Author: Noah Friedman <friedman@prep.ai.mit.edu>
4119610Sache# Created: 1993-05-16
5119610Sache# Last modified: 1994-03-25
6119610Sache# Public domain
7119610Sache
8119610Sacheerrstatus=0
9119610Sache
10119610Sachefor file in ${1+"$@"} ; do 
11119610Sache   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
12119610Sache   shift
13119610Sache
14119610Sache   pathcomp=
15119610Sache   for d in ${1+"$@"} ; do
16119610Sache     pathcomp="$pathcomp$d"
17119610Sache     case "$pathcomp" in
18119610Sache       -* ) pathcomp=./$pathcomp ;;
19119610Sache     esac
20119610Sache
21119610Sache     if test ! -d "$pathcomp"; then
22119610Sache        echo "mkdir $pathcomp" 1>&2
23119610Sache        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
24119610Sache     fi
25119610Sache
26119610Sache     if test ! -d "$pathcomp"; then
27119610Sache	errstatus=$lasterr
28119610Sache     fi
29119610Sache
30119610Sache     pathcomp="$pathcomp/"
31119610Sache   done
32119610Sachedone
33119610Sache
34119610Sacheexit $errstatus
35119610Sache
36119610Sache# mkinstalldirs ends here
37119610Sache