Followup-For: Bug #688295
Control: tag -1 patch

Hi,

the attached patch should work around at least some of these missing
diverted foreign files, I'm now testing this with my piuparts instance.


Andreas
>From d138b73f9026624566b3229d0e0934b07450dbee Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <a...@debian.org>
Date: Thu, 12 Jan 2017 04:46:05 +0100
Subject: [PATCH] compare diversion owner against unqualified package name, too

Work around dpkg bug #825385: inconsistent arch qualification when
--admindir points to a foreign arch chroot.
dpkg may return arch-qualified package names in foreign chroots while
diversions are 'owned' by an unqualified package.
Compare the diversion owner against the package name and the (possibly)
unqualified package name to avoid false positives like
  debsums: missing file /chroot/usr/bin/foo.diverted (from foo:i386 package)
with
  $pack = foo:i386
  $path = usr/bin/foo
  $diversions{$path} = [ usr/bin/foo.diverted, foo ]

Closes: #688295
---
 debsums | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debsums b/debsums
index b32b3ba..beed62c 100755
--- a/debsums
+++ b/debsums
@@ -462,7 +462,8 @@ sub resolve_path {
         my ($pack, $path, $sum) = @_;
 
         $path = $diversion{$path}[0] if exists $diversion{$path}
-            and $diversion{$path}[1] ne $pack;
+            and $diversion{$path}[1] ne $pack
+            and $diversion{$path}[1] ne $pack =~ s/:.*//r;
 
         my $resolved = resolve_path($path,$pack);
         if ((!sysopen F, "$root/$resolved", O_RDONLY|O_NONBLOCK|$my_noatime) &&
-- 
2.11.0

Reply via email to