Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | case $CONFIG in |
2 | '') | |
3 | if test -f config.sh; then TOP=.; | |
4 | elif test -f ../config.sh; then TOP=..; | |
5 | elif test -f ../../config.sh; then TOP=../..; | |
6 | elif test -f ../../../config.sh; then TOP=../../..; | |
7 | elif test -f ../../../../config.sh; then TOP=../../../..; | |
8 | else | |
9 | echo "Can't find config.sh."; exit 1 | |
10 | fi | |
11 | . $TOP/config.sh | |
12 | ;; | |
13 | esac | |
14 | case "$0" in | |
15 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; | |
16 | esac | |
17 | echo "Extracting makedir (with variable substitutions)" | |
18 | $spitshell >makedir <<!GROK!THIS! | |
19 | $startsh | |
20 | # $Id: makedir.sh,v 3.0.1.1 1994/01/24 14:00:08 ram Exp ram $ | |
21 | # | |
22 | # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
23 | # | |
24 | # You may redistribute only under the terms of the Artistic Licence, | |
25 | # as specified in the README file that comes with the distribution. | |
26 | # You may reuse parts of this distribution only within the terms of | |
27 | # that same Artistic Licence; a copy of which may be found at the root | |
28 | # of the source tree for dist 4.0. | |
29 | # | |
30 | # Original Author: Larry Wall <lwall@netlabs.com> | |
31 | # | |
32 | # $Log: makedir.sh,v $ | |
33 | # Revision 3.0.1.1 1994/01/24 14:00:08 ram | |
34 | # patch16: changed top ln-style config.sh lookup into test-style one | |
35 | # | |
36 | # Revision 3.0 1993/08/18 12:04:38 ram | |
37 | # Baseline for dist 3.0 netwide release. | |
38 | # | |
39 | ||
40 | export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) | |
41 | ||
42 | case \$# in | |
43 | 0) | |
44 | $echo "makedir pathname filenameflag" | |
45 | exit 1 | |
46 | ;; | |
47 | esac | |
48 | ||
49 | : guarantee one slash before 1st component | |
50 | case \$1 in | |
51 | /*) ;; | |
52 | *) set ./\$1 \$2 ;; | |
53 | esac | |
54 | ||
55 | : strip last component if it is to be a filename | |
56 | case X\$2 in | |
57 | X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;; | |
58 | *) set \$1 ;; | |
59 | esac | |
60 | ||
61 | : return reasonable status if nothing to be created | |
62 | if $test -d "\$1" ; then | |
63 | exit 0 | |
64 | fi | |
65 | ||
66 | list='' | |
67 | while true ; do | |
68 | case \$1 in | |
69 | */*) | |
70 | list="\$1 \$list" | |
71 | set \`echo \$1 | $sed 's:\(.*\)/:\1 :'\` | |
72 | ;; | |
73 | *) | |
74 | break | |
75 | ;; | |
76 | esac | |
77 | done | |
78 | ||
79 | set \$list | |
80 | ||
81 | for dir do | |
82 | $mkdir \$dir >/dev/null 2>&1 | |
83 | done | |
84 | !GROK!THIS! | |
85 | $eunicefix makedir | |
86 | chmod +x makedir |