summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <perl5@tux.freedom.nl>2020-08-21 15:53:11 +0200
committerH.Merijn Brand <perl5@tux.freedom.nl>2020-08-21 15:53:30 +0200
commite04d927f2ca4d75153dd8737e2022c37fe5fa2d0 (patch)
tree8f2c78c473106bc53affc4d7ecc129fcf13a4b09 /Configure
parent768677ca81f5435a52c71938fa0353d7e2d0e1cf (diff)
downloadperl-e04d927f2ca4d75153dd8737e2022c37fe5fa2d0.tar.gz
Make getverlist inside Configure strict/warnings safe and correctly sorted
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure38
1 files changed, 20 insertions, 18 deletions
diff --git a/Configure b/Configure
index 0ec8bb7b5f..23364b41e8 100755
--- a/Configure
+++ b/Configure
@@ -7555,37 +7555,39 @@ sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
: Determine list of previous versions to include in @INC
$cat > getverlist <<EOPL
-#!$perl5 -w
+#!$perl5
+use strict;
+use warnings;
use File::Basename;
-\$api_versionstring = "$api_versionstring";
-\$version = "$version";
-\$stem = "$sitelib_stem";
-\$archname = "$archname";
+my \$api_versionstring = "$api_versionstring";
+my \$version = "$version";
+my \$stem = "$sitelib_stem";
+my \$archname = "$archname";
EOPL
$cat >> getverlist <<'EOPL'
-# The list found is store twice for each entry: the original name, and
-# the binary broken down version as pack "sss", so sorting is easy and
-# unambiguous. This will work for all versions that have a maximum of
-# three digit groups, separate by '.'s or '_'s. Names are extended with
-# ".0.0" to ensure at least three elements for the pack.
-# -- H.Merijn Brand (m)'06 23-10-2006
-
-# Can't have leading @ because metaconfig interprets it as a command!
-;@inc_version_list=();
+# The list found is stored twice for each entry: the original name, and
+# the binary broken down version into pack "s>s>s>", so sorting is easy
+# and unambiguous. This will work for all versions that have a maximum
+# of three digit per group separate by '.'s or '_'s. Names are extended
+# with ".0.0" to ensure at least three elements for the pack.
+# -- H.Merijn Brand (m)'06 23-10-2006
+
+my @inc_version_list;
+my @candidates;
# XXX Redo to do opendir/readdir?
if (-d $stem) {
chdir($stem);
;@candidates = map {
- [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
+ [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
}
else {
;@candidates = ();
}
-($pversion, $aversion, $vsn5005) = map {
- pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
-foreach $d (@candidates) {
+my ($pversion, $aversion, $vsn5005) = map {
+ pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
+foreach my $d (@candidates) {
if ($d->[1] lt $pversion) {
if ($d->[1] ge $aversion) {
unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);