summaryrefslogtreecommitdiff
path: root/ports-mgmt/portlint/src/portlintgrep.pl
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2003-11-17 20:17:46 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2003-11-17 20:17:46 +0000
commit1f93b36619d5f56a56153328d54b294db333c3df (patch)
tree151231957004048c248f0a01415fd078b46d059a /ports-mgmt/portlint/src/portlintgrep.pl
parent- take maintainership (diff)
Update to 2.5.0.
* Add some linenumbers to the whole file search * Hack the direct command use code some more * Add a check for the deprecated USE_MESA * Allow PKGCATEGORY not in CATEGORIES [1] * Allow %B in pkg-plist, as it has a valid prefix [1] * Allow simple rm -f, it needs no redirection [1] * Add portlintgrep.pl, an example on how to use portlint to find certain portlint problems in the ports tree [2] Submitted by: dinoex [1] eik [2]
Notes
Notes: svn path=/head/; revision=94190
Diffstat (limited to '')
-rw-r--r--ports-mgmt/portlint/src/portlintgrep.pl53
1 files changed, 53 insertions, 0 deletions
diff --git a/ports-mgmt/portlint/src/portlintgrep.pl b/ports-mgmt/portlint/src/portlintgrep.pl
new file mode 100644
index 000000000000..1bf267e0988d
--- /dev/null
+++ b/ports-mgmt/portlint/src/portlintgrep.pl
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+#
+# Copyright (c) 2003 Oliver Eikemeier. All rights reserved.
+#
+# BSD licensed.
+#
+
+#
+# List all the ports with FATAL errors:
+#
+# portlintgrep ^FATAL:
+#
+
+require 5.005;
+use diagnostics;
+use strict;
+use Carp;
+
+my $make = $ENV{MAKE} ? $ENV{MAKE} : '/usr/bin/make';
+my $portlint = $ENV{PORTLINT} ? $ENV{PORTLINT} : '/usr/local/bin/portlint';
+my $portsdir = $ENV{PORTSDIR} ? $ENV{PORTSDIR} : '/usr/ports';
+my $portlint_args = $ENV{PORTLINT_ARGS} ? $ENV{PORTLINT_ARGS} : '';
+
+die "Usage: portlintgrep <regex>\n" if $#ARGV != 0;
+my $regex = qr/$ARGV[0]/;
+
+my %failedports;
+
+my @categories = split ' ', `cd $portsdir; $make -VSUBDIR`;
+foreach my $category (@categories) {
+ my @ports = split ' ', `cd "$portsdir/$category"; $make -VSUBDIR`;
+ foreach my $port (@ports) {
+ my @result =
+ `cd "$portsdir/$category/$port"; $portlint $portlint_args`;
+ map chomp, @result;
+ my @filteredresult = grep /$regex/o, @result;
+ if (@filteredresult) {
+ my $maintainer =
+ `cd "$portsdir/$category/$port"; $make -VMAINTAINER`;
+ chomp $maintainer;
+ push @{$failedports{$maintainer}}, "$category/$port";
+ print join("\n ",
+ "$category/$port <$maintainer>:",
+ @filteredresult),
+ "\n";
+ }
+ }
+}
+
+print "\nPorts sorted by maintainer:\n";
+foreach my $maintainer (sort { lc $a cmp lc $b } keys %failedports) {
+ print join("\n - ", $maintainer, @{$failedports{$maintainer}}), "\n";
+}