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=../../../..;
9 echo "Can't find config.sh."; exit 1
15 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 echo "Extracting pat/patsnap (with variable substitutions)"
18 cat >patsnap <<!GROK!THIS!
20 eval "exec perl -S \$0 \$*"
21 if \$running_under_some_shell;
23 # $Id: patsnap.SH,v 3.0.1.2 1994/01/24 14:33:08 ram Exp $
25 # Copyright (c) 1991-1993, Raphael Manfredi
27 # You may redistribute only under the terms of the Artistic Licence,
28 # as specified in the README file that comes with the distribution.
29 # You may reuse parts of this distribution only within the terms of
30 # that same Artistic Licence; a copy of which may be found at the root
31 # of the source tree for dist 3.0.
33 # $Log: patsnap.SH,v $
34 # Revision 3.0.1.2 1994/01/24 14:33:08 ram
35 # patch16: now prefix error messages with program's name
36 # patch16: added ~/.dist_profile awareness
38 # Revision 3.0.1.1 1993/08/24 12:22:08 ram
42 \$version = '$VERSION';
43 \$patchlevel = '$PATCHLEVEL';
45 cat >>patsnap <<'!NO!SUBS!'
47 $progname = &profile; # Read ~/.dist_profile
49 &usage unless $#ARGV >= 0;
50 &usage unless &Getopts("aho:V");
52 $SNAPSHOT = 'SNAPSHOT'; # Default snapshot file name
55 print STDERR "$progname $version PL$patchlevel\n";
63 $RCSEXT = ',v' unless $RCSEXT;
64 $TOPDIR = ''; # We are at the top-level directory
65 $SNAPSHOT = $opt_o if $opt_o;
68 open(MANI,"MANIFEST.new") || die "$progname: can't read MANIFEST.new: $!\n";
73 next if m|^patchlevel.h|; # Special file
81 open(SNAPSHOT, ">$SNAPSHOT") || die "$progname: can't create $SNAPSHOT: $!\n";
83 foreach $file (@ARGV) {
84 $files = &rcsargs($file);
85 @files = split(' ',$files);
87 $rlog = `rlog -r$baserev -r$revbranch $files 2>&1`;
88 ($revs) = ($rlog =~ /selected revisions: (\d+)/);
90 print "$progname: $file has never been checked in--skipping\n";
94 print "$progname: last revision for $file is $baserev.\n";
95 print SNAPSHOT "$file\t$baserev\n";
98 ($lastrev) = ($rlog =~ /revision $revbranch\.(\d+)/);
99 print "$progname: last revision for $file is $revbranch.$lastrev.\n";
100 print SNAPSHOT "$file\t$revbranch.$lastrev\n";
108 Usage: $progname [-ahV] [-o snapshot] [filelist]
109 -a : all the files in MANIFEST.new
110 -h : print this message and exit
111 -o : specify snapshot file output (default $SNAPSHOT)
112 -V : print version number and exit
118 $grep -v '^;#' ../pl/package.pl >>patsnap
119 $grep -v '^;#' ../pl/rcsargs.pl >>patsnap
120 $grep -v '^;#' ../pl/comment.pl >>patsnap
121 $grep -v '^;#' ../pl/tilde.pl >>patsnap
122 $grep -v '^;#' ../pl/profile.pl >>patsnap