diff options
author | Rob Vermaas <rob.vermaas@gmail.com> | 2012-02-02 09:53:45 +0000 |
---|---|---|
committer | Rob Vermaas <rob.vermaas@gmail.com> | 2012-02-02 09:53:45 +0000 |
commit | 6a3feaa3dc3d0c2b091974dc89cfcbb3a06f99cc (patch) | |
tree | 919ec9e73ad630489c1e39fcd2f1b9617876bad1 /pkgs/build-support | |
parent | f53c231cc438964ec7226e98fd982150330be2dd (diff) |
rpmclosure, also take into account rel attribute when versions are the same
svn path=/nixpkgs/trunk/; revision=31964
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/vm/rpm/rpm-closure.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/build-support/vm/rpm/rpm-closure.pl b/pkgs/build-support/vm/rpm/rpm-closure.pl index 2ef59dcbdef31..3771ef6eea55e 100644 --- a/pkgs/build-support/vm/rpm/rpm-closure.pl +++ b/pkgs/build-support/vm/rpm/rpm-closure.pl @@ -76,8 +76,9 @@ for (my $i = 0; $i < scalar(@packagesFiles); $i++) { my $earlierPkg = $pkgs{$pkg->{name}}; print STDERR "WARNING: duplicate occurrence of package $pkg->{name}\n"; # <version epoch="0" ver="1.28.0" rel="2.el6"/> - if (rpmvercmp($pkg->{'version'}->{ver}, $earlierPkg->{'version'}->{ver}) >= 0) { - print STDERR "WARNING: replaced package $pkg->{name} with newer one\n"; + my $cmp = rpmvercmp($pkg->{'version'}->{ver}, $earlierPkg->{'version'}->{ver}); + if ($cmp > 0 || ($cmp == 0 && rpmvercmp($pkg->{'version'}->{rel}, $earlierPkg->{'version'}->{rel})>0)) { + print STDERR "WARNING: replaced package $pkg->{name} (".$earlierPkg->{'version'}->{ver}." ".$earlierPkg->{'version'}->{rel}.") with newer one (".$pkg->{'version'}->{ver}." ".$pkg->{'version'}->{rel}.")\n"; $pkg->{urlPrefix} = $urlPrefixes[$i]; $pkgs{$pkg->{name}} = $pkg; } @@ -175,3 +176,4 @@ foreach my $pkgName (@needed) { } print "]\n"; +exit 1 |