update to portroach-2.0.11, containing a bunch of fixes related to github.
nb: in order to do a full portroach scan one needs a github token otherwise rate-limiting will block requests after the default limit of 60 p/h has been reached.
This commit is contained in:
parent
f2c45c63c6
commit
5325a42408
@ -1,11 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.29 2017/03/25 14:18:49 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.30 2017/04/16 09:14:52 jasper Exp $
|
||||
|
||||
COMMENT= OpenBSD ports distfile version scanner
|
||||
|
||||
GH_ACCOUNT= jasperla
|
||||
GH_PROJECT= portroach
|
||||
GH_TAGNAME= 2.0.10
|
||||
REVISION= 3
|
||||
GH_TAGNAME= 2.0.11
|
||||
|
||||
CATEGORIES= misc
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (portroach-2.0.10.tar.gz) = FOGEMKY3j/B7lRm185tJ9+8WyUiLKtwmZjroHKjUUZ4=
|
||||
SIZE (portroach-2.0.10.tar.gz) = 108149
|
||||
SHA256 (portroach-2.0.11.tar.gz) = XVWf46um2LQVwfzq24ck8GmeOrE/apw7rjuSXcFCWuM=
|
||||
SIZE (portroach-2.0.11.tar.gz) = 109107
|
||||
|
@ -1,72 +0,0 @@
|
||||
$OpenBSD: patch-Portroach_SiteHandler_GitHub_pm,v 1.1 2016/09/09 06:41:25 jasper Exp $
|
||||
|
||||
From 0db355e340d0c162a5bcb67424f25458915e1d6d Mon Sep 17 00:00:00 2001
|
||||
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
|
||||
Date: Sun, 31 Jan 2016 14:04:44 +0100
|
||||
Subject: [PATCH] try harder to make sense of github
|
||||
|
||||
From 8404eca077af475de10ce50b20326d6213c72622 Mon Sep 17 00:00:00 2001
|
||||
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
|
||||
Date: Sun, 31 Jan 2016 14:03:13 +0100
|
||||
Subject: [PATCH] handle another github url
|
||||
|
||||
--- Portroach/SiteHandler/GitHub.pm.orig Fri Jan 1 21:46:36 2016
|
||||
+++ Portroach/SiteHandler/GitHub.pm Fri Sep 9 08:40:10 2016
|
||||
@@ -19,6 +19,7 @@ package Portroach::SiteHandler::GitHub;
|
||||
|
||||
use JSON qw(decode_json);
|
||||
use LWP::UserAgent;
|
||||
+use URI;
|
||||
|
||||
use Portroach::Const;
|
||||
use Portroach::Config;
|
||||
@@ -101,6 +102,8 @@ sub GetFiles
|
||||
$projname = $1;
|
||||
} elsif ($url =~ /https:\/\/github.com\/downloads\/(.*)\//) {
|
||||
$projname = $1;
|
||||
+ } elsif ($url =~ /https:\/\/github.com\/(.*?)\/releases\//) {
|
||||
+ $projname = $1;
|
||||
}
|
||||
|
||||
if ($projname) {
|
||||
@@ -117,7 +120,7 @@ sub GetFiles
|
||||
$response = $ua->request(HTTP::Request->new(GET => $query));
|
||||
|
||||
if (!$response->is_success || $response->status_line !~ /^2/) {
|
||||
- _debug('GET failed: ' . $response->status_line);
|
||||
+ _debug('GET failed for /latest: ' . $response->status_line);
|
||||
# Project didn't do any releases, so let's try tags instead.
|
||||
$query = 'https://api.github.com/repos/' . $projname . '/tags';
|
||||
_debug("GET $query");
|
||||
@@ -135,15 +138,29 @@ sub GetFiles
|
||||
$json = decode_json($response->decoded_content);
|
||||
foreach my $tag (@$json) {
|
||||
my $tag_url = $tag->{tarball_url};
|
||||
+ _debug(" -> $tag_url");
|
||||
push(@$files, $tag_url);
|
||||
}
|
||||
|
||||
_debug('Found ' . scalar @$files . ' files');
|
||||
return 1;
|
||||
}
|
||||
-
|
||||
$json = decode_json($response->decoded_content);
|
||||
- push(@$files, $json->{tarball_url});
|
||||
+
|
||||
+ # TODO: To generate proper URLs in the frontend:
|
||||
+ # If the project has done actual releases, (check the
|
||||
+ # url), then look for the item with label "Source
|
||||
+ # code" and use it's name field
|
||||
+ #
|
||||
+ # For now we take the filename part of the URI, add
|
||||
+ # a recognized extension and treat it as a file.
|
||||
+ {
|
||||
+ my $filename = (URI->new($json->{tarball_url})->path_segments)[-1];
|
||||
+ _debug(" -> " . $filename);
|
||||
+ $filename =~ s/^v//;
|
||||
+ $projname =~ m/.*?\/(.*)/;
|
||||
+ push(@$files, $1 . "-" . $filename . ".tar.gz");
|
||||
+ }
|
||||
|
||||
_debug('Found ' . scalar @$files . ' files');
|
||||
} else {
|
@ -1,25 +0,0 @@
|
||||
$OpenBSD: patch-Portroach_SiteHandler_Launchpad_pm,v 1.1 2017/03/25 14:18:49 jasper Exp $
|
||||
|
||||
Unbreak with perl 5.24:
|
||||
Experimental keys on scalar is now forbidden at Portroach/SiteHandler/Launchpad.pm line 119.
|
||||
|
||||
--- Portroach/SiteHandler/Launchpad.pm.orig Sat Mar 25 15:12:50 2017
|
||||
+++ Portroach/SiteHandler/Launchpad.pm Sat Mar 25 15:13:06 2017
|
||||
@@ -116,7 +116,7 @@ sub GetFiles
|
||||
|
||||
# 'entries' is a singleton array, where the first element
|
||||
# contains hashes with the actual entries
|
||||
- foreach my $e (keys($entries{entries})) {
|
||||
+ foreach my $e (keys(%{$entries{entries}})) {
|
||||
my $files_collection_link = $entries{entries}[$e]->{files_collection_link};
|
||||
|
||||
# Now that we have the files_collection_link, retrieve that so
|
||||
@@ -128,7 +128,7 @@ sub GetFiles
|
||||
if ($fcl_resp->is_success) {
|
||||
my %entries_fcl = %{decode_json($fcl_resp->decoded_content)};
|
||||
|
||||
- foreach my $ef (keys($entries_fcl{entries})) {
|
||||
+ foreach my $ef (keys(%{$entries_fcl{entries}})) {
|
||||
my $self_link = $entries_fcl{entries}[$ef]->{self_link};
|
||||
push @$files, $self_link;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
$OpenBSD: patch-Portroach_SiteHandler_PyPI_pm,v 1.2 2016/04/27 17:02:17 jasper Exp $
|
||||
|
||||
From f3ce759e766027f45ed6f52a832d3a2140a9cf69 Mon Sep 17 00:00:00 2001
|
||||
Author: Jasper Lievisse Adriaanse <jasper@humppa.nl>
|
||||
Date: Wed Apr 27 18:58:44 2016 +0200
|
||||
Subject: [PATCH] Sync with the new MODPY_PI mastersite
|
||||
|
||||
From e93b8331f6e5f850bbb5faca866efcbf73de756c Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Shadchin <alexandr.shadchin@gmail.com>
|
||||
Date: Fri, 18 Dec 2015 03:29:57 +0500
|
||||
Subject: [PATCH] Fix PyPI
|
||||
|
||||
--- Portroach/SiteHandler/PyPI.pm.orig Fri Jan 1 21:46:36 2016
|
||||
+++ Portroach/SiteHandler/PyPI.pm Wed Apr 27 19:00:55 2016
|
||||
@@ -73,7 +73,7 @@ sub CanHandle
|
||||
|
||||
my ($url) = @_;
|
||||
|
||||
- return ($url =~ /https:\/\/pypi\.python\.org\//);
|
||||
+ return ($url =~ /https:\/\/pypi\.io\//);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,14 +109,13 @@ sub GetFiles
|
||||
$ua->agent(USER_AGENT);
|
||||
$resp = $ua->request(HTTP::Request->new(GET => $query));
|
||||
if ($resp->is_success) {
|
||||
- my ($json, $info, $version);
|
||||
+ my ($json, $urls);
|
||||
|
||||
$json = decode_json($resp->decoded_content);
|
||||
- $info = $json->{info};
|
||||
- $version = $info->{version};
|
||||
- next unless $version;
|
||||
-
|
||||
- push(@$files, $json->{releases}{$version}[0]{filename});
|
||||
+ $urls = $json->{urls};
|
||||
+ foreach my $url (@$urls) {
|
||||
+ push(@$files, $url->{filename});
|
||||
+ }
|
||||
} else {
|
||||
_debug("GET failed: " . $resp->code);
|
||||
return 0;
|
Loading…
Reference in New Issue
Block a user