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

Re: [PATCH] Trivial cleanup in generate_di_list



On Wednesday 28 January 2009, Steve McIntyre wrote:
> 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.

It's there, but line wrapping is broken in the patch. No idea if it does 
actually do the same. Much too fancy perl for my limited skills :-P

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: