-
Notifications
You must be signed in to change notification settings - Fork 50
/
cleanbin-all
executable file
·70 lines (57 loc) · 1.93 KB
/
cleanbin-all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
if [ ! -z "$PVS_DIR" ]; then
provethem="$PVS_DIR/provethem"
else
provethem=`which provethem`
if [ ! $provethem ]; then
printf "The script 'provethem' could not be located. Either define \$PVS_DIR to point to the PVS directory or add the PVS directory to the environment variable \$PATH.\n"
exit 1;
fi
fi
readVersion() {
if ! type "$provethem" > /dev/null 2>&1 || ! VERSION=$($provethem --version) ; then
printf "The script 'provethem' could not be located. Either define \$PVS_DIR to point to the PVS directory or add the PVS directory to the environment variable \$PATH.\n"
exit 1;
fi
}
usage() {
readVersion
echo "NAME
cleanbin-all $VERSION -- Clean .pvscontext and binary files from PVS libraries.
SYNOPSIS
cleanbin-all <options>
DESCRIPTION
This script wraps provethem to provide a specific kind of run. By default, it removes
.pvscontext and the binary files from the pvsbin folder in each library listed in the
nasalib.all file.
To supersede this particular configuration, the same options accepted by provethem can
be used on this script.
The list of libraries to be processed is read from the file 'all-libraries' if there is no
'nasalib.all' file in the current folder.
SEE ALSO
provethem -- for iterating proveit on a list of directories
"
}
for opt in "$@"
do
if [ $opt = "--help" -o $opt = "-help" -o $opt = "-h" ]; then
usage
exit 0
fi
done
all_theories_file="nasalib.all"
if [ ! -f $all_theories_file ]; then
all_theories_file="all-libraries";
if [ ! -f $all_theories_file ]; then
all_theories_file="all-theories";
if [ -f $all_theories_file ]; then
echo "Warning: all-theories is no longer supported as default input file name, please rename it to all-libraries."
else
echo "Error: input file not found.";
exit 1;
fi;
fi
fi
if [ "$provethem" ]; then
$provethem --action-name="Cleaning" --clean-only "$@" $all_theories_file
fi