This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Less Whoa there, based on a suggestion by Andy
authorAndy Dougherty <doughera@lafayette.edu>
Wed, 8 Nov 2006 07:51:44 +0000 (02:51 -0500)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Wed, 15 Nov 2006 21:21:37 +0000 (21:21 +0000)
Subject: Re: [PATCH] Toning down the "WHOA THERE" message
Message-ID: <Pine.LNX.4.62.0611080743100.21312@fractal.phys.lafayette.edu>

p4raw-id: //depot/metaconfig@29287

U/modified/Whoa.U [new file with mode: 0644]

diff --git a/U/modified/Whoa.U b/U/modified/Whoa.U
new file mode 100644 (file)
index 0000000..25c95c1
--- /dev/null
@@ -0,0 +1,62 @@
+?RCS: $Id: Whoa.U,v 3.0.1.2 1997/02/28 15:21:21 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: Whoa.U,v $
+?RCS: Revision 3.0.1.2  1997/02/28  15:21:21  ram
+?RCS: patch61: whoa script now starts with leading "startsh"
+?RCS:
+?RCS: Revision 3.0.1.1  1994/10/29  16:02:01  ram
+?RCS: patch36: added ?F: line for metalint file checking
+?RCS:
+?RCS: Revision 3.0  1993/08/18  12:05:19  ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: This unit produces a bit of shell code that must be dotted in in order
+?X: to warn the user in case a change into a variable is noticed.
+?X:
+?X: To use this unit, $was must hold the old value that has changed. Upon
+?X: exit, the two variables $td and $tu are set to the correct value for
+?X: respectively defining or undefining a variable. For instance, if $vas was
+?X: $undef, but now $var is $define, after calling . whoa, you should use
+?X: eval "$var=\$tu" to finally set $var to the correct value. See unit Inlibc.
+?X:
+?MAKE:Whoa: Myread startsh hint
+?MAKE: -pick add $@ %<
+?F:./whoa
+?T:var was td tu hintfile
+: set up the script used to warn in case of inconsistency
+cat <<EOS >whoa
+$startsh
+EOS
+cat <<'EOSC' >>whoa
+dflt=y
+case "$hint" in
+    recommended)
+       case "$hintfile" in
+       '')     echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
+               ;;
+       *)      echo "Hmm.  Based on the hints in hints/$hintfile.sh, " >&4
+               echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
+               ;;
+       esac
+       ;;
+    *) echo " "
+       echo "*** WHOA THERE!!! ***" >&4
+       echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
+       ;;
+esac
+rp="    Keep the $hint value?"
+. ./myread
+case "$ans" in
+y) td=$was; tu=$was;;
+esac
+EOSC
+