Bug#758512: debian-cd: Wrong word splitting reg-exp for $ENV{ARCHES}
Package: debian-cd
Version: 3.1.13
Severity: normal
Dear Maintainer,
the environment variable ARCHES is set to "amd64", but
tools/generate_di_lists still complains about a missing i386 Packages
file:
> Missing package file for i386/local.
I think the regular expressions are wrong, since [^\s] is "any character
other then a white-space" while "(^|\s)" would match "beginning of
string or white space". Same for "[\s\$]" to match the end of the work.
--- tools/generate_di_list.orig 2014-07-30 09:23:32.464452565 +0200
+++ tools/generate_di_list 2014-07-30 09:23:40.576662354 +0200
@@ -12,8 +12,8 @@
my @ARCHES;
if ( $ENV{ARCHES} ) {
- push @ARCHES, 'i386' if $ENV{ARCHES} =~ /[^\s]i386[\s\$]/;
- push @ARCHES, 'amd64' if $ENV{ARCHES} =~ /[^\s]amd64[\s\$]/;
+ 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};
}
@ARCHES = qw{i386 amd64} unless @ARCHES;
-- System Information:
Debian Release: 7.6
APT prefers stable
APT policy: (900, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Reply to: