mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
Coerce PERL_VERSION with %vd to fix 5.8.
This commit is contained in:
@@ -171,6 +171,14 @@ sub get_perl_variable {
|
|||||||
my $item = $args{item};
|
my $item = $args{item};
|
||||||
return unless $item;
|
return unless $item;
|
||||||
|
|
||||||
|
# Can't just stringify $PERL_VERSION because on 5.8 it doesn't work.
|
||||||
|
# So %vd coerces the version into a string on 5.8+.
|
||||||
|
if ( $item->{item} eq 'Perl' ) {
|
||||||
|
my $version = sprintf '%vd', $PERL_VERSION;
|
||||||
|
PTDEBUG && _d('Perl version', $version);
|
||||||
|
return $version;
|
||||||
|
}
|
||||||
|
|
||||||
# If there's a var, then its an explicit Perl variable name to get,
|
# If there's a var, then its an explicit Perl variable name to get,
|
||||||
# else the item name is an implicity Perl module name to which we
|
# else the item name is an implicity Perl module name to which we
|
||||||
# append ::VERSION to get the module's version.
|
# append ::VERSION to get the module's version.
|
||||||
|
@@ -46,6 +46,16 @@ sub test_v {
|
|||||||
"$args{name} versions"
|
"$args{name} versions"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Perl 5.8 $^V/$PERL_VERSION is borked, make sure
|
||||||
|
# the module is coping with it.
|
||||||
|
if ( $items->{Perl} ) {
|
||||||
|
like(
|
||||||
|
$versions->{Perl},
|
||||||
|
q/\d+\.\d+.\d+/,
|
||||||
|
"Perl version looks like a version"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user