case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac echo "Extracting bin/packinit (with variable substitutions)" cat >packinit <>packinit <<'!NO!SUBS!' print < $mypackver) { die "This .package file was produced by a newer packinit than I am.\n". "Please find a packinit of version $packver or greater.\n"; } } elsif (-f '../.package' || -f '../../.package' || -f '../../../.package') { die "Run in top level directory only.\n"; } # Now set up to do reads with possible shell escape. sub myread { ($rp,$dflt) = @_; $rp .= " [$dflt]"; print "$rp "; $ans='!'; while ($ans =~ /^!/) { $ans = ; chop($ans); if ($ans eq '!') { system '/bin/sh'; print "\n$rp "; } elsif ($ans =~ s/^!//) { system '/bin/sh', '-c', $ans; print "\n$rp "; } } $ans = $dflt if $ans eq ''; $ans = '' if $ans eq 'none'; $ans; } $dflt = $package; ($dflt) = (`pwd | tr "[A-Z]" "[a-z]"` =~ m|.*/(.*)|) unless $package; print <; $rcs = shift(@rcs); if (! -f $rcs) { $rcs = shift(@rcs); if (! -f $1) { print "I don't see any RCS files there (yet)."; $dflt='1.1'; } } $revs=0; if ($dflt eq '') { $rlog = `rlog $rcs`; ($dflt) = ($rlog =~ /\nhead:\s*(\d+\.\d+)/); $rlog = `rlog -r$dflt.1- -r$dflt.2- -r$dflt.3- -r$dflt.4- $rcs`; ($revs) = ($rlog =~ /selected revisions:\s*([\d.]+)/); $dflt='1.1' if $dflt eq ''; } print < 1) { print <.package') || die "Can't create .package"; chop($date = `date`); print PACKAGE <>packinit $grep -v '^;#' ../pl/logname.pl >>packinit $grep -v '^;#' ../pl/fullname.pl >>packinit $grep -v '^;#' ../pl/tilde.pl >>packinit chmod 755 packinit $eunicefix packinit