Skip to content

Commit

Permalink
Merge pull request #4588 from learningequality/0.14.x
Browse files Browse the repository at this point in the history
0.14.2
  • Loading branch information
benjaoming committed Oct 8, 2015
2 parents 39413a3 + 1d47b8d commit 718cbb4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
15 changes: 15 additions & 0 deletions data/version.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
0.14.2:
release_date: "2015/10/02"
git_commit: "dceccca"
new_features:
all: []
students:
coaches: []
admins: []
bugs_fixed:
all:
Properly compare language pack versions (#4587).
students: []
coaches: []
admins: []

0.14.1:
release_date: "2015/10/02"
git_commit: "0818d65"
Expand Down
14 changes: 10 additions & 4 deletions kalite/updates/static/js/updates/update_languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ var installed_languages = [];
var downloading = false;

function version_comparison(v1, v2) {
// compare two version strings and return 1 if the first is higher than the second,
// -1 if the first is lower than the second, and 0 if they are equal
/*
compare two version strings and return 1 if the first is higher than the second,
-1 if the first is lower than the second, and 0 if they are equal.
:params v1, v2: Version strings expected format is either "N.N.N" or "N.N", where N is a positive integer.
If both strings have the same format, they're compared using a lexical order.
If one string is shorter than the other, then the other is truncated and then compared using lexical order.
*/
var v1parts = v1.split('.'), v2parts = v2.split('.');
var maxLen = Math.max(v1parts.length, v2parts.length);
var minLen = Math.min(v1parts.length, v2parts.length);
var part1, part2;
for(var i = 0; i < maxLen; i++) {
for(var i = 0; i < minLen; i++) {
part1 = parseInt(v1parts[i], 10) || 0;
part2 = parseInt(v2parts[i], 10) || 0;
if (part1 > part2) return 1;
Expand Down
2 changes: 1 addition & 1 deletion kalite/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Must also be of the form N.N.N for internal use, where N is a non-negative integer
MAJOR_VERSION = "0"
MINOR_VERSION = "14"
PATCH_VERSION = "1"
PATCH_VERSION = "2"
VERSION = "%s.%s.%s" % (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
SHORTVERSION = "%s.%s" % (MAJOR_VERSION, MINOR_VERSION)

Expand Down

0 comments on commit 718cbb4

Please sign in to comment.