Bug#676833: Same problem when building kdevplatform

2012-09-25 Thread Cyril Brulebois
Control: severity -1 important
Control: tag -1 patch

Hello folks.

Benjamin Eikel deb...@eikel.org (07/08/2012):
 When using dpkg-query, I get the same error message as Jan. Is there a
 workaround for this problem without installing pbuilder or
 deinstalling the i386 packages?

Better than a workaround, a prospective patch, which worked for me while
building kde-runtime on a mixed amd64(native)/i386(foreign) environment.

Not heavily tested though, especially not with an old dpkg.

Please note the following files probably want the same kind of changes:
  makefiles/1/variables.mk
  perllib/Debian/Debhelper/Buildsystem/kde.pm

(Even if kdelibs5-dev is probably less likely than libc* packages to be
installed multiple times.)

Mraw,
KiBi.
From 2d3f6698b0392bb6e098265e0877ace581783620 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois k...@debian.org
Date: Tue, 25 Sep 2012 14:42:03 +0200
Subject: [PATCH] Add multi-arch support to dh_sameversiondep (Closes:
 #676833).

---
 debian/changelog  |   10 ++
 dh_sameversiondep |   17 +++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 27fb5ce..bbb4763 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+pkg-kde-tools (0.15.3+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Add multi-arch support to dh_sameversiondep: if a multi-arch aware
+dpkg is detected, use architecture qualifiers for the dpkg-query -s
+call. Use DEB_HOST_ARCH is defined, falling back to calling
+dpkg-architecture -qDEB_HOST_ARCH if it isn't. (Closes: #676833)
+
+ -- Cyril Brulebois k...@debian.org  Tue, 25 Sep 2012 14:25:26 +0200
+
 pkg-kde-tools (0.15.3) unstable; urgency=low
 
   * Reupload without cruft.
diff --git a/dh_sameversiondep b/dh_sameversiondep
index 82b4324..4afa6c3 100755
--- a/dh_sameversiondep
+++ b/dh_sameversiondep
@@ -52,7 +52,9 @@ name and Idependency type (either Depends or Recommends etc.) are determined.
 =item *
 
 All dependencies of the requested Itype are collected for the Idependency
-package based on the Idpkg-query --status output.
+package based on the Idpkg-query --status output. If a multi-arch aware dpkg
+is detected, this query is architecture-qualified, using DEB_HOST_ARCH if
+defined, and querying dpkg-architecture for that variable if undefined.
 
 =item *
 
@@ -239,6 +241,17 @@ sub Shlibsvars::get_dep_package_names {
 return extract_package_names($val);
 }
 
+sub arch_qualify {
+my $ret = system('dpkg', '--assert-multi-arch');
+if ($ret == 0) {
+my $arch = $ENV{DEB_HOST_ARCH} || `dpkg-architecture -qDEB_HOST_ARCH`;
+chomp $arch;
+return map { $_:$arch } @_;
+} else {
+return @_;
+}
+}
+
 sub get_package_dpkg_status {
 my $binpkgs = shift;
 my $fields = shift;
@@ -253,7 +266,7 @@ sub get_package_dpkg_status {
 close STDERR;
 open STDERR, , /dev/null;
 $ENV{LC_ALL} = C;
-exec(dpkg-query, --status, --, @$binpkgs) or error(cannot exec dpkg-query);
+exec(dpkg-query, --status, --, arch_qualify(@$binpkgs)) or error(cannot exec dpkg-query);
 }
 my $curpkg;
 while (defined($_ = DPKG)) {
-- 
1.7.10.4



signature.asc
Description: Digital signature


Bug#676833: Same problem when building kdevplatform

2012-08-07 Thread Benjamin Eikel
Hello,

when building kdevplatform, I get the same error message:

dh_sameversiondep: package libc6 was not found in the dpkg status. Internal 
error

$ dpkg --print-architecture
amd64

$ dpkg --print-foreign-architectures
i386

When using dpkg-query, I get the same error message as Jan. Is there a 
workaround for this problem without installing pbuilder or deinstalling the 
i386 packages?

Kind regards
Benjamin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org