Get a list of packages with no dependences in FreeBSD

This Perl script makes a list of packages in FreeBSD which have no dependences.

#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use utf8;
use FindBin '$Bin';
my @pkgs = `pkg info`;
for (@pkgs) {
    my $name = $_;
    $name =~ s/^(\S+)\s+.*$/$1/g;
    my $r = `pkg info -r $name`;
    if ($r =~ /:.*$/) {
        print "$r\n";
    }
}

(download)


Copyright © Ben Bullock 2009-2017. All rights reserved. For comments, questions, and corrections, please email Ben Bullock (benkasminbullock@gmail.com) or use the discussion group at Google Groups. / Privacy / Disclaimer