Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
travis/cleanup-bintray: use dpkg --compare-versions (#2453)
Browse files Browse the repository at this point in the history
…instead of lexicographically sorting strings, which fails for the
following situation:

    4.12-96-g086276b
    4.12-97-g59c070b
    4.12-108-gb850cfb

This bug resulted in new packages being built and uploaded, then
immediately deleted.

Thanks to eeemsi for reporting the issue.
  • Loading branch information
stapelberg committed Sep 24, 2016
1 parent b850cfb commit 14f49aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion travis/cleanup-bintray.pl
Expand Up @@ -25,7 +25,9 @@
my $resp = $client->get($apiurl);
die "Getting versions failed: HTTP status $resp->{status} (content: $resp->{content})" unless $resp->{success};
my $decoded = decode_json($resp->{content});
my @versions = reverse sort @{$decoded->{versions}};
my @versions = reverse sort {
(system("/usr/bin/dpkg", "--compare-versions", "$a", "gt", "$b") == 0) ? 1 : -1
} @{$decoded->{versions}};

# Keep the most recent 5 versions.
splice(@versions, 0, 5);
Expand Down

0 comments on commit 14f49aa

Please sign in to comment.