From 371472d9fb6a936149b105a6563a0550d35bdf1a Mon Sep 17 00:00:00 2001 From: Manoj Srivastava Date: Mon, 1 Dec 2003 17:11:15 +0000 Subject: Initial import of upstream branch Initial import of upstream branch git-archimport-id: srivasta@debian.org--2003-primary/dist--upstream--3.70--base-0 --- mcon/U/Extract.U | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 mcon/U/Extract.U (limited to 'mcon/U/Extract.U') diff --git a/mcon/U/Extract.U b/mcon/U/Extract.U new file mode 100644 index 0000000..d4a8f55 --- /dev/null +++ b/mcon/U/Extract.U @@ -0,0 +1,119 @@ +?RCS: $Id: Extract.U,v 3.0.1.2 1997/02/28 14:58:52 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, 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: +?RCS: $Log: Extract.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 14:58:52 ram +?RCS: patch61: added support for src.U +?RCS: +?RCS: Revision 3.0.1.1 1994/10/29 15:51:46 ram +?RCS: patch36: added ?F: line for metalint file checking +?RCS: +?RCS: Revision 3.0 1993/08/18 12:04:52 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?X: +?X: This unit produces a shell script which can be doted in order to extract +?X: .SH files with variable substitutions. +?X: +?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: -pick add $@ %< +?F:./extract +?T:CONFIG dir file name create mkdir_p +: script used to extract .SH files with variable substitutions +cat >extract <<'EOS' +CONFIG=true +echo "Doing variable substitutions on .SH files..." +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)` +fi +shift +case $# in +0) set x `(cd $src; echo *.SH)`; shift;; +esac +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 "$file" in + */*) + dir=`expr X$file : 'X\(.*\)/'` + file=`expr X$file : 'X.*/\(.*\)'` + (cd $dir && . ./$file) + ;; + *) + . ./$file + ;; + esac + ;; + *) +?X: +?X: When running Configure remotely ($src is not '.'), we cannot source +?X: the files directly, since that would wrongly cause the extraction +?X: where the source lie instead of withing the current directory. Therefore, +?X: we need to 'sh