Root/scripts/missing-in-tree

Source at commit 5ed16708597ccf77aca40505ca75716a6518b49e created 7 years 10 months ago.
By Werner Almesberger, modules/: add measurementes to DIP-4/6-300mil; add to catalog and Makefile
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
14usage()
15{
16    echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
17    exit 1
18}
19
20
21scan_comp()
22{
23    for n in "$@"; do
24        sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2
25    done
26}
27
28
29scan_fped()
30{
31    for n in "$@"; do
32        fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2
33    done
34}
35
36
37trap "rm -f _tmp1 _tmp2" 0
38
39genkicat -D "$@" >_tmp1 || exit
40
41ext=.lib
42
43>_tmp2
44while [ "$1" ]; do
45    case "$1" in
46    -F) ext=.fpd;;
47    -L) shift
48        [ "`echo \"$1\"/*.$ext`" = "$1/*.$ext" ] ||
49            scan_lib "$1"/*.$ext;;
50    -l) shift
51        if [ $ext = .lib ]; then
52            scan_comp "$1"
53        else
54            scan_fped "$1"
55        fi;;
56    -*) usage;;
57    *) break;;
58    esac
59    shift
60done
61
62[ "$1" ] || usage
63[ -z "$2" ] || usage
64
65cat _tmp1 _tmp1 _tmp2 | sort | uniq -u
66
67exit 0
68

Archive Download this file

Branches:
master



interactive