A number of people reported no updates being detected for ports using
USE_GITHUB=yes, even after originally adding the GitHub site handler in
r401037 [1]. Investigation revealed that the FindNewestFile subroutine
and the vercompare() method assumed (or are designed so) that responses
returned from site handlers will be in a normalised version format. For
site handlers that return 'versions', this works well. For the github
handler, in the fallback use of the API for fetching repository tags, it
does not.
Additionally it turns out, portscout currently only uses/stores a
normalized version ('ver') in its database, in its general design
attempt to be a generic version comparison tool
In particular, portscout does not reference or store PORTVERSION
or DISTVERSION{FULL}, so we have nothing 'canonical' to compare
the responses from Github (tags) against.
This change special-cases Github in the FindNewestFile subroutine, which
was obtained via Portroach [2] (OpenBSD's portscout fork).
Extending this, we also now only match version-esque looking strings
from the tag, in an attempt to normalise, because they come in many
forms, including {foo-}X.Y.Z{-bar}, foo_X_Y_Z, among others.
While I'm here,
* Fix copypasta of $github_client_id, when $github_client_secret was
intended
* Add code to use authenticated requests for Github project tags in the
fallback (to /releases) case.
* Add and update some more debug messages to help diagnosis of future
issues
Special thank you's to:
* matthew, allanjude, mandree, des, Brendan Molloy for your regex, perl
help and moral support.
[1] http://svnweb.freebsd.org/changeset/ports/401037
[2] https://github.com/jasperla/portroach
Differential Revision: D4780