[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#860187: debian-cd: Fix which_deb handling of non-Linux arches



Source: debian-cd
Version: 3.1.20
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
X-Debbugs-Cc: debian-bsd@lists.debian.org

Hi!

When which_deb finds "*i386" or "*amd64" entries in the ARCHES list,
it will wrongly change them to "i386" to "amd64" respectively (which
is wrong in the case of kfreebsd-* or hurd-*).

My attached patch makes the same changes here that were already made to
identical code in generate_di_list, to fix #758512 (commits
771f754516b161f248c132ee9d698e33a6330de0 and
2ef5d3288cdc772cdcbb7b5d11192305dd05b063).

Thanks!
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
From 544806f93e860f01f6f1167af2b4462074479af7 Mon Sep 17 00:00:00 2001
From: Steven Chamberlain <stevenc@debian.org>
Date: Wed, 12 Apr 2017 17:19:28 +0100
Subject: [PATCH] Fix which_deb handling of non-Linux arches

When which_deb finds "*i386" or "*amd64" entries in the ARCHES list,
it will wrongly change them to "i386" to "amd64" respectively (which
is wrong in the case of kfreebsd-* or hurd-*).

Make the same changes here that were already made to identical code in
generate_di_list, to fix #758512 (commits
771f754516b161f248c132ee9d698e33a6330de0 and
2ef5d3288cdc772cdcbb7b5d11192305dd05b063).
---
 tools/which_deb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/which_deb b/tools/which_deb
index d5a5a94..e23c721 100755
--- a/tools/which_deb
+++ b/tools/which_deb
@@ -29,9 +29,9 @@ if (!defined ($output)) {
 # Give preference to i386 and amd64, if specified
 my @ARCHES;
 if ( $ENV{ARCHES} ) {
-    push @ARCHES, 'i386' if $ENV{ARCHES} =~ /i386/;
-    push @ARCHES, 'amd64' if $ENV{ARCHES} =~ /amd64/;
-    push @ARCHES, grep { !/source|i386|amd64/ } split /\s+/, $ENV{ARCHES};
+    push @ARCHES, 'i386' if $ENV{ARCHES} =~ /(^|\s)i386(\s|$)/;
+    push @ARCHES, 'amd64' if $ENV{ARCHES} =~ /(^|\s)amd64(\s|$)/;
+    push @ARCHES, grep { !/^(source|i386|amd64)$/ } split /\s+/, $ENV{ARCHES};
 }
 
 # We seem to be building a source-only CD. Check for whatever binary
-- 
1.8.4.rc3

Attachment: signature.asc
Description: Digital signature


Reply to: