KiCad Libraries
Sign in or create your account | Project List | Help
KiCad Libraries Git Source Tree
Root/
Source at commit 38cb8de06d5581730bc545f65f5f9a4c2de00dfb created 8 years 9 months ago. By Werner Almesberger, components/: add Freescale Kinetis KL25 in 48 pin package | |
---|---|
1 | #!/bin/sh -e |
2 | # |
3 | # missing-in-tree - List items present in libraries but not in the tree |
4 | # |
5 | # Copyright 2012 by Werner Almesberger |
6 | # |
7 | # This program is free software; you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation; either version 2 of the License, or |
10 | # (at your option) any later version. |
11 | # |
12 | |
13 | |
14 | usage() |
15 | { |
16 | echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2 |
17 | exit 1 |
18 | } |
19 | |
20 | |
21 | scan_comp() |
22 | { |
23 | for n in "$@"; do |
24 | sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2 |
25 | done |
26 | } |
27 | |
28 | |
29 | scan_fped() |
30 | { |
31 | for n in "$@"; do |
32 | fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2 |
33 | done |
34 | } |
35 | |
36 | |
37 | trap "rm -f _tmp1 _tmp2" 0 |
38 | |
39 | genkicat -D "$@" >_tmp1 || exit |
40 | |
41 | ext=lib |
42 | |
43 | >_tmp2 |
44 | while [ "$1" ]; do |
45 | case "$1" in |
46 | -F) ext=fpd;; |
47 | -L) shift |
48 | if [ "`echo \"$1\"/*.$ext`" != "$1/*.$ext" ]; then |
49 | if [ $ext = lib ]; then |
50 | scan_comp "$1"/*.$ext |
51 | else |
52 | scan_fped "$1"/*.$ext |
53 | fi |
54 | fi;; |
55 | -l) shift |
56 | if [ $ext = lib ]; then |
57 | scan_comp "$1" |
58 | else |
59 | scan_fped "$1" |
60 | fi;; |
61 | -*) usage;; |
62 | *) break;; |
63 | esac |
64 | shift |
65 | done |
66 | |
67 | [ "$1" ] || usage |
68 | [ -z "$2" ] || usage |
69 | |
70 | cat _tmp1 _tmp1 _tmp2 | sort | uniq -u |
71 | |
72 | exit 0 |
73 |
Branches:
master