summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:52:43 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:52:43 +0000
commitc9a5de787892b261ea6435cdaf7d26955f3a81a7 (patch)
treedfd7063ba4aaa3b307b6ca1d1d42d5f69708e8f5
parent3ad655fecd067aa71ce080175cebc90cfc76421a (diff)
downloadurpmi-c9a5de787892b261ea6435cdaf7d26955f3a81a7.tar
urpmi-c9a5de787892b261ea6435cdaf7d26955f3a81a7.tar.gz
urpmi-c9a5de787892b261ea6435cdaf7d26955f3a81a7.tar.bz2
urpmi-c9a5de787892b261ea6435cdaf7d26955f3a81a7.tar.xz
urpmi-c9a5de787892b261ea6435cdaf7d26955f3a81a7.zip
(_libdb_version,_rpm_version,should_we_migrate_back_rpmdb_db_version)
adapt to perl-5.16.0: it looks like 'eval "v..."' no longuer create version objects
-rw-r--r--NEWS1
-rw-r--r--urpm/select.pm6
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 272bae00..e8845cc4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- adapt to perl-5.16.0
- enhance man pages caption (inspirated by mdv)
- fix testsuite regressions
- o make 'basename' option work again for rpmdrake
diff --git a/urpm/select.pm b/urpm/select.pm
index 47b8164d..9c5a95ce 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -665,8 +665,8 @@ sub translate_why_removed_one {
$fullname . ($s ? "\n ($s)" : '');
}
-sub _libdb_version { $_[0] =~ /libdb-(\S+)\.so/ ? eval "v$1" : () }
-sub _rpm_version() { `rpm --version` =~ /version ([0-9.]+)$/ ? eval "v$1" : () }
+sub _libdb_version { $_[0] =~ /libdb-(\S+)\.so/ ? version->new("v$1") : () }
+sub _rpm_version() { `rpm --version` =~ /version ([0-9.]+)$/ ? version->new("v$1") : () }
sub should_we_migrate_back_rpmdb_db_version {
my ($urpm, $state) = @_;
@@ -674,7 +674,7 @@ sub should_we_migrate_back_rpmdb_db_version {
my ($pkg) = urpm::select::selected_packages_providing($urpm, $state, 'rpm') or return;
urpm::select::was_pkg_name_installed($state->{rejected}, 'rpm') and return;
my ($rooted_librpm_version) = map { _libdb_version($_) } $pkg->requires; # perl_checker: $self = revision
- my $rooted_rpm_version = eval "v" . $pkg->version; # perl_checker: $self = revision
+ my $rooted_rpm_version = version->new("v" . $pkg->version); # perl_checker: $self = revision
my $urpmi_librpm_version = _libdb_version(scalar `ldd /bin/rpm`); # perl_checker: $self = revision