Skip Menu |

This queue is for tickets about the CPANPLUS-Dist-RPM CPAN distribution.

Report information
The Basics
Id: 45866
Status: open
Priority: 0/
Queue: CPANPLUS-Dist-RPM

People
Owner: Nobody in particular
Requestors: POSSUM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.0.8
Fixed in: (no value)



Subject: Won't build RPM if an older version is installed.
There is no version checking on the rpm when building. It only checks to see if the rpm exists. I've attached a patch that will cause the CPANPLUS::Dist::RPM to build the rpm as long as the version on CPAN is greater than the version installed. The attached patch should properly handle the versioning in most cases, but I imagine there is probably a more robust version-checking algorithm out there though.
Subject: cpanplus-dist-rpm-fix-version.patch
--- lib/CPANPLUS/Dist/RPM.pm.old 2009-01-17 19:35:09.000000000 -0500 +++ lib/CPANPLUS/Dist/RPM.pm 2009-05-08 12:57:20.000000000 -0400 @@ -302,9 +302,12 @@ #my $pkg = ( sort glob "$RPMDIR/RPMS/*/$name-$vers-*.rpm" )[-1]; #return $pkg; - my $output = `rpm -q $rpmname`; + my $version = $self->parent->package_version; + + my $installed_ver = `rpm --qf '%{VERSION}' -q $rpmname`; + $installed_ver =~ /^\d+\.?\d*$/ or return 0; - return $output =~ /is not installed/ ? 0 : 1; + return ( $installed_ver >= $version ); } sub _prepare_status {