summaryrefslogtreecommitdiff
path: root/bom/equiv2bom.pl
blob: 85ff26f0d467efae91bf2cb33398390213549806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
#
# bom/equiv2bom.pl - Generate pseudo BOM entries from equivalences
#
# Written 2014 by Werner Almesberger
# Copyright 2014 by Werner Almesberger
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#


while (<>) {
	next if /^#/;
	next if /^\s*$/;
	die unless /^\s*(\S+)\s+(\S+)\s*$/;
	print "0 $1 $2\n";
}