A Perl program to make pretty-print-*-depends-list output readable

Parv parv at pair.com
Sat Aug 5 22:46:56 UTC 2006


Below is a short program to make the single line output of
pretty-print-*-depends-list actually readable.  This prints the case
insensitively sorted & merged output of both run & build dependencies.
Feel free to modify.  Each dependency is listed on its own line.

  #!perl
  use strict; use warnings;

  my @list =
    qx
    { make pretty-print-run-depends-list;
      make pretty-print-build-depends-list
    };

  my $parse =
    qr{\b This \s+ port \s+ requires \s+ package .+? "([^"]+)" }x;

  my %seen;
  print join "\n"
        , sort { lc $a cmp lc $b }
            grep !$seen{ $_ }++
              , map { m/$parse/ ? split ' ' , $1 : () } @list ;
  __END__


  - Parv

-- 



More information about the freebsd-ports mailing list