From ba089c8659382c5f68f2eb489c75136583bb832b Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 2 Apr 2013 15:15:55 +0200 Subject: [PATCH] chech obsoletes too --- findfileconflicts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/findfileconflicts b/findfileconflicts index f13af152..1ca4269e 100755 --- a/findfileconflicts +++ b/findfileconflicts @@ -24,8 +24,10 @@ my $pkg = ''; my $fls = 0; my $prv = 0; my $con = 0; +my $obs = 0; my %con; +my %obs; my %whatprovides; die("Usage: findfileconflicts2 packages[.gz]\n") unless @ARGV == 1; @@ -118,17 +120,30 @@ while() { push @{$con{$pkg}}, $_; next; } + if ($obs) { + if ($_ eq '-Obs:') { + $obs= 0; + next; + } + s/ .*//; # no version stuff; + push @{$obs{$pkg}}, $_; + next; + } if (/^=Pkg: (.*)/) { $pkg = $1; my $n = $pkg; $n =~ s/ .*//; - push @{$con{$pkg}}, $n; + push @{$obs{$pkg}}, $n; next; } if ($_ eq '+Con:') { $con = 1 if $pkg; next; } + if ($_ eq '+Obs:') { + $obs = 1 if $pkg; + next; + } if ($_ eq '+Prv:') { $prv = 1 if $pkg; next; @@ -272,6 +287,18 @@ for my $pkg (sort keys %con) { } } +for my $pkg (sort keys %obs) { + next unless $pkgneeded{$pkg}; + for my $c (@{$obs{$pkg}}) { + for my $p (@{$whatprovides{$c} || []}) { + next if $p eq $pkg; + next unless $p =~ /^\Q$c\E /; + $conflicts{"$pkg\n$p"} = 1; + $conflicts{"$p\n$pkg"} = 1; + } + } +} + # let 32bit packages conflict with the i586 version for my $pkg (sort keys %pkgneeded) { next unless $pkg =~ /^([^ ]+)-32bit /;