mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 07:54:06 +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:
parent
b5520264c6
commit
36048db468
@ -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
19
boom/count.pl
Executable 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";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user