develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH Configure] perl -V broken

Thread Previous | Thread Next
From:
Andy Dougherty
Date:
July 11, 2001 10:29
Subject:
Re: [PATCH Configure] perl -V broken
Message ID:
Pine.SOL.4.10.10107111329060.2021-100000@maxwell.phys.lafayette.edu
On Tue, 10 Jul 2001, Robin Barker wrote:

> I wrote:
> > I found that with bleadperl (installed as perl5.7.1)
> > 
> > 	% perl5.7.1 -V
> > 	Summary of my perl5 (revision 5.0 version 7 subversion 17) configuration:
> > 
> > Whereas 
> > 	% ./myconfig
> > 	Summary of my perl5 (revision 5.0 version 7 subversion 1 patchlevel 11224) 
> >	configuration:
> 
> Attached is a more general version of yesterday's patch.

Thanks.  Here it is with the appropriate metaconfig pixie dust applied:

diff -r -u perl-p4/myconfig.SH perl-andy/myconfig.SH
--- perl-p4/myconfig.SH	Thu Jun  7 10:25:24 2001
+++ perl-andy/myconfig.SH	Wed Jul 11 11:59:07 2001
@@ -12,11 +12,6 @@
 	. $TOP/config.sh
 	;;
 esac
-if $test "$PERL_PATCHLEVEL" -gt 0 ; then
-    patchlevel=" patchlevel $PERL_PATCHLEVEL"
-else
-    patchlevel=""
-fi
 : This forces SH files to create target in same directory as SH file.
 : This is so that make depend always knows where to find SH derivatives.
 case "$0" in
@@ -32,7 +27,7 @@
 
 # Note that the text lines /^Summary of/ .. /^\s*$/ are copied into Config.pm.
 cat <<'!NO!SUBS!'
-Summary of my $package (revision $baserev version $PERL_VERSION subversion $PERL_SUBVERSION$patchlevel) configuration:
+Summary of my $package (revision $baserev $version_patchlevel_string) configuration:
   Platform:
     osname=$osname, osvers=$osvers, archname=$archname
     uname='$myuname'
diff -r -u metaconfig/U/perl/patchlevel.U perl-andy/U/perl/patchlevel.U
--- metaconfig/U/perl/patchlevel.U	Thu Jun  7 10:22:42 2001
+++ perl-andy/U/perl/patchlevel.U	Wed Jul 11 12:30:40 2001
@@ -16,7 +16,8 @@
 ?RCS: Revision 3.0  1993/08/18  12:09:31  ram
 ?RCS: Baseline for dist 3.0 netwide release.
 ?RCS:
-?MAKE:patchlevel revision version subversion perl_patchlevel \
+?MAKE:patchlevel revision version subversion \
+	perl_patchlevel version_patchlevel_string \
 	api_revision api_version api_subversion api_versionstring: \
 	package test rsrc echo awk osname
 ?MAKE:	-pick add $@ %<
@@ -99,7 +100,15 @@
 ?S:	the maintenance versus development dichotomy except
 ?S:	by also being increasing.
 ?S:.
-
+?S:version_patchlevel_string:
+?S:	This is a string combining version, subversion and
+?S:	perl_patchlevel (if perl_patchlevel is non-zero).  
+?S:	It is typically something like 
+?S:	'version 7 subversion 1'  or
+?S:	'version 7 subversion 1 patchlevel 11224'
+?S:	It is computed here to avoid duplication of code in myconfig.SH
+?S:	and lib/Config.pm. 
+?S:.
 ?LINT:extern LC_ALL
 ?LINT:change LC_ALL
 ?LINT:extern LANGUAGE
@@ -130,11 +139,15 @@
 		perl_patchlevel=`cat $rsrc/.patch`
 	fi
 fi
+: Define a handy string here to avoid duplication in myconfig.SH and configpm.
+version_patchlevel_string="version $patchlevel subversion $subversion"
 case "$perl_patchlevel" in
-0)  ;;
-'') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
-*)  $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
+0|'') ;;
+*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
 esac
+
+$echo "(You have $package $version_patchlevel_string.)"
+
 case "$osname" in
 dos|vms)
 	: XXX Should be a Configure test for double-dots in filenames.

-- 
    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About