This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Regenerate .package file, specifying .metaconf-exclusions.txt
[metaconfig.git] / dist / lib / makedir.SH
CommitLineData
d8875586
MBT
1case $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 ;;
13esac
14case "$0" in
15*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
16esac
17echo "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
40export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$)
41
42case \$# in
43 0)
44 $echo "makedir pathname filenameflag"
45 exit 1
46 ;;
47esac
48
49: guarantee one slash before 1st component
50case \$1 in
51 /*) ;;
52 *) set ./\$1 \$2 ;;
53esac
54
55: strip last component if it is to be a filename
56case X\$2 in
57 X1) set \`$echo \$1 | $sed 's:\(.*\)/[^/]*\$:\1:'\` ;;
58 *) set \$1 ;;
59esac
60
61: return reasonable status if nothing to be created
62if $test -d "\$1" ; then
63 exit 0
64fi
65
66list=''
67while 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
77done
78
79set \$list
80
81for dir do
82 $mkdir \$dir >/dev/null 2>&1
83done
84!GROK!THIS!
85$eunicefix makedir
86chmod +x makedir