<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/b0f3e97ce45b54e5510687a3555e2db662d72aab">https://github.com/macports/macports-ports/commit/b0f3e97ce45b54e5510687a3555e2db662d72aab</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new b0f3e97ce45 github portgroup: update github.tarball_from default
</span>b0f3e97ce45 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit b0f3e97ce45b54e5510687a3555e2db662d72aab
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Jan 30 09:29:36 2025 +1100
<span style='display:block; white-space:pre;color:#404040;'> github portgroup: update github.tarball_from default
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Now using archive if the tag looks like a commit hash, and releases
</span><span style='display:block; white-space:pre;color:#404040;'> otherwise. While always using archive would work, releases is
</span><span style='display:block; white-space:pre;color:#404040;'> preferable when available, and there's no simple way to give feedback
</span><span style='display:block; white-space:pre;color:#404040;'> that you should switch to releases if you're using archive (whereas the
</span><span style='display:block; white-space:pre;color:#404040;'> download from releases failing is an obvious sign that you should use
</span><span style='display:block; white-space:pre;color:#404040;'> something else.)
</span>---
_resources/port1.0/group/github-1.0.tcl | 70 ++++++++++++++++++---------------
1 file changed, 38 insertions(+), 32 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/github-1.0.tcl b/_resources/port1.0/group/github-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index e5fe4f4c0ba..76e21b27113 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/github-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/github-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,40 +18,45 @@ default github.raw {https://raw.githubusercontent.com/${github.author}/${github.
</span>
# Later code assumes that github.master_sites is a simple string, not a list.
options github.master_sites
<span style='display:block; white-space:pre;background:#ffe0e0;'>-default github.master_sites {https://codeload.github.com/${github.author}/${github.project}/legacy.tar.gz/${git.branch}?dummy=}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default github.master_sites {[github.get_master_sites]}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-options github.tarball_from
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default github.tarball_from tarball
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-option_proc github.tarball_from handle_tarball_from
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-proc handle_tarball_from {option action args} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- global extract.suffix git.branch github.author github.homepage github.master_sites github.project
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc github.get_master_sites {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global github.tarball_from github.homepage git.branch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch -- ${github.tarball_from} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # FIXME: Generate a more specific URL. When a branch and tag
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # share the same name, this will fail to resolve correctly.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # See:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://trac.macports.org/ticket/70652
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives#source-code-archive-urls
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${github.homepage}/archive/${git.branch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ downloads {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # GitHub no longer hosts downloads on their servers.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return macports_distfiles
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tarball {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global github.author github.project
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return https://codeload.github.com/${github.author}/${github.project}/legacy.tar.gz/${git.branch}?dummy=
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # default to 'releases'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${github.homepage}/releases/download/${git.branch}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+options github.tarball_from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default github.tarball_from releases
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+option_proc github.tarball_from github.handle_tarball_from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc github.handle_tarball_from {option action args} {
</span> if {${action} eq "set"} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- github.tarball_from ${args}
</span> switch ${args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- downloads {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # GitHub no longer hosts downloads on their servers.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- github.master_sites macports_distfiles
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default extract.rename no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- releases {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- github.master_sites ${github.homepage}/releases/download/${git.branch}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default extract.rename no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- archive {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # FIXME: Generate a more specific URL. When a branch and tag
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # share the same name, this will fail to resolve correctly.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # See:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://trac.macports.org/ticket/70652
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives#source-code-archive-urls
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- github.master_sites ${github.homepage}/archive/${git.branch}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default extract.rename {[expr {[llength ${extract.only}] == 1}]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- tarball {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- github.master_sites https://codeload.github.com/${github.author}/${github.project}/legacy.tar.gz/${git.branch}?dummy=
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default extract.rename {[expr {[llength ${extract.only}] == 1}]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ archive -
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ downloads -
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ releases -
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tarball {}
</span> tags {
return -code error "the value \"tags\" is deprecated for github.tarball_from. Please use \"tarball\" instead."
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -69,7 +74,7 @@ options github.livecheck.regex
</span> default github.livecheck.regex {(\[^"]+)}
proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""} {gh_tag_suffix ""}} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global extract.suffix github.author github.project github.version github.tag_prefix github.tag_suffix \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global github.author github.project github.version github.tag_prefix github.tag_suffix \
</span> github.homepage github.master_sites github.livecheck.branch PortInfo
github.author ${gh_author}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -89,7 +94,7 @@ proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""} {gh_tag_su
</span> default master_sites {${github.master_sites}}
distname ${github.project}-${github.version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- default extract.rename {[expr {[llength ${extract.only}] == 1}]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default extract.rename {[expr {${github.tarball_from} in {archive tarball} && [llength ${extract.only}] == 1}]}
</span>
# If the version is composed entirely of hex characters, and is at least 7
# characters long, and is not exactly 8 decimal digits (which might be a
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -103,6 +108,7 @@ proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""} {gh_tag_su
</span> livecheck.type regexm
default livecheck.url {${github.homepage}/commits/${github.livecheck.branch}.atom}
default livecheck.regex {<id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id>}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ default github.tarball_from archive
</span> } else {
livecheck.type regex
default livecheck.url {${github.homepage}/tags}
</pre><pre style='margin:0'>
</pre>