From 67734216abb3c0499344d3dcef8feb7082b7ef1b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Thu, 2 Dec 2010 09:37:44 +0200 Subject: [PATCH] Add bidirectional workarounds for LP: #599695 (pbuilder uses the host apt keyring). Complain if the target's keyring isn't installed. --- debian/changelog | 4 +++- pbuilder-dist | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index d7d7470..15b700b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low - Refactor to use subprocess.popen instead of os.system (LP: #398974) - Catch OSErrors when creating directories (LP: #671067) - Set HOME so pbuilder reads .pbuilderrc + - Add bidirectional workarounds for LP: #599695 (pbuilder uses the host + apt keyring). Complain if the target's keyring isn't installed. * Use dpkg-vendor in ubuntutools.misc.system_distribution(), cache result. [ Benjamin Drung ] @@ -32,7 +34,7 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low * submittodebian: Encourage sending multiple independent pieces of the Ubuntu patch in separate bug reports. - -- Stefano Rivera Thu, 02 Dec 2010 09:29:56 +0200 + -- Stefano Rivera Thu, 02 Dec 2010 09:36:48 +0200 ubuntu-dev-tools (0.106) experimental; urgency=low diff --git a/pbuilder-dist b/pbuilder-dist index eba60dc..37f4291 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -222,11 +222,6 @@ class pbuilder_dist: if self.target_distro in debian_distros: arguments += ['--mirror', 'http://ftp.debian.org/debian'] - # work around bug #599695 - arguments += [ - '--debootstrapopts', - '--keyring=/usr/share/keyrings/debian-archive-keyring.gpg', - ] components = 'main' if self.extra_components: components += ' contrib non-free' @@ -243,6 +238,28 @@ class pbuilder_dist: if self.extra_components: components += ' universe multiverse' + # Work around LP:#599695 + if (ubuntutools.misc.system_distribution() == 'Debian' + and self.target_distro not in debian_distros): + if not os.path.exists( + '/usr/share/keyrings/ubuntu-archive-keyring.gpg'): + print >> stderr, 'Error: ubuntu-keyring not installed' + exit(1) + arguments += [ + '--debootstrapopts', + '--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg', + ] + elif (ubuntutools.misc.system_distribution() == 'Ubuntu' + and self.target_distro in debian_distros): + if not os.path.exists( + '/usr/share/keyrings/debian-archive-keyring.gpg'): + print >> stderr, 'Error: debian-archive-keyring not installed' + exit(1) + arguments += [ + '--debootstrapopts', + '--keyring=/usr/share/keyrings/debian-archive-keyring.gpg', + ] + arguments += ['--components', components] if self.build_architecture != self.system_architecture: