Page MenuHomeFreeBSD

ports-mgmt/portscout: Make GitHub ports work, fix bugs
ClosedPublic

Authored by koobs on Jan 4 2016, 10:16 AM.
Tags
None
Referenced Files
F104015426: D4780.diff
Mon, Dec 2, 10:45 AM
Unknown Object (File)
Thu, Nov 28, 3:11 PM
Unknown Object (File)
Oct 4 2024, 11:25 PM
Unknown Object (File)
Sep 24 2024, 12:01 AM
Unknown Object (File)
Sep 24 2024, 12:01 AM
Unknown Object (File)
Sep 24 2024, 12:01 AM
Unknown Object (File)
Sep 24 2024, 12:01 AM
Unknown Object (File)
Sep 24 2024, 12:01 AM
Subscribers

Details

Summary

Commit log:

ports-mgmt/portscout: Make GitHub ports work, fix bugs

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
Test Plan
  • portlint: OK
  • testport: OK

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 1943
Build 1950: arc lint + arc unit

Event Timeline

koobs retitled this revision from to ports-mgmt/portscout: Make GitHub ports work, fix bugs.
koobs updated this object.
koobs edited the test plan for this revision. (Show Details)
koobs added reviewers: kwm, miwi.
koobs added subscribers: zi, peter.
koobs updated this object.
koobs added a reviewer: mat.
koobs added a subscriber: mat.

Add @mat for his perl expertises

Check if $matchver is defined

Check if $matchver is defined before using it.

Reported by: ak

Revert PyPi and portscout.pl patches

post-patch REINPLACE_CMD changes portscout.conf to enable the database
that has been selected in OPTIONS, and changes the template_dir.

makemake regenerated them based on those changes, which shouldn't be included
in this commit.

koobs added subscribers: kwm, ak.

@mat, @ak and @kwm said it looks ok, but they dont want to put their names to the review, which is fine :)

This revision was automatically updated to reflect the committed changes.