Fix conflict between fedora-release and generic-release

http://hydra.nixos.org/build/19594340
This commit is contained in:
Eelco Dolstra 2015-02-12 17:41:58 +01:00
parent ff37dc6fb6
commit fa47d347a4
1 changed files with 15 additions and 9 deletions

View File

@ -90,19 +90,25 @@ for (my $i = 0; $i < scalar(@packagesFiles); $i++) {
} }
my %provides; my %provides;
foreach my $pkgName (keys %pkgs) { PKG: foreach my $pkgName (keys %pkgs) {
#print STDERR "looking at $pkgName\n"; #print STDERR "looking at $pkgName\n";
my $pkg = $pkgs{$pkgName}; my $pkg = $pkgs{$pkgName};
#print STDERR keys %{$pkg->{format}}, "\n"; # Skip packages that conflict with a required package.
my $conflicts = $pkg->{format}->{'rpm:conflicts'}->{'rpm:entry'} // [];
#print STDERR $pkg->{format}->{'rpm:provides'}, "\n"; foreach my $conflict (@{$conflicts}) {
next if $conflict->{flags} // "" eq "LT" || $conflict->{flags} // "" eq "LE";
#print STDERR " $pkgName conflicts with $conflict->{name}\n";
if (grep { $_ eq $conflict->{name} } @toplevelPkgs) {
print STDERR "skipping package $pkgName because it conflicts with a required package\n";
next PKG;
}
}
my $provides = $pkg->{format}->{'rpm:provides'}->{'rpm:entry'} or die; my $provides = $pkg->{format}->{'rpm:provides'}->{'rpm:entry'} or die;
foreach my $req (@{$provides}) { foreach my $req (@{$provides}) {
#print "$req->{name}\n"; #print STDERR " $pkgName provides $req->{name}\n";
#print STDERR " provides $req\n"; #die "multiple provides for $req->{name}" if defined $provides{$req->{name}};
#die "multiple provides for $req" if defined $provides{$req};
$provides{$req->{name}} = $pkgName; $provides{$req->{name}} = $pkgName;
} }
@ -133,13 +139,13 @@ sub closePackage {
my @deps = (); my @deps = ();
foreach my $req (@{$requires}) { foreach my $req (@{$requires}) {
next if $req->{name} =~ /^rpmlib\(/; next if $req->{name} =~ /^rpmlib\(/;
print STDERR " needs $req->{name}\n"; #print STDERR " needs $req->{name}\n";
my $provider = $provides{$req->{name}}; my $provider = $provides{$req->{name}};
if (!defined $provider) { if (!defined $provider) {
print STDERR " WARNING: no provider for $req->{name}\n"; print STDERR " WARNING: no provider for $req->{name}\n";
next; next;
} }
print STDERR " satisfied by $provider\n"; #print STDERR " satisfied by $provider\n";
push @deps, $provider; push @deps, $provider;
} }