Index: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_PyPI.pm =================================================================== --- head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_PyPI.pm (revision 495574) +++ head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_PyPI.pm (nonexistent) @@ -1,16 +0,0 @@ ---- Portscout/SiteHandler/PyPI.pm.orig 2016-02-04 08:23:53 UTC -+++ Portscout/SiteHandler/PyPI.pm -@@ -109,11 +109,13 @@ sub GetFiles - $ua->agent(USER_AGENT); - $resp = $ua->request(HTTP::Request->new(GET => $query)); - if ($resp->is_success) { -+ _debug("GET success: " . $resp->code); - my ($json, $urls); - - $json = decode_json($resp->decoded_content); - $urls = $json->{urls}; - foreach my $url (@$urls) { -+ _debug("PyPi File: " . $url->{filename}); - push(@$files, $url->{filename}); - } - } else { Property changes on: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_PyPI.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_SourceForge.pm =================================================================== --- head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_SourceForge.pm (revision 495574) +++ head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_SourceForge.pm (nonexistent) @@ -1,11 +0,0 @@ ---- Portscout/SiteHandler/SourceForge.pm.orig 2010-05-05 01:54:16 UTC -+++ Portscout/SiteHandler/SourceForge.pm -@@ -85,7 +85,7 @@ sub CanHandle - - my ($url) = @_; - -- return ($url =~ /^http:\/\/[^\/]*?\.sourceforge\.net\/project\//); -+ return ($url =~ /^https?:\/\/[^\/]*?\.sourceforge\.net\/project\//); - } - - Property changes on: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_SourceForge.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-Portscout_DataSrc_Ports.pm =================================================================== --- head/ports-mgmt/portscout/files/patch-Portscout_DataSrc_Ports.pm (revision 495574) +++ head/ports-mgmt/portscout/files/patch-Portscout_DataSrc_Ports.pm (nonexistent) @@ -1,81 +0,0 @@ ---- Portscout/DataSrc/Ports.pm.orig 2011-04-09 17:19:03 UTC -+++ Portscout/DataSrc/Ports.pm -@@ -201,7 +201,7 @@ sub BuildDB - - my $lastbuild = getstat('buildtime', TYPE_INT); - -- print "Looking for updated ports...\n\n" -+ print "Incremental build: Looking for updated ports...\n\n" - if ($incremental); - - $got_ports = 0; -@@ -243,12 +243,15 @@ sub BuildDB - my (@fields, $maintainer, $port); - - @fields = split /\|/; -- $maintainer = $fields[5]; -+ $maintainer = lc($fields[5]); - $port = $fields[1]; - $port =~ s/^(?:.*\/)?([^\/]+)\/([^\/]+)$/$1\/$2/; - -- $portsmaintok{$port} = $maintainer -- if ($maintainers{$maintainer}); -+ if ($maintainers{$maintainer}) { -+ $portsmaintok{$port} = $maintainer; -+ print "Maintainer match: $maintainer $port \n" -+ unless ($settings{quiet}); -+ } - } - - close $if; -@@ -264,7 +267,7 @@ sub BuildDB - - opendir my $catdir, $settings{ports_dir}."/$cat"; - -- print "Scanning $cat...\n" -+ print "Scanning $cat ...\n" - unless ($settings{quiet}); - - while (my $name = readdir $catdir) { -@@ -276,9 +279,9 @@ sub BuildDB - # port directory's mtime; skip if not updated. - if ($incremental) { - my ($updated); -- - opendir my $portdir, $settings{ports_dir}."/$cat/$name"; -- -+ print "Scanning $cat/$name ... " -+ unless ($settings{quiet}); - while (my $subfile = readdir $portdir) { - my ($subfile_path, $fi); - -@@ -289,12 +292,18 @@ sub BuildDB - or die "Couldn't stat $subfile_path: $!"; - - if ($fi->mtime > $lastbuild) { -+ print "$subfile (mtime: $fi->mtime) modified updated since last build: $lastbuild \n" -+ if ($settings{debug}); - $updated = 1; - last; - } - } - -- next if (!$updated); -+ if (!$updated) { -+ print "Not modified since last build: $lastbuild \n" -+ if ($settings{debug}); -+ next; -+ } - } - - # Check this port is wanted by user -@@ -307,7 +316,8 @@ sub BuildDB - && $settings{indexfile_enable}) { - next if (!$portsmaintok{"$cat/$name"}); - } -- -+ print "Matched: $cat/$name\n" -+ unless ($settings{quiet}); - push @ports, "$cat/$name"; - } - } Property changes on: head/ports-mgmt/portscout/files/patch-Portscout_DataSrc_Ports.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-GitHub.pm =================================================================== --- head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-GitHub.pm (revision 495574) +++ head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-GitHub.pm (nonexistent) @@ -1,175 +0,0 @@ -#------------------------------------------------------------------------------ -# Copyright (C) 2014, Jasper Lievisse Adriaanse -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -#------------------------------------------------------------------------------ - -package Portscout::SiteHandler::GitHub; - -use JSON qw(decode_json); -use LWP::UserAgent; - -use Portscout::Const; -use Portscout::Config; - -use strict; - -require 5.006; - - -#------------------------------------------------------------------------------ -# Globals -#------------------------------------------------------------------------------ - -push @Portscout::SiteHandler::sitehandlers, __PACKAGE__; - -our %settings; - - -#------------------------------------------------------------------------------ -# Func: new() -# Desc: Constructor. -# -# Args: n/a -# -# Retn: $self -#------------------------------------------------------------------------------ - -sub new -{ - my $self = {}; - my $class = shift; - - $self->{name} = 'GitHub'; - - bless ($self, $class); - return $self; -} - - -#------------------------------------------------------------------------------ -# Func: CanHandle() -# Desc: Ask if this handler (package) can handle the given site. -# -# Args: $url - URL of site. -# -# Retn: $res - true/false. -#------------------------------------------------------------------------------ - -sub CanHandle -{ - my $self = shift; - - my ($url) = @_; - - return ($url =~ /^https?:\/\/([^\/.]+\.)?github\.com\/(.*?)\/tar.gz/); -} - - -#------------------------------------------------------------------------------ -# Func: GetFiles() -# Desc: Extract a list of files from the given URL. In the case of GitHub, -# we are actually pulling the files from the project's Atom feed and -# extract the release url, containing the tag it was based on. -# -# Args: $url - URL we would normally fetch from. -# \%port - Port hash fetched from database. -# \@files - Array to put files into. -# -# Retn: $success - False if file list could not be constructed; else, true. -#------------------------------------------------------------------------------ - -sub GetFiles -{ - my $self = shift; - - my ($url, $port, $files) = @_; - my $projname; - - if ($url =~ /https:\/\/github\.com\/(.*?)\/archive\//) { - $projname = $1; - } elsif ($url =~ /https:\/\/github.com\/downloads\/(.*)\//) { - $projname = $1; - } - - if ($projname) { - my ($query, $ua, $response, $items, $json); - - # First check if there's a latest releases endpoint - $query = 'https://api.github.com/repos/' . $projname . '/releases/latest'; - - _debug("GET $query"); - $ua = LWP::UserAgent->new; - $ua->agent(USER_AGENT); - $ua->timeout($settings{http_timeout}); - - $response = $ua->request(HTTP::Request->new(GET => $query)); - - if (!$response->is_success || $response->status_line !~ /^2/) { - _debug('GET failed: ' . $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"); - $ua = LWP::UserAgent->new; - $ua->agent(USER_AGENT); - $ua->timeout($settings{http_timeout}); - - $response = $ua->request(HTTP::Request->new(GET => $query)); - - if (!$response->is_success || $response->status_line !~ /^2/) { - _debug('GET failed: ' . $response->status_line); - return 0; - } - - $json = decode_json($response->decoded_content); - foreach my $tag (@$json) { - my $tag_url = $tag->{tarball_url}; - push(@$files, $tag_url); - } - - _debug('Found ' . scalar @$files . ' files'); - return 1; - } - - $json = decode_json($response->decoded_content); - push(@$files, $json->{tarball_url}); - - _debug('Found ' . scalar @$files . ' files'); - } else { - return 0; - } - - return 1; -} - - -#------------------------------------------------------------------------------ -# Func: _debug() -# Desc: Print a debug message. -# -# Args: $msg - Message. -# -# Retn: n/a -#------------------------------------------------------------------------------ - -sub _debug -{ - my ($msg) = @_; - - $msg = '' if (!$msg); - - print STDERR "(" . __PACKAGE__ . ") $msg\n" if ($settings{debug}); -} - -1; Property changes on: head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-GitHub.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-portscout.conf =================================================================== --- head/ports-mgmt/portscout/files/patch-portscout.conf (revision 495574) +++ head/ports-mgmt/portscout/files/patch-portscout.conf (nonexistent) @@ -1,14 +0,0 @@ ---- portscout.conf.orig 2015-10-25 05:00:59 UTC -+++ portscout.conf -@@ -172,5 +172,11 @@ db port = # Port - #db connstr = DBI:Pg:dbname=%(db_name);host=%(db_host);port=%(db_port) - db connstr = DBI:SQLite:dbname=/var/db/portscout.db - -+# GitHub site handler settings -+# GitHub rate limits requests to its API to a very low number for unauthenticated -+# requests, and 5000 per hour for authenticated requests. -+ -+# github_client_id = # GitHub Client ID -+# github_client_secret = # GitHub Client Secret - - # ex: ts=4 sw=4 Property changes on: head/ports-mgmt/portscout/files/patch-portscout.conf ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_GitHub.pm =================================================================== --- head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_GitHub.pm (revision 495574) +++ head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_GitHub.pm (nonexistent) @@ -1,38 +0,0 @@ ---- Portscout/SiteHandler/GitHub.pm.orig 2016-01-04 10:46:49 UTC -+++ Portscout/SiteHandler/GitHub.pm -@@ -97,7 +97,9 @@ sub GetFiles - my ($url, $port, $files) = @_; - my $projname; - -- if ($url =~ /https:\/\/github\.com\/(.*?)\/archive\//) { -+ if ($url =~ /https?:\/\/codeload\.github\.com\/(.*?)\/tar.gz\//) { -+ $projname = $1; -+ } elsif ($url =~ /https:\/\/github\.com\/(.*?)\/archive\//) { - $projname = $1; - } elsif ($url =~ /https:\/\/github.com\/downloads\/(.*)\//) { - $projname = $1; -@@ -108,7 +110,11 @@ sub GetFiles - - # First check if there's a latest releases endpoint - $query = 'https://api.github.com/repos/' . $projname . '/releases/latest'; -- -+ # Add GitHub Client ID & Secret if they are set in settings -+ # https://developer.github.com/v3/#authentication -+ if ($settings{github_client_id} && $settings{github_client_secret}) { -+ $query = $query . "?client_id=$settings{github_client_id}&client_secret=$settings{github_client_secret}"; -+ } - _debug("GET $query"); - $ua = LWP::UserAgent->new; - $ua->agent(USER_AGENT); -@@ -120,6 +126,11 @@ sub GetFiles - _debug('GET failed: ' . $response->status_line); - # Project didn't do any releases, so let's try tags instead. - $query = 'https://api.github.com/repos/' . $projname . '/tags'; -+ # Add GitHub Client ID & Secret if they are set in settings -+ # https://developer.github.com/v3/#authentication -+ if ($settings{github_client_id} && $settings{github_client_secret}) { -+ $query = $query . "?client_id=$settings{github_client_id}&client_secret=$settings{github_client_secret}"; -+ } - _debug("GET $query"); - $ua = LWP::UserAgent->new; - $ua->agent(USER_AGENT); Property changes on: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler_GitHub.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-portscout.pl =================================================================== --- head/ports-mgmt/portscout/files/patch-portscout.pl (revision 495574) +++ head/ports-mgmt/portscout/files/patch-portscout.pl (nonexistent) @@ -1,226 +0,0 @@ ---- portscout.pl.orig 2016-01-10 17:42:32 UTC -+++ portscout.pl -@@ -463,7 +463,7 @@ sub VersionCheck - - $i++; - -- info($k, 'Checking site: ' . strchop($site, 60)); -+ info($k, 'Checking site: ' . strchop($site, 200)); - - # Look to see if the URL contains the distfile version. - # This will affect our checks and guesses later on. -@@ -493,9 +493,12 @@ sub VersionCheck - } - - # Check for special handler for this site first -+ print "Does site handler exist ... " -+ unless ($settings{quiet}); - if (my $sh = Portscout::SiteHandler->FindHandler($site)) - { -- info($k, $site, 'Using dedicated site handler for site.'); -+ print "Yes \n" -+ unless ($settings{quiet}); - - if (!$sh->GetFiles($site, $port, \@files)) { - info($k, $site, 'SiteHandler::GetFiles() failed for ' . $site); -@@ -506,6 +509,9 @@ sub VersionCheck - { - my $ftp; - -+ print "No. Trying FTP...\n" -+ unless ($settings{quiet}); -+ - $ftp = Net::FTP->new( - $site->host, - Port => $site->port, -@@ -609,6 +615,9 @@ sub VersionCheck - { - my ($ua, $response); - -+ print "No. Trying HTTP...\n" -+ unless ($settings{quiet}); -+ - unless (robotsallowed($dbh, $site, $sitedata)) { - info($k, $site, 'Ignoring site as per rules in robots.txt.'); - -@@ -713,7 +722,8 @@ sub VersionCheck - - # Got a response which wasn't HTTP 4xx -> bail out - if ($response->is_success && $response->status_line !~ /^4/) { -- info($k, $site, 'Not doing any guessing; site is lieing to us.'); -+ print "URL: $url\n"; -+ info($k, $site, "Skip guessing: Response not 4xx to a file that shouldnt exist (". $response->status_line .")"); - $sths->{sitedata_initliecount}->execute($sitedata->{host}) - unless($settings{precious_data}); - next; -@@ -797,7 +807,7 @@ sub VersionCheck - $new_found = 1; - last; - } else { -- info($k, $site, "Guess failed $port->{ver} -> $guess_v"); -+ info($k, $site, "Guess failed $port->{ver} -> $guess_v (". $response->status_line .")"); - } - - last if ($new_found); -@@ -867,7 +877,10 @@ sub FindNewestFile - - foreach my $file (@$files) - { -- my $poss_path; -+ my ($poss_path, $github); -+ -+ print "FindNewest: Checking $file ... against port DISTFILES. \n" -+ if ($settings{debug}); - - if ($file =~ /^(.*)\/(.*?)$/) { - # Files from SiteHandlers can come with paths -@@ -888,6 +901,9 @@ sub FindNewestFile - - my $skip = 0; - -+ print "FindNewest: Checking DISTFILE ... $distfile (ver: $v, sufx: $s)\n" -+ if ($settings{debug}); -+ - if ($poss_path) { - # Do a full-URL comparison for $old_found - # if we're dealing with paths too. -@@ -908,14 +924,20 @@ sub FindNewestFile - } else { - if ($file eq $distfile) { - $old_found = 1; -+ print "FindNewest: File matches existing port DISTFILE. Old found. \n" -+ if ($settings{debug}); - next; - } - } - -+ $github = 1 if ($site->clone =~ /^https?:\/\/([^\/.]+\.)?github\.com\/(.*?)\/tar.gz/); -+ - # Skip beta versions if requested - - if ($port->{skipbeta}) { - if (isbeta($file) && !isbeta($distfile)) { -+ print "FindNewest: File is beta, skipbeta is defined. Skipping ...\n" -+ if ($settings{debug}); - next; - } - } -@@ -940,31 +962,64 @@ sub FindNewestFile - - # Possible candidate - extract version - -- if ($file =~ /^($distfile)$/ && $2) -+ #warn "distfile = $distfile 2 = $2"; -+ if (($file =~ /^($distfile)$/ && $2) or $github) - { -- my $version = $2; -- my $new_v = lc $version; -+ my ($version, $new_v, $matchver); - -- # Catch a few missed cases -+ unless ($github) { -+ $version = $2; -+ $new_v = lc $version; - -- $new_v =~ s/(?:$ext_regex)$//; -+ # Catch a few missed cases -+ $new_v =~ s/(?:$ext_regex)$//; - -- # Version is much longer than original - skip it -+ # Version is much longer than original - skip it -+ next if (length $new_v > (12 + length $old_v)); - -- next if (length $new_v > (12 + length $old_v)); -+ # New version is in date format (or contains a date-like -+ # string) - old one is not. Probably best to ignore. - -- # New version is in date format (or contains a date-like -- # string) - old one is not. Probably best to ignore. -+ next if ( -+ $new_v =~ /$date_regex/i && -+ $old_v !~ /$date_regex/i -+ ); - -- next if ( -- $new_v =~ /$date_regex/i && -- $old_v !~ /$date_regex/i -- ); -+ # Skip a few strange version format change cases -+ # (formatted -> "just a number") -+ next if ($new_v !~ /\./ && $old_v =~ /\./); -+ } else { -+ # Github is "special" since the actual URI we get back from the -+ # handler isn't the same as what is actually being retrieved. -+ # So fall back on comparing tags instead. - -- # Skip a few strange version format change cases -- # (formatted -> "just a number") -+ $new_v = $file; -+ $version = lc $new_v; - -- next if ($new_v !~ /\./ && $old_v =~ /\./); -+ # Only match version-esque looking strings from the tag -+ # because portscout currently only uses/stores a normalized -+ # 'ver', not PORTVERSION or DISTVERSION{FULL} so we have nothing -+ # canonical to compare agains. Currently the match is for digits -+ # with any non-digit separators, without non-digit prefixes and -+ # suffixes. This is likely the best we can get for now, without -+ # introducing false positives. -+ -+ ($matchver) = ($version =~ m/((?:\d+.)*\d+)/); -+ -+ print "FindNewestFile::Github: Input: $file Matchver: $matchver \n" -+ if ($settings{debug}); -+ -+ # Replace non-digit separators of digits with dots. -+ -+ $matchver =~ s/[^\d+]/\./g; -+ -+ if (defined($matchver)) { -+ $new_v = $matchver; -+ } -+ -+ print "FindNewestFile::Github: Matchver: $matchver Normalized: $new_v \n" -+ if ($settings{debug}); -+ } - - # Skip any specific versions if requested - -@@ -973,6 +1028,8 @@ sub FindNewestFile - - foreach (split (/\s+/, $port->{skipversions})) { - if ($new_v eq $_) { -+ print "FindNewest: skipversions is defined. Matched $_. Skipping...\n" -+ if ($settings{debug}); - $skip = 1; - last; - } -@@ -981,7 +1038,7 @@ sub FindNewestFile - next if ($skip); - } - -- unless ($settings{sillystrings_enable}) { -+ unless ($settings{sillystrings_enable} or $github) { - if ($new_v =~ /[-_.]([A-Za-z]+[A-Za-z_-]{2,})$/) { - my $str = $1; - next if ( -@@ -1026,12 +1083,19 @@ sub FindNewestFile - - # Test our new version string - -+ print "FindNewest: Comparing Old ($old_v) vs New ($new_v) version strings... \n" -+ if ($settings{debug}); -+ - if ($new_v eq $old_v) - { -+ print "FindNewest: Old ($old_v) == New ($new_v). Old found.\n" -+ if ($settings{debug}); - $old_found = 1; - } - elsif (vercompare($new_v, $old_v)) - { -+ print "FindNewest: Old ($old_v) < New ($new_v). New found.\n" -+ if ($settings{debug}); - $new_found = 1; - - # Keep going until we find the newest version Property changes on: head/ports-mgmt/portscout/files/patch-portscout.pl ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler.pm =================================================================== --- head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler.pm (revision 495574) +++ head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler.pm (nonexistent) @@ -1,11 +0,0 @@ ---- Portscout/SiteHandler.pm.orig 2010-04-29 01:07:51 UTC -+++ Portscout/SiteHandler.pm -@@ -31,6 +31,8 @@ package Portscout::SiteHandler; - use XML::XPath; - use XML::XPath::XMLParser; - -+use Portscout::SiteHandler::GitHub; -+use Portscout::SiteHandler::PyPI; - use Portscout::SiteHandler::SourceForge; - - use strict; Property changes on: head/ports-mgmt/portscout/files/patch-Portscout_SiteHandler.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-PyPI.pm =================================================================== --- head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-PyPI.pm (revision 495574) +++ head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-PyPI.pm (nonexistent) @@ -1,146 +0,0 @@ -#------------------------------------------------------------------------------ -# Copyright (C) 2015, Jasper Lievisse Adriaanse -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -#------------------------------------------------------------------------------ - -package Portscout::SiteHandler::PyPI; - -use JSON qw(decode_json); -use LWP::UserAgent; - -use Portscout::Const; -use Portscout::Config; - -use strict; - -require 5.006; - - -#------------------------------------------------------------------------------ -# Globals -#------------------------------------------------------------------------------ - -push @Portscout::SiteHandler::sitehandlers, __PACKAGE__; - -our %settings; - - -#------------------------------------------------------------------------------ -# Func: new() -# Desc: Constructor. -# -# Args: n/a -# -# Retn: $self -#------------------------------------------------------------------------------ - -sub new -{ - my $self = {}; - my $class = shift; - - $self->{name} = 'PyPI'; - - bless ($self, $class); - return $self; -} - - -#------------------------------------------------------------------------------ -# Func: CanHandle() -# Desc: Ask if this handler (package) can handle the given site. -# -# Args: $url - URL of site. -# -# Retn: $res - true/false. -#------------------------------------------------------------------------------ - -sub CanHandle -{ - my $self = shift; - - my ($url) = @_; - - return ($url =~ /https?:\/\/pypi\.python\.org\//); -} - - -#------------------------------------------------------------------------------ -# Func: GetFiles() -# Desc: Extract a list of files from the given URL. Simply query the API. -# -# Args: $url - URL we would normally fetch from. -# \%port - Port hash fetched from database. -# \@files - Array to put files into. -# -# Retn: $success - False if file list could not be constructed; else, true. -#------------------------------------------------------------------------------ - -sub GetFiles -{ - my $self = shift; - - my ($url, $port, $files) = @_; - - my ($pypi, $package, $resp, $query, $ua); - $pypi = 'https://pypi.python.org/pypi/'; - - # Strip all the digits at the end to keep the stem of the module. - if ($port->{distname} =~ /(.*?)-(\d+)/) { - $package = $1; - } - - $query = $pypi . $package . '/json'; - - _debug("GET $query"); - $ua = LWP::UserAgent->new; - $ua->agent(USER_AGENT); - $resp = $ua->request(HTTP::Request->new(GET => $query)); - if ($resp->is_success) { - my ($json, $urls); - - $json = decode_json($resp->decoded_content); - $urls = $json->{urls}; - foreach my $url (@$urls) { - push(@$files, $url->{filename}); - } - } else { - _debug("GET failed: " . $resp->code); - return 0; - } - - return 1; -} - - -#------------------------------------------------------------------------------ -# Func: _debug() -# Desc: Print a debug message. -# -# Args: $msg - Message. -# -# Retn: n/a -#------------------------------------------------------------------------------ - -sub _debug -{ - my ($msg) = @_; - - $msg = '' if (!$msg); - - print STDERR "(" . __PACKAGE__ . ") $msg\n" if ($settings{debug}); -} - -1; Property changes on: head/ports-mgmt/portscout/files/files-Portscout-SiteHandler-PyPI.pm ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/ports-mgmt/portscout/Makefile =================================================================== --- head/ports-mgmt/portscout/Makefile (revision 495574) +++ head/ports-mgmt/portscout/Makefile (revision 495575) @@ -1,117 +1,112 @@ # Created by: Shaun Amott # $FreeBSD$ PORTNAME= portscout -PORTVERSION= 0.8.1 -PORTREVISION= 11 +PORTVERSION= 0.8.1.2 CATEGORIES= ports-mgmt -MASTER_SITES= http://mirror.inerd.com/FreeBSD/distfiles/${PORTNAME}/ \ - http://www.atarininja.org/~wxs/distfiles/ \ - http://www.inerd.com/software/${PORTNAME}/ MAINTAINER= koobs@FreeBSD.org COMMENT= Tool to scan for new versions of FreeBSD ports LICENSE= BSD2CLAUSE RUN_DEPENDS= p5-DBI>=0:databases/p5-DBI \ p5-CGI>=0:www/p5-CGI \ p5-Proc-Queue>=0:devel/p5-Proc-Queue \ p5-URI>=0:net/p5-URI \ p5-XML-XPath>=0:textproc/p5-XML-XPath \ p5-MIME-Lite>=0:mail/p5-MIME-Lite \ p5-libwww>=0:www/p5-libwww \ p5-JSON>0:converters/p5-JSON +USES= perl5 shebangfix +USE_GITHUB= yes +GH_ACCOUNT= freebsd + OPTIONS_DEFINE= DOCS HTTPS OPTIONS_DEFAULT= HTTPS PGSQL OPTIONS_MULTI= DATABASE OPTIONS_MULTI_DATABASE= SQLITE PGSQL DATABASE_DESC= Database Backends -USES= perl5 shebangfix NO_ARCH= yes NO_BUILD= yes SHEBANG_FILES= ${WRKSRC}/portscout.pl PORTDOCS= UPDATING portscout-portconfig.txt xml-datasrc-example.xml HTTPS_RUN_DEPENDS= p5-LWP-Protocol-https>=0:www/p5-LWP-Protocol-https SQLITE_USES= sqlite SQLITE_RUN_DEPENDS= p5-DBD-SQLite>=0:databases/p5-DBD-SQLite PGSQL_USES= pgsql PGSQL_RUN_DEPENDS= p5-DBD-Pg>=0:databases/p5-DBD-Pg .include pre-everything:: .if ${PORT_OPTIONS:MSQLITE} @${ECHO_MSG} "+-------------------------------------------------------------+" @${ECHO_MSG} "| Warning! although SQLite is supported, portscout will only |" @${ECHO_MSG} "| operate in non-forking mode with this database backend. It |" @${ECHO_MSG} "| is therefore recommended only for use with light workloads. |" @${ECHO_MSG} "+-------------------------------------------------------------+" .endif - -post-extract: - @${CP} ${FILESDIR}/files-Portscout-SiteHandler-GitHub.pm ${WRKSRC}/Portscout/SiteHandler/GitHub.pm - @${CP} ${FILESDIR}/files-Portscout-SiteHandler-PyPI.pm ${WRKSRC}/Portscout/SiteHandler/PyPI.pm pre-install: @${REINPLACE_CMD} -e "s#^\(templates .*\)/etc#\1/share#" \ -e "s#^prefix\( *= *\).*#prefix\1${PREFIX}#" \ ${WRKSRC}/portscout.conf @${REINPLACE_CMD} -e "s#^\(.*PREFIX.*=> *\)'.*'#\1'${PREFIX}'#" \ ${WRKSRC}/Portscout/Const.pm @${MV} ${WRKSRC}/docs/*.* ${WRKSRC} pre-install-SQLITE-on: @${REINPLACE_CMD} 's/^\([^#]*DBI:Pg.*\)$$/#\1/g' ${WRKSRC}/portscout.conf @${REINPLACE_CMD} 's/^#\(.*DBI:SQLite.*\)$$/\1/g' ${WRKSRC}/portscout.conf do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout @${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/DataSrc @${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SiteHandler @${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SQL ${INSTALL_SCRIPT} ${WRKSRC}/Portscout/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/ ${INSTALL_SCRIPT} ${WRKSRC}/Portscout/DataSrc/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/DataSrc/ ${INSTALL_SCRIPT} ${WRKSRC}/Portscout/SiteHandler/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SiteHandler/ ${INSTALL_SCRIPT} ${WRKSRC}/Portscout/SQL/*.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout/SQL/ ${INSTALL_SCRIPT} ${WRKSRC}/Portscout.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/Portscout.pm ${INSTALL_SCRIPT} ${WRKSRC}/portscout.pl ${STAGEDIR}${PREFIX}/bin/portscout ${INSTALL_DATA} ${WRKSRC}/portscout.pod ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} pod2man ${WRKSRC}/portscout.pod ${WRKSRC}/portscout.1 ${INSTALL_MAN} ${WRKSRC}/portscout.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/ @${MKDIR} ${STAGEDIR}${DATADIR}/templates cd ${WRKSRC}/templates \ && ${INSTALL_DATA} * ${STAGEDIR}${DATADIR}/templates @${MKDIR} ${STAGEDIR}${DATADIR}/sql cd ${WRKSRC}/sql && ${INSTALL_DATA} *.sql ${STAGEDIR}${DATADIR}/sql ${INSTALL_DATA} ${WRKSRC}/portscout.conf ${STAGEDIR}${PREFIX}/etc/portscout.conf.sample do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} . for f in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} . endfor test: ${PERL} ${WRKSRC}/t/00-use.t ${PERL} ${WRKSRC}/t/01-vercompare.t .if ${PORT_OPTIONS:MSQLITE} ${PERL} ${WRKSRC}/t/10-sqlite.t #.else # ${PERL} ${WRKSRC}/10-postgresql.t .endif .include Index: head/ports-mgmt/portscout/distinfo =================================================================== --- head/ports-mgmt/portscout/distinfo (revision 495574) +++ head/ports-mgmt/portscout/distinfo (revision 495575) @@ -1,2 +1,3 @@ -SHA256 (portscout-0.8.1.tar.gz) = fec03f53a64e44e44debbbebe985e61f8603729145899c152286ecd5effe8b65 -SIZE (portscout-0.8.1.tar.gz) = 56079 +TIMESTAMP = 1552485071 +SHA256 (freebsd-portscout-0.8.1.2_GH0.tar.gz) = c709ec73229e6abce56dd5cee1af0aca6362552676601b386b6b3d5365b588e8 +SIZE (freebsd-portscout-0.8.1.2_GH0.tar.gz) = 57138