Package: devscripts
Version: 2.14.11
Severity: normal
Tags: patch

Hi,

steps to reproduce:

$ dpkg --add-architecture armhf
$ chdist --arch=amd64 create sid-amd64 http://ftp.de.debian.org/debian sid main
$ chdist --arch=amd64 apt-get sid-amd64 update
$ ls ~/.chdist/sid-amd64/var/lib/apt/lists/*armhf*
/home/josch/.chdist/sid-amd64/var/lib/apt/lists/ftp.de.debian.org_debian_dists_sid_main_binary-armhf_Packages

so even though I passed the --arch=amd64 argument, apt will download for
another architecture as well (armhf in this case which was enabled as a
foreign arch on the host chdist was running on).

This might be an apt bug because one might argue that apt should respect
the architecture given as Apt::Architectures and not ask dpkg for more.

But since the fix is simple, I'm attaching it.

Until this is applied, a workaround is to run chdist like this:

$ chdist --arch=amd64 create sid-amd64 "[arch=amd64]" 
http://ftp.de.debian.org/debian sid main

which happens to work because of how chdist treats its arguments for the
create subcommand (it just concatenates them with a space).

Thanks!

cheers, josch
>From 0fc9541b9ee8f82f4ba8d0c4250c2209f11db2dd Mon Sep 17 00:00:00 2001
From: josch <[email protected]>
Date: Tue, 6 Jan 2015 09:36:25 +0100
Subject: [PATCH] chdist: if --arch is given, make sure only that arch is
 downloaded

---
 scripts/chdist.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/chdist.pl b/scripts/chdist.pl
index 3f8001f..11e03e4 100755
--- a/scripts/chdist.pl
+++ b/scripts/chdist.pl
@@ -339,8 +339,12 @@ sub dist_create
     if ($version) {
 	# Use provided method, version and sections
 	my $sections_str = join(' ', @sections);
+    my $restr = "";
+    if ($arch) {
+        $restr = "[arch=$arch]";
+    }
 	print FH <<EOF;
-deb $method $version $sections_str
+deb $restr $method $version $sections_str
 deb-src $method $version $sections_str
 EOF
     }
-- 
2.0.1

_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to