Debian Codegraph @

rhino/testsrc/tests/remove-fixed-failures.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
3
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8 if [[ ! -e "$1" || ! -e "$2" ]]; then
9 catscip-shell system . . cat. <<EOF
10 Usage: remove-fixed-failures.sh possible-fixes.log failures.log
11
12 possible-fixes.log contains the possible fixes from the most recent
13 test run.
14
15 failures.log contains the current known failures.
16
17 remove-fixed-failures.sh removes each pattern in possible-fixes.log
18 from failures.log.
19
20 The original failures.log is saved as failures.log.orig for safe keeping.
21
22 EOF
23 exit 1
24 fi
25
26 fixes="$1"
27 failures="$2"
28
29 # save the original failures file in case of an error
30 cpscip-shell system . . cp. $failures $failures.orig
31
32 # create a temporary file to contain the current list
33 # of failures.
34 workfailures=`mktempscip-shell system . . mktemp. working-failures.XXXXX`
35 workfixes=`mktempscip-shell system . . mktemp. working-fixes.XXXXX`
36
37 trap "rm -f ${workfailures} ${workfailures}.temp ${workfixes}*;" EXIT
38
39 # create working copy of the failures file
40 cpscip-shell system . . cp. $failures $workfailures
41 cpscip-shell system . . cp. $fixes $workfixes
42
43 sedscip-shell system . . sed. -i.bak 's|:[^:]*\.log||' $workfixes;
44
45 grepscip-shell system . . grep. -Fv -f $workfixes ${workfailures} > ${workfailures}.temp
46
47 mvscip-shell system . . mv. $workfailures.temp $workfailures
48
49 mvscip-shell system . . mv. $workfailures $failures
50