forked from nasa/pvslib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestoredep-all
executable file
·70 lines (59 loc) · 1.77 KB
/
restoredep-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
#!/usr/bin/env perl
use Getopt::Long;
$usageln = "Usage: restore-all [--help | <option> ]";
sub usage() {
print <<EOF;
restore -- restores regular strings on NASA Libraries
$usageln
<option> may be
--after=<dir>
restore <regexpr> in all libraries after <dir>, exclusive.
--before=<dir>
restore <regexpr> in all libraries before <dir>, exclusive.
--but=<dir1>,..,<dirn>
exclude libraries <dir1>,...,<dirn>
--do=<dir1>,..,<dirn>
restore <regexpr> in libraries <dir1>,...,<dirn>
--from=<dir>
restore <regexpr> in libraries from <dir>, inclusive.
--to=<dir>
restore <regexpr> in libraries upto <dir>, inclusive.
--pvs
restore in .pvs files (default)
--prf
restore in .prf files only unless --pvs is specified
--help
print this message.
EOF
exit;
}
GetOptions('after=s'=>\$after,
'before=s'=>\$before,
'but=s'=>\$but,
'do=s'=>\$do,
'from=s'=>\$from,
'to=s'=>\$to,
'help'=>\$help,
'prf'=>\$prf,
'pvs'=>\$pvs,
'test'=>\$test
) or exit 1;
usage if $help;
die "$usageln\n" if shift;
$options .= "--after=$after " if $after;
$options .= "--before=$before " if $before;
$options .= "--but=$but " if $but;
$options .= "--do=$do " if $do;
$options .= "--from=$from " if $from;
$options .= "--to=$to " if $to;
$options .= "--test " if $test;
$files = "*.pvs";
$files = "*.prf" if $prf;
$files .= " *.pvs" if $prf && $pvs;
$provethem = "../provethem";
if (! -x $provethem) {
$provethem = `which provethem`;
}
die "Directory where PVS is installed must be in the environment variable PATH for this command to work\n" if !$provethem;
$command = `../provethem $options--execute \"git checkout -- pvsbin/top.dep\" nasalib.all`;
print "$command\n";