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

Re: [PATCH] Trivial cleanup in generate_di_list



On Mon, Jan 26, 2009 at 04:43:43PM -0600, Jonathan Hall wrote:
> Here's a trivial cleanup I came across while playing in the tools/*  
> directory...  Seems to make the code every so slightly more readable, in  
> my opinion...
>
> Index: debian-cd/tools/generate_di_list
> ===================================================================
> --- debian-cd/tools/generate_di_list    (revision 7422)
> +++ debian-cd/tools/generate_di_list    (working copy)
> @@ -36,13 +36,8 @@
>        my @exclude = @common_excludes;
>        push @exclude, read_exclude("exclude-udebs-$arch")
>                if -e exclude_path("exclude-udebs-$arch");
> -UDEB:  foreach my $udeb (map { chomp; $_ } `zcat $packagefile | awk  
> '/^Package:/ {print \$2}'`) {
> -               foreach my $pattern (@exclude) {
> -                       if ($udeb =~ /^$pattern$/) {
> -                               next UDEB;
> -                       }
> -               }
> -               print OUT "$udeb\n";
> +       foreach my $udeb (map { chomp; $_ } `zcat $packagefile | awk  
> '/^Package:/ {print \$2}'`) {
> +               print OUT "$udeb\n" unless grep { $udeb =~ /^$_$/ }  
> @exclude;
>        }
>        print OUT "#endif /* ARCH_$cpparch */\n";
> }

OK... That's cleaner, but does it do the same thing? I don't see any
handling of the exclude files.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
Welcome my son, welcome to the machine.


Reply to: