make conflicts work again

This commit is contained in:
Stephan Kulow 2013-04-02 15:15:42 +02:00
parent 3721b2b00f
commit 9ad7ed6a3e
2 changed files with 22 additions and 14 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/perl -w
$| = 1;
use strict;
my %dirs;
@ -204,18 +205,14 @@ if (@implicit_conflicts) {
for my $ff (keys %files) {
my ($n, undef) = split('/', $ff, 2);
next unless $baddir{$n};
if (!$filesc{$ff}) {
my ($pkg, undef) = split('/', $files{$ff}, 2);
$baddir_pkgs{$baddir{$n}}->{"$pkg/0"} = 1;
} else {
for (@{$filesc{$ff} || []}) {
for (@{$filesc{$ff} || [ $files{$ff} ]}) {
my ($pkg, undef) = split('/', $_, 2);
$baddir_pkgs{$baddir{$n}}->{"$pkg/0"} = 1;
}
}
}
for my $f (sort keys %baddir_pkgs) {
for my $f (@implicit_conflicts) {
$filesc{$f} ||= [ $files{$f} ];
$baddir_pkgs{$f} ||= { "implicit_directory 0 0 noarch pkg/0" => 1 };
push @{$filesc{$f}}, sort keys %{$baddir_pkgs{$f}};
}
}
@ -228,13 +225,16 @@ for my $f (sort keys %filesc) {
my $allm;
my $allc = 1;
my $pkgn;
my $pl;
for my $pkg (@{$filesc{$f}}) {
my (undef, $m) = split('/', $pkg, 2);
die unless $pkg =~ /^([^ ]+) /;
my ($p, $m) = split('/', $pkg, 2);
die unless $p =~ /^([^ ]+) /;
$allm = $m unless defined $allm;
$allm = -1 if $allm != $m;
$pkgn = $1 unless defined $pkgn;
$allc = 0 if $pkgn ne $1;
$allc = 0 if $pl && $p eq $pl;
$pl = $p;
}
if ($allc) {
delete $filesc{$f};
@ -265,6 +265,7 @@ for my $pkg (sort keys %con) {
next unless $pkgneeded{$pkg};
for my $c (@{$con{$pkg}}) {
for my $p (@{$whatprovides{$c} || []}) {
next if $p eq $pkg;
$conflicts{"$pkg\n$p"} = 1;
$conflicts{"$p\n$pkg"} = 1;
}
@ -277,6 +278,7 @@ for my $pkg (sort keys %pkgneeded) {
my $n = $1;
for my $p (@{$whatprovides{$n} || []}) {
next unless $p =~ /^\Q$n\E .* i[56]86$/;
next if $p eq $pkg;
$conflicts{"$pkg\n$p"} = 1;
$conflicts{"$p\n$pkg"} = 1;
}

View File

@ -188,17 +188,23 @@ while ( <INSTALL> ) {
close(INSTALL);
#print "checking file conflicts\n";
open(INSTALL, "perl findfileconflicts $pfile 2>&1|") || die 'exec fileconflicts';
my $cmd = sprintf("perl %s/findfileconflicts $pfile", dirname($0));
open(INSTALL, "$cmd |") || die 'exec fileconflicts';
my $inc = 0;
while ( <INSTALL> ) {
chomp;
#print STDERR "$_\n";
if ($_ =~ m/found conflict of (\S+) .* with (\S+) /) {
if ($_ =~ m/found conflict of (.*)-[^-]*-[^-]* with (.*)-[^-]*-[^-]*:/) {
$inc = 0;
#print STDERR "F $1 $2\n";
if (defined $targets{$1} || defined $targets{$2}) {
print "FC $1 $2\n";
$inc = 1;
$ret = 1;
last;
}
}
if ($inc) {
print "$_\n";
}
}
close(INSTALL);