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

Bug#758512: debian-cd: Wrong word splitting reg-exp for $ENV{ARCHES}



Control: tag -1 +pending

Hi Philipp, and thanks for the report!

On Mon, Aug 18, 2014 at 01:05:28PM +0200, Philipp Hahn wrote:
>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;

Looks fair enough, yes. Committed to git now, will be in the next
upload due soon-ish.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"You can't barbecue lettuce!" -- Ellie Crane


Reply to: