Mercurial > vanilla
annotate Scripts/lint-options.sh @ 1020:d244c7aebf8a
text/jansson: rename from lib/jansson
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 29 Aug 2019 23:40:00 +0200 |
parents | ddab65a5b3f5 |
children | e46348eb3fbd |
rev | line source |
---|---|
1019
ddab65a5b3f5
vanilla: use /bin/busybox sh as default shell
David Demelier <markand@malikania.fr>
parents:
721
diff
changeset
|
1 #!/bin/busybox sh |
721
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # lint-options.sh -- check if packages use predefined options |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 # |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # Copyright (c) 2019 David Demelier <markand@malikania.fr> |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # Permission to use, copy, modify, and/or distribute this software for any |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # purpose with or without fee is hereby granted, provided that the above |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # copyright notice and this permission notice appear in all copies. |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 # |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 alias basename="busybox basename" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 alias dirname="busybox dirname" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 alias echo="busybox echo" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 alias grep="busybox grep" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 alias realpath="busybox realpath" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 TOP=$(realpath $(dirname $0)/../) |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 PROGNAME=$(basename $0) |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 check() |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 {( |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 name=$(basename $1).sh |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 cd $TOP/$1 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 if [ ! -f $name ]; then |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 echo "warning: skipping $pkg" 1>&2 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 return 1 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 fi |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 . ./$name |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 for o in $PKGOPTIONS; do |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 if ! grep -q $o $TOP/Docs/options.md; then |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 echo "$pkg: option $o is unknown or custom" |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 fi |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 done |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 )} |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 $TOP/Scripts/list.sh $1 | while read -r pkg; do |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 check $pkg |
034a2a62a9f8
vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 done |