[MacPorts] #56975: livecheck broken in GitHub PortGroup
MacPorts
noreply at macports.org
Wed Aug 15 13:33:40 UTC 2018
#56975: livecheck broken in GitHub PortGroup
---------------------+--------------------
Reporter: l2dy | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: |
---------------------+--------------------
Comment (by cjones051073):
Funnily enough, I stumbled over this myself yesterday and was looking into
it a bit, before finding this ticket, so thought I would post what I had
found just FYI...
I can confirm appending "Accept: text/html" to the curl http headers does
seem to fix things.
E.g. without I see for instance,
{{{
> port -d live tigervnc
<snip>
DEBUG: Executing org.macports.livecheck (tigervnc)
DEBUG: Port (livecheck) version is 1.7.1
DEBUG: Fetching https://github.com/TigerVNC/tigervnc/tags
DEBUG: The regex is "archive/v([^"]+)\.tar\.gz"
Error: cannot check if tigervnc was updated (regex didn't match)
}}}
whereas with
{{{
~/Projects/MacPorts/base > git diff
diff --git a/src/pextlib1.0/curl.c b/src/pextlib1.0/curl.c
index d8202bf4..26984fb5 100644
--- a/src/pextlib1.0/curl.c
+++ b/src/pextlib1.0/curl.c
@@ -465,7 +465,8 @@ CurlFetchCmd(Tcl_Interp* interp, int objc, Tcl_Obj*
CONST objv[])
}
/* Clear the Pragma: no-cache header */
headers = curl_slist_append(headers, "Pragma:");
+ headers = curl_slist_append(headers, "Accept: text/html");
theCurlCode = curl_easy_setopt(theHandle,
CURLOPT_HTTPHEADER, headers);
if (theCurlCode != CURLE_OK) {
theResult = SetResultFromCurlErrorCode(interp,
theCurlCode);
}}}
I see
{{{
> port -d live tigervnc
<snip>
DEBUG: Executing org.macports.livecheck (tigervnc)
DEBUG: Port (livecheck) version is 1.7.1
DEBUG: Fetching https://github.com/TigerVNC/tigervnc/tags
DEBUG: The regex is "archive/v([^"]+)\.tar\.gz"
DEBUG: The regex matched "archive/v1.9.0.tar.gz", extracted "1.9.0"
DEBUG: The regex matched "archive/v1.8.90.tar.gz", extracted "1.8.90"
DEBUG: The regex matched "archive/v1.8.0.tar.gz", extracted "1.8.0"
DEBUG: The regex matched "archive/v1.7.90.tar.gz", extracted "1.7.90"
DEBUG: The regex matched "archive/v1.7.1.tar.gz", extracted "1.7.1"
DEBUG: The regex matched "archive/v1.7.0.tar.gz", extracted "1.7.0"
DEBUG: The regex matched "archive/v1.6.90.tar.gz", extracted "1.6.90"
DEBUG: The regex matched "archive/v1.6.0.tar.gz", extracted "1.6.0"
DEBUG: The regex matched "archive/v1.5.90.tar.gz", extracted "1.5.90"
DEBUG: The regex matched "archive/v1.5.0.tar.gz", extracted "1.5.0"
tigervnc seems to have been updated (port version: 1.7.1, new version:
1.9.0)
}}}
So would do the trick...
Whether this is the right thing to do is another question.
Should this header be appending to all curl calls, or just the livecheck
ones ?
Would it be better instead to live with the shorter output and adjust the
regex accordingly ?
--
Ticket URL: <https://trac.macports.org/ticket/56975#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list