mirror of https://github.com/i3/i3
cleanup-bintray: remove remaining bintray references (#5038)
* The `cleanup-bintray.pl` script is just unused * The `dh_builddeb` override is no longer necessary as bintray is no longer used
This commit is contained in:
parent
3597cc636e
commit
458c148934
|
@ -17,9 +17,5 @@ override_dh_auto_configure:
|
||||||
# Set -Ddocdir; the default is /usr/share/doc/i3
|
# Set -Ddocdir; the default is /usr/share/doc/i3
|
||||||
dh_auto_configure -- -Ddocdir=/usr/share/doc/i3-wm -Dmans=true
|
dh_auto_configure -- -Ddocdir=/usr/share/doc/i3-wm -Dmans=true
|
||||||
|
|
||||||
override_dh_builddeb:
|
|
||||||
# bintray does not support xz currently.
|
|
||||||
dh_builddeb -- -Zgzip
|
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --buildsystem=meson
|
dh $@ --buildsystem=meson
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/usr/bin/env perl
|
|
||||||
# vim:ts=4:sw=4:expandtab
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Data::Dumper;
|
|
||||||
use HTTP::Tiny; # in core since v5.13.9
|
|
||||||
use JSON::PP; # in core since v5.13.9
|
|
||||||
use MIME::Base64; # in core since v5.7
|
|
||||||
use v5.13;
|
|
||||||
|
|
||||||
my $repo = shift;
|
|
||||||
|
|
||||||
my $auth = $ENV{'BINTRAY_USER'} . ':' . $ENV{'BINTRAY_KEY'};
|
|
||||||
die "BINTRAY_USER and/or BINTRAY_KEY environment variables not set" if $auth eq ':';
|
|
||||||
# TODO(stapelberg): switch to putting $auth into the URL once perl-modules ≥
|
|
||||||
# 5.20 is available on travis (Ubuntu Wily or newer).
|
|
||||||
my $auth_header = 'Basic ' . MIME::Base64::encode_base64($auth, "");
|
|
||||||
my $apiurl = 'https://api.bintray.com/packages/i3/' . $repo . '/i3-wm';
|
|
||||||
my $client = HTTP::Tiny->new(
|
|
||||||
verify_SSL => 1,
|
|
||||||
default_headers => {
|
|
||||||
'authorization' => $auth_header,
|
|
||||||
});
|
|
||||||
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 {
|
|
||||||
(system("/usr/bin/dpkg", "--compare-versions", "$a", "gt", "$b") == 0) ? 1 : -1
|
|
||||||
} @{$decoded->{versions}};
|
|
||||||
|
|
||||||
# Keep the most recent 5 versions.
|
|
||||||
splice(@versions, 0, 5);
|
|
||||||
|
|
||||||
for my $version (@versions) {
|
|
||||||
say "Deleting old version $version";
|
|
||||||
$resp = $client->request('DELETE', "$apiurl/versions/$version");
|
|
||||||
die "Deletion of version $version failed: HTTP status $resp->{status} (content: $resp->{content})" unless $resp->{success};
|
|
||||||
}
|
|
Loading…
Reference in New Issue