#!/usr/bin/env perl
my $sps = '#######################################################################';
my $spl = '############################################################################################';
my ($pkgswithnotes, $pkgswithnotesandnomaint, $pkgswithnomaint);
my ($pkgswithnotescnt, $pkgswithnotesandnomaintcnt, $pkgswithnomaintcnt) = (0, 0, 0);
my $pkglist = `pkg info`;
$pkglist =~ s/^(\S+?) .*$/$1/mg;
my @pkga = split /\n/, $pkglist;
my $pinstinfo = '';
foreach my $p (@pkga) {
my ($pkg) = $p =~ /^([^:]*)/;
my ($pkgm) = $pkg =~ /^(.*?)[^-]*$/;
chop $pkgm;
my $s = `pkg info -D $p`;
next if (index( $s, "\n") == (length($s)-1));
if (index( $s, "port currently does not have a maintainer") != -1) {
if ($s =~ /\#maintain-port\n$/) {
if ($s =~ /^$pkg:\nAlways:\n===> NOTICE:\n\nThe $pkgm port currently does not have a maintainer/ ) {
$pkgswithnotesandnomaint .= (length( $pkgswithnotesandnomaint)) ? " $pkgm" : $pkgm;
$pkgswithnomaint .= (length( $pkgswithnomaint)) ? " $pkgm" : $pkgm;
$pkgswithnomaint .= (length( $pkgswithnomaint)) ? " $pkgm" : $pkgm;
++$pkgswithnomaintcnt;
next;
} else {
++$pkgswithnotesandnomaintcnt;
++$pkgswithnomaintcnt;
} } }
$pinstinfo .= "\n$spl\n$sps\n$sps $pkgm\n$sps\n$spl\n$s\n"
}
($pinstinfo .= "\n$spl\n$sps\n$sps Packages Without Maintainer: $pkgswithnomaintcnt\n$sps\n$spl\n"
. "List: $pkgswithnomaint\n") if $pkgswithnomaintcnt;
($pinstinfo .= "\n$spl\n$sps\n$sps Packages With Notes, But Without Maintainer: $pkgswithnotesandnomaintcnt\n$sps\n$spl\n"
. "List: $pkgswithnotesandnomaint\n") if $pkgswithnotesandnomaintcnt;
print $pinstinfo;