?RCS: $Id: Chk_MANI.U 1 2006-08-24 12:32:52Z rmanfredi $
?RCS:
?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 4.0.
?RCS:
?RCS: $Log: Chk_MANI.U,v $
?RCS: Revision 3.0.1.2  1997/02/28  14:57:25  ram
?RCS: patch61: added support for src.U
?RCS:
?RCS: Revision 3.0.1.1  1994/10/31  09:33:14  ram
?RCS: patch44: now lists Begin instead of Myinit in its dependencies
?RCS: patch44: leading comment now explains how this unit is included
?RCS:
?RCS: Revision 3.0  1993/08/18  12:04:45  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?X:
?X: This unit checks the package by making sure every file listed in MANIFEST
?X: is present. It is systematically "included" via the Finish unit (which
?X: is always present in every Configure script), although it may result in
?X: an empty inclusion when no MANIFEST is present.
?X:
?MAKE:Chk_MANI: Begin c n rsrc
?MAKE:	-pick wipe $@ %<
?T:filelist ans tmppwd
?X: This check happens at metaconfig-time, so it's ok to hard-code the path.
@if {test -f ../MANIFEST}
: Now test for existence of everything in MANIFEST
echo " "
if test -f "$rsrc/MANIFEST"; then
	echo "First let's make sure your kit is complete.  Checking..." >&4
?X:
?X: Files spelled uppercased and beginning with PACK are produced by the
?X: shell archive builder and may be removed by the user. Usually, they are
?X: not listed in the MANIFEST file, but you never know...
?X:
?X: "split -l" is the new way of running a split, but we also try the older way
?X:
	awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
		(split -l 50 2>/dev/null || split -50)
	rm -f missing
	tmppwd=`pwd`
	for filelist in x??; do
		(cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
			>/dev/null 2>>"$tmppwd/missing")
	done
	if test -s missing; then
		cat missing >&4
		cat >&4 <<'EOM'

THIS PACKAGE SEEMS TO BE INCOMPLETE.

You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es.  If you
do, don't blame me if something goes wrong.  I advise you to type 'n'o
and contact the author (<MAINTLOC>).

EOM
?X: Can't use $echo at this early stage
		echo $n "Continue? [n] $c" >&4
		read ans
		case "$ans" in
		y*)
			echo "Continuing..." >&4
			rm -f missing
			;;
		*)
?X:
?X: Use kill and not exit, so that the trap gets executed to clean up
?X:
			echo "ABORTING..." >&4
			kill $$
			;;
		esac
	else
		echo "Looks good..."
	fi
else
	echo "There is no MANIFEST file.  I hope your kit is complete !"
fi
rm -f missing x??

@end
