Root/scripts/missing-in-tree

Source at commit 8cc36e65d43a04b781dc18f43b43d495e90a866e created 7 years 7 months ago.
By Adam Wang, diode, fairchild, filter, hole, ir.lib: changed reference, pin name, pin number size.
1#!/bin/sh -e
2#
3# missing-in-tree - List components 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
14usage()
15{
16    echo "usage: $0 [-L libdir ...] [-l lib ...] hierarchy" 1>&2
17    exit 1
18}
19
20
21scan_lib()
22{
23    for n in "$@"; do
24        sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2
25    done
26}
27
28
29trap "rm -f _tmp1 _tmp2" 0
30
31genex -D "$@" >_tmp1 || exit
32
33>_tmp2
34while [ "$1" ]; do
35    case "$1" in
36    -L) shift
37        [ "`echo \"$1\"/*.lib`" = "$1/*.lib" ] ||
38            scan_lib "$1"/*.lib;;
39    -l) shift
40        scan_lib "$1";;
41    -*) usage;;
42    *) break;;
43    esac
44    shift
45done
46
47[ "$1" ] || usage
48[ -z "$2" ] || usage
49
50cat _tmp1 _tmp1 _tmp2 | sort | uniq -u
51
52exit 0
53

Archive Download this file

Branches:
master



interactive