annotate Scripts/lint-options.sh @ 787:80314147216c

multimedia/libcdio: initial import, closes #1768
author David Demelier <markand@malikania.fr>
date Mon, 12 Aug 2019 09:19:05 +0200
parents 034a2a62a9f8
children ddab65a5b3f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
721
034a2a62a9f8 vanilla: consolidate options with lint-options.sh
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
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