Skip to content

Commit

Permalink
Merge branch 'version-cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinson Tryon committed Dec 9, 2013
2 parents 6089cc0 + bc3669e commit 6827081
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 42 deletions.
58 changes: 48 additions & 10 deletions bsa.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/perl -s
# -*- mode: CPerl; tab-width: 2; indent-tabs-mode: nil; -*-
# This file is part of the LibreOffice BSA project.
#
# This program is free software: you can redistribute it and/or modify
Expand All @@ -19,28 +20,65 @@

my $bz = BzConnect();

# TODO: Get these variables from an outside service such as the updater,
# MirrorBrain (http://download.documentfoundation.org/libreoffice/stable/)
# or etc..
#
# Note: For our filtering purposes, we will ASSUME that the stable
# version listed is the oldest supported release series. For example:
# If 4.0.6 is 'stable', then oldest supported series is 4.0.
my $stable = "4.0.6";
my $versionRE = '^(\d+[.]\d+)([.]\d+)';
my $oldestSupportedVersion = ($stable =~ /$versionRE/)[0];

if ($proc eq "versions")
{
# Open the html template
my $template = HTML::Template->new(filename => 'versions.tmpl');
my @versions = BzSortVersions(BzFindVersions($bz));
my @BSAversions;

# Create a blacklist of versions that we don't want in the BSA.
open(FILE, "version-blacklist.txt") or die ("Unable to open version blacklist.");
%blacklist = map { chomp; $_ => 1 } ( <FILE> );
close(FILE);
# This hash keeps track of which supported versions have already
# been released.
my %releasedVersions = ();

push(@BSAversions, { name => $none, nr => -1 } );
my $count = 0;
foreach (@versions)
my $count = -1, $foundMaster = 0, $addMe = 0;
foreach $version (@versions)
{
unless ( $blacklist{$_} ) {
push(@BSAversions, { name => $_, nr => $count });
$addVersion = 0;

# Create version strings for later comparison.
$version =~ /$versionRE/;
my $majorMinor = $1;
my $majorMinorPoint = $1 . $2;

# Include the latest master branch.
if (!$foundMaster &&
($foundMaster = $version =~ /master$/i)) {
$addVersion = 1;
} elsif ($majorMinor >= $oldestSupportedVersion) {
# Include any releases that are from the oldest supported
# release branch or newer.
if(($version =~ /release$/) ||
# Include the latest alpha/beta/rc from any not-yet-released
# (but will-be-supported) release.
(($version =~ /(rc|alpha|beta)\d*$/) &&
!$releasedVersions{$majorMinorPoint})) {
$releasedVersions{$majorMinorPoint} = 1;
$addVersion = 1;
}
}

if($addVersion) {
push(@BSAversions, { name => $version, nr => $count });
} else {
$count++;
}
$count++;
}

# The term 'older versions' can be our catch-all.
push(@BSAversions, { name => "older versions", nr => -2 });

$template->param( loop => [ @BSAversions ], choose => $choose );
print $template->output;
}
Expand Down
18 changes: 1 addition & 17 deletions bug/bug.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,6 @@
var uv_element = $('.state_details .unsupported-versions');
uv_element.hide();

// Grab the list of unsupported versions and stuff the
// versions into an array.
var uv_array = new Array();

/* -- I can't seem to get the file to load properly, so I'll
-- just hard-code the values for now.
var jqxhr = $.get("unsupported-versions/file/here", function(data){
//uv_array = data.split("\n");
console.log("Something...here ");
//console.log(uv_array);
})
.done(function() { console.log("done here..."); })
.fail(function() { console.log("GET failed"); });
*/
uv_array = ["3.5 all versions", "3.4 all versions", "3.3 all versions"];

$('.active_subcomponent .select', element).select();
$('.active_subcomponent .select .choice', element).click(function() {
$.bug.sub_component = $('.state_details .active_subcomponent .chosen').attr('data');
Expand All @@ -220,7 +204,7 @@

// If this version is unsupported, display a warning
// message.
if($.inArray($.bug.lo_version, uv_array) >= 0) {
if ($.bug.lo_version_id == -2) {
uv_element.show();
} else {
uv_element.hide();
Expand Down
15 changes: 0 additions & 15 deletions unsupported-versions.txt

This file was deleted.

0 comments on commit 6827081

Please sign in to comment.