Date: | 2012-04-18 03:18:55 (11 years 11 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | f602b3a6908ed0fc1faa20d1a77e58eba805cbaf |
Message: | components/scripts/missing-in-tree: script to list components not in
hierarchy ... but in libraries. |
Files: |
scripts/missing-in-tree (1 diff) |
Change Details
scripts/missing-in-tree | ||
---|---|---|
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 | ||
14 | usage() | |
15 | { | |
16 | echo "usage: $0 [-L libdir ...] [-l lib ...] hierarchy" 1>&2 | |
17 | exit 1 | |
18 | } | |
19 | ||
20 | ||
21 | scan_lib() | |
22 | { | |
23 | for n in "$@"; do | |
24 | sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2 | |
25 | done | |
26 | } | |
27 | ||
28 | ||
29 | trap "rm -f _tmp1 _tmp2" 0 | |
30 | ||
31 | genex -D "$@" >_tmp1 || exit | |
32 | ||
33 | >_tmp2 | |
34 | while [ "$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 | |
45 | done | |
46 | ||
47 | [ "$1" ] || usage | |
48 | [ -z "$2" ] || usage | |
49 | ||
50 | cat _tmp1 _tmp1 _tmp2 | sort | uniq -u | |
51 | ||
52 | exit 0 |
Branches:
master