xref: /aosp_15_r20/external/e2fsprogs/config/mkinstalldirs (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker#! /bin/sh
2*6a54128fSAndroid Build Coastguard Worker# mkinstalldirs --- make directory hierarchy
3*6a54128fSAndroid Build Coastguard Worker# Author: Noah Friedman <[email protected]>
4*6a54128fSAndroid Build Coastguard Worker# Created: 1993-05-16
5*6a54128fSAndroid Build Coastguard Worker# Public domain
6*6a54128fSAndroid Build Coastguard Worker
7*6a54128fSAndroid Build Coastguard Worker# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
8*6a54128fSAndroid Build Coastguard Worker
9*6a54128fSAndroid Build Coastguard Workererrstatus=0
10*6a54128fSAndroid Build Coastguard Worker
11*6a54128fSAndroid Build Coastguard Workerfor file
12*6a54128fSAndroid Build Coastguard Workerdo
13*6a54128fSAndroid Build Coastguard Worker   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
14*6a54128fSAndroid Build Coastguard Worker   shift
15*6a54128fSAndroid Build Coastguard Worker
16*6a54128fSAndroid Build Coastguard Worker   pathcomp=
17*6a54128fSAndroid Build Coastguard Worker   for d
18*6a54128fSAndroid Build Coastguard Worker   do
19*6a54128fSAndroid Build Coastguard Worker     pathcomp="$pathcomp$d"
20*6a54128fSAndroid Build Coastguard Worker     case "$pathcomp" in
21*6a54128fSAndroid Build Coastguard Worker       -* ) pathcomp=./$pathcomp ;;
22*6a54128fSAndroid Build Coastguard Worker     esac
23*6a54128fSAndroid Build Coastguard Worker
24*6a54128fSAndroid Build Coastguard Worker     if test ! -d "$pathcomp"; then
25*6a54128fSAndroid Build Coastguard Worker        echo "mkdir $pathcomp"
26*6a54128fSAndroid Build Coastguard Worker
27*6a54128fSAndroid Build Coastguard Worker        mkdir "$pathcomp" || lasterr=$?
28*6a54128fSAndroid Build Coastguard Worker
29*6a54128fSAndroid Build Coastguard Worker        if test ! -d "$pathcomp"; then
30*6a54128fSAndroid Build Coastguard Worker  	  errstatus=$lasterr
31*6a54128fSAndroid Build Coastguard Worker        fi
32*6a54128fSAndroid Build Coastguard Worker     fi
33*6a54128fSAndroid Build Coastguard Worker
34*6a54128fSAndroid Build Coastguard Worker     pathcomp="$pathcomp/"
35*6a54128fSAndroid Build Coastguard Worker   done
36*6a54128fSAndroid Build Coastguard Workerdone
37*6a54128fSAndroid Build Coastguard Worker
38*6a54128fSAndroid Build Coastguard Workerexit $errstatus
39*6a54128fSAndroid Build Coastguard Worker
40*6a54128fSAndroid Build Coastguard Worker# mkinstalldirs ends here
41