Bug#733111: update uscan Files-Excluded parsing to support escaped names

Russ Allbery rra at debian.org
Thu Dec 26 17:49:50 UTC 2013


Csillag Tamas <cstamas at digitus.itk.ppke.hu> writes:

> Russ: If you can update the regexp to cover these use case the better.
> (and thanks for the current one, my Perl knowledge is lacking when it
> comes to regexpes like this one :)

This change should do it:

> commit d60eb9eb60966d03d8e46e247eaa6f314b6e3555
> Author: CSILLAG Tamas <cstamas at cstamas.hu>
> Date:   Thu Dec 26 18:04:51 2013 +0100

>     support escaped spaces

> diff --git a/scripts/uscan.pl b/scripts/uscan.pl
> index 433f5e2..6cb9c19 100755
> --- a/scripts/uscan.pl
> +++ b/scripts/uscan.pl
> @@ -1543,7 +1543,13 @@ EOF
>  	    my $file_list;
>  	    spawn(exec => ['find', $main_source_dir], wait_child => 1, to_string => \$file_list);
>  	    my $nfiles_before = split /\n/, $file_list;
> -	    foreach (grep { $_ } split /\s+/, $data->{"files-excluded"}) {
> +	    my $filesexcluded = $data->{"files-excluded"};
> +	    $filesexcluded =~ s!\n! !g;
> +	    # see the thread for details http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635920#127
> +	    my @excluded = ($filesexcluded =~ /(?:\A|\G[ ]+)((?:\\.|[^\\ ])+)/g);

my @excluded = ($filesexcluded =~ /(?:\A|\G\s+)((?:\\.|[^\\\s])+)/g);

and then you can drop the replacement of newlines with spaces, and tabs
should also be handled correctly.

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>



More information about the devscripts-devel mailing list