Browse Source

extract_bugs_from_koha_release_notes: grab bug numbers from Koha release notes

This script extracts bug numbers referenced by Koha release notes and
outputs a two-column list of version numbers and bugs.

It should be run from within a clone of the Koha Git repository; usage is:

  extract_bugs_from_koha_release_notes > bug_index

TODO: this script doesn't currently recognize every way that
      bugs have gotten cited by release notes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
origin
Galen Charlton 6 years ago
parent
commit
18d6a396a9
  1. 57
      index-release-notes/extract_bugs_from_koha_release_notes

57
index-release-notes/extract_bugs_from_koha_release_notes

@ -0,0 +1,57 @@
#!/usr/bin/perl
# Copyright 2015 Equinox Software, Inc.
#
# Author: Galen Charlton <gmc@esilibrary.com>
#
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, see <http://www.gnu.org/licenses>.
# extract_bugs_from_koha_release_notes: grab bug numbers from Koha release notes
#
# This script extracts bug numbers referenced by Koha release notes and
# outputs a two-column list of version numbers and bugs.
#
# It should be run from within a clone of the Koha Git repository; usage is:
#
# extract_bugs_from_koha_release_notes > bug_index
#
# TODO: this script doesn't currently recognize every way that
# bugs have gotten cited by release notes.
use strict;
use warnings;
my @versions = split /\n/, `git tag | grep -P '^v3\\.\\d+\\.\\d+\$'`;
foreach my $version (@versions) {
my ($major, $minor) = $version =~ /v3\.(\d+)\.(\d+)/;
$major =~ s/^0+//;
$major = '0' if $major eq '';
$minor =~ s/^0+//;
$minor = '0' if $minor eq '';
my $notes = `git show $version:misc/release_notes/release_notes_3_${major}_${minor}.txt`;
if ($notes) {
my @bugs = extract_bugs($notes);
print "3.$major.$minor\t$_\n" foreach @bugs;
} else {
print STDERR "Could not locate release notes for $version\n";
}
}
sub extract_bugs {
my $notes = shift;
my @bugs =
map { /^\t(\d+)\t/; $1 }
grep { /^\t\d+\t/ }
split /\n/, $notes;
}
Loading…
Cancel
Save