Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: Mkdirp.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
cf39bd7e | 4 | ?RCS: |
d8875586 MBT |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: Extract.U,v $ | |
12 | ?RCS: Revision 3.0.1.2 1997/02/28 14:58:52 ram | |
13 | ?RCS: patch61: added support for src.U | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.1 1994/10/29 15:51:46 ram | |
16 | ?RCS: patch36: added ?F: line for metalint file checking | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0 1993/08/18 12:04:52 ram | |
19 | ?RCS: Baseline for dist 3.0 netwide release. | |
20 | ?RCS: | |
cf39bd7e | 21 | ?X: |
d8875586 MBT |
22 | ?X: This unit produces a shell script which can launched to create a |
23 | ?X: directory path like "mkdir -p" would do. | |
cf39bd7e | 24 | ?X: |
d8875586 MBT |
25 | ?MAKE:Mkdirp: eunicefix startsh |
26 | ?MAKE: -pick add $@ %< | |
27 | ?F:./mkdirp | |
28 | ?T:name create file | |
29 | : script used to emulate mkdir -p | |
30 | cat >mkdirp <<EOS | |
31 | $startsh | |
32 | EOS | |
33 | cat >>mkdirp <<'EOS' | |
34 | name=$1; | |
35 | create=""; | |
36 | while test $name; do | |
37 | if test ! -d "$name"; then | |
38 | create="$name $create" | |
39 | name=`echo $name | sed -e "s|^[^/]*$||"` | |
40 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"` | |
41 | else | |
42 | name="" | |
43 | fi | |
44 | done | |
45 | for file in $create; do | |
46 | mkdir $file | |
47 | done | |
48 | EOS | |
49 | chmod +x mkdirp | |
50 | $eunicefix mkdirp | |
51 |