diff --git a/boom/Makefile b/boom/Makefile index 55a96a1..f4f27e5 100644 --- a/boom/Makefile +++ b/boom/Makefile @@ -16,7 +16,7 @@ DB = $(EQU) $(INV) $(DSC) $(CHR) \ $(DIST:%=dist/%/db/*.dsc) -.PHONY: all show again spotless tar +.PHONY: all show again spotless tar count all: show @@ -41,3 +41,6 @@ spotless: tar: tar cfj boom-db.tar.bz2 $(DB) + +count: + perl ./count.pl $(CHR) diff --git a/boom/count.pl b/boom/count.pl new file mode 100755 index 0000000..ec36cce --- /dev/null +++ b/boom/count.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +$tot = 0; +while (<>) { + next unless /\bT=(.+?)\b/; + $tot++; + $c = $1; + $cat{$c}++; + /^\s*(\S+)\s/; + $man{$c}{$1}++; +} + +print "Total: $tot\n"; +for $c (sort keys %cat) { + print " $c: $cat{$c}\n"; + for $m (sort keys %{ $man{$c} }) { + print "\t$m: $man{$c}{$m}\n"; + } +}