diff options
Diffstat (limited to 'mcon/U/Extract.U')
-rw-r--r-- | mcon/U/Extract.U | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/mcon/U/Extract.U b/mcon/U/Extract.U index d4a8f55..d01d324 100644 --- a/mcon/U/Extract.U +++ b/mcon/U/Extract.U @@ -1,12 +1,12 @@ -?RCS: $Id: Extract.U,v 3.0.1.2 1997/02/28 14:58:52 ram Exp $ +?RCS: $Id$ ?RCS: -?RCS: Copyright (c) 1991-1993, Raphael Manfredi +?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root -?RCS: of the source tree for dist 3.0. +?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Extract.U,v $ ?RCS: Revision 3.0.1.2 1997/02/28 14:58:52 ram @@ -25,46 +25,32 @@ ?X: When running Configure from a remote directory ($src is not '.'), ?X: then the files will be created in that directory, so beware! ?X: -?MAKE:Extract: src +?MAKE:Extract: Mkdirp src ?MAKE: -pick add $@ %< ?F:./extract -?T:CONFIG dir file name create mkdir_p +?T:CONFIG SRC dir file : script used to extract .SH files with variable substitutions -cat >extract <<'EOS' +cat >extract <<EOS CONFIG=true +SRC="$src" +EOS +cat >>extract <<'EOS' echo "Doing variable substitutions on .SH files..." -if test -f $src/MANIFEST; then - set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` +if test -f "$SRC/MANIFEST"; then + set x `awk '{print $1}' <$SRC/MANIFEST | grep '\.SH'` else echo "(Looking for .SH files under the source directory.)" - set x `(cd $src; find . -name "*.SH" -print)` + set x `(cd "$SRC"; find . -name "*.SH" -print)` fi shift case $# in -0) set x `(cd $src; echo *.SH)`; shift;; +0) set x `(cd "$SRC"; echo *.SH)`; shift;; esac -if test ! -f $src/$1; then +if test ! -f "$SRC/$1"; then shift fi -?X: script to emulate mkdir -p -mkdir_p=' -name=$1; -create=""; -while test $name; do - if test ! -d "$name"; then - create="$name $create"; - name=`echo $name | sed -e "s|^[^/]*$||"`; - name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; - else - name=""; - fi; -done; -for file in $create; do - mkdir $file; -done -' for file in $*; do - case "$src" in + case "$SRC" in ".") case "$file" in */*) @@ -99,20 +85,20 @@ for file in $*; do */*) dir=`expr X$file : 'X\(.*\)/'` file=`expr X$file : 'X.*/\(.*\)'` - (set x $dir; shift; eval $mkdir_p) - sh <$src/$dir/$file + ./mkdirp $dir + sh <"$SRC/$dir/$file" ;; *) - sh <$src/$file + sh <"$SRC/$file" ;; esac ;; esac done -if test -f $src/config_h.SH; then +if test -f "$SRC/config_h.SH"; then if test ! -f config.h; then - : oops, they left it out of MANIFEST, probably, so do it anyway. - . $src/config_h.SH +?X: oops, they left it out of MANIFEST, probably, so do it anyway. + sh <"$SRC/config_h.SH" fi fi EOS |