1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-22 16:01:54 +02:00

Added more detailed part counting.

- boom/count.pl: count characterized parts, with type and manufacturer
  breakdown
- boom/Makefile (count): new target to run count.pl
This commit is contained in:
Werner Almesberger 2010-10-17 16:19:49 -03:00
parent b5520264c6
commit 36048db468
2 changed files with 23 additions and 1 deletions

View File

@ -16,7 +16,7 @@ DB = $(EQU) $(INV) $(DSC) $(CHR) \
$(DIST:%=dist/%/db/*.dsc) $(DIST:%=dist/%/db/*.dsc)
.PHONY: all show again spotless tar .PHONY: all show again spotless tar count
all: show all: show
@ -41,3 +41,6 @@ spotless:
tar: tar:
tar cfj boom-db.tar.bz2 $(DB) tar cfj boom-db.tar.bz2 $(DB)
count:
perl ./count.pl $(CHR)

19
boom/count.pl Executable file
View File

@ -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";
}
}