annotate build-aux/update-bug-status.sh @ 28199:7ac8b3188b27

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Apr 2020 16:03:51 -0400
parents bd51beb6205e
children bbbe4dcc7200
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23572
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #! /bin/sh
24537
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
2 #
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 #
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
5 # Copyright (C) 2017-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26945
diff changeset
6 #
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 # See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 # distribution or <https://octave.org/copyright/>.
24537
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
9 #
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
10 # This file is part of Octave.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
11 #
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
12 # Octave is free software: you can redistribute it and/or modify it
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
13 # under the terms of the GNU General Public License as published by
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
14 # the Free Software Foundation, either version 3 of the License, or
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
15 # (at your option) any later version.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
16 #
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
17 # Octave is distributed in the hope that it will be useful, but
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
20 # GNU General Public License for more details.
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
21 #
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
22 # You should have received a copy of the GNU General Public License
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
23 # along with Octave; see the file COPYING. If not, see
11729ca6eb81 Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents: 23572
diff changeset
24 # <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
25 #
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
26 ########################################################################
23572
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 bug_numbers=$(for file in "$@"; do
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 sed -n "s/.*<\([0-9][0-9][0-9][0-9]*\)>.*/\1/p" "$file"
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 done | sort -u)
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 fixed_bug_numbers=$(for num in $bug_numbers; do
26945
05db50358377 * update-bug-status.sh: Delete newline chars in wget output
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
33 status=$(wget -q -O - https://octave.org/testfailure/?$num | tr -d '\n' | sed -n 's/.*>Status:<\/span><\/span>&nbsp;<\/td> *<td valign="middle" width="35%">\([^<]*\)<.*/\1/p');
23572
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 if [ "$status" = "Fixed" ]; then echo "$num"; fi
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 done)
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 if [ -z "$fixed_bug_numbers" ]; then
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 echo "no change in bug status"
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 exit 0;
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 fi
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 fixed_bug_pattern=`echo $fixed_bug_numbers | sed 's/ /\\\\|/g; s/^/<\\\\(/; s/$/\\\\)>/'`
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 for file in "$@"; do
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 sed -i "s/$fixed_bug_pattern/<*\1>/" "$file"
0703d31e1ec0 new script for updating test status for fixed bugs
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 done