#!/usr/bin/perl # # First, obtain the LBR search path for Eagle. @lbrdir = ("C:/Users/Vince/Documents/eagle/lbr", "C:/Program Files (x86)/EAGLE-6.6.0/lbr"); # # Read a directory full of libraries, looking for devicesets. sub lbrdir { opendir(DIR, "$lbrdir") || die "$lbrdir: $!"; while (($l = readdir(DIR))) { next unless $l =~ /[.]lbr$/; $lbr = "$lbrdir/$l"; warn "Opening $lbr\n" if defined $debug; open(INPUT, $lbr) || do { die "$lbr: $!"; next; }; # Skip libraries that aren't converted yet. $xml = ; if ($xml !~ /^<[?]xml /) { warn "$lbr: not converted\n"; next; } $lbr =~ m:([^/]*).lbr$:; $lname = $1; while () { # Should note packages too. y/A-Z/a-z/; next unless /^) { y/A-Z/a-z/; next unless /