[89670] trunk/dports/_resources/port1.0/group/github-1.0.tcl

Ryan Schmidt ryandesign at macports.org
Mon Feb 6 10:46:03 PST 2012


On Feb 6, 2012, at 07:25, and.damore at macports.org wrote:

> Revision: 89670
>          http://trac.macports.org/changeset/89670
> Author:   and.damore at macports.org
> Date:     2012-02-06 05:25:52 -0800 (Mon, 06 Feb 2012)
> Log Message:
> -----------
> github portgroup: support both "downloads" and "tags" download, when tag_prefix argument to github.setup is specified then master_sites URI path is set accordingly otherwise a "download" path is used

I do want to find a way to support "downloads" in addition to "tags", however this change breaks github portgroup ports that do not set a tag_prefix, and not setting tag_prefix is the most common way to use the github portgroup, so this change breaks most github portgroup ports. Take for example coffee-script. Its github.setup line is:

github.setup        jashkenas coffee-script 1.2.0

Before your changes, it would download from this URL, which is correct:

https://github.com/jashkenas/coffee-script/tarball/1.2.0/coffee-script-1.2.0.tar.gz

Now it tries to download from this URL, which is 404 not found:

https://github.com/downloads/jashkenas/coffee-script/coffee-script-1.2.0.tar.gz

Please revert this change.



> Modified Paths:
> --------------
>    trunk/dports/_resources/port1.0/group/github-1.0.tcl
> 
> Modified: trunk/dports/_resources/port1.0/group/github-1.0.tcl
> ===================================================================
> --- trunk/dports/_resources/port1.0/group/github-1.0.tcl	2012-02-06 13:20:28 UTC (rev 89669)
> +++ trunk/dports/_resources/port1.0/group/github-1.0.tcl	2012-02-06 13:25:52 UTC (rev 89670)
> @@ -41,7 +41,6 @@
> 
> default github.homepage {https://github.com/${github.author}/${github.project}}
> default github.raw {https://raw.github.com/${github.author}/${github.project}}
> -default github.master_sites {${github.homepage}/tarball/[join ${github.tag_prefix} ""]}
> 
> proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""}} {
>     global github.author github.project github.version github.tag_prefix github.homepage github.master_sites
> @@ -56,6 +55,13 @@
>     homepage                ${github.homepage}
>     git.url                 ${github.homepage}.git
>     git.branch              [join ${github.tag_prefix}]${github.version}
> +    # github supports two types of downloads "tags" and "downloads" with different URI scheme
> +    # choose either one according to existence of tag_prefix optional argument
> +    if {[info exists github.tag_prefix] && ![string equal ${github.tag_prefix} "{}"]} {
> +        github.master_sites ${github.homepage}/tarball/[join ${github.tag_prefix} ""]
> +    } else {
> +        github.master_sites https://github.com/downloads/${github.author}/${github.project}
> +    }
>     master_sites            ${github.master_sites}
>     distname                ${github.project}-${github.version}
>     fetch.ignore_sslcert    yes





More information about the macports-dev mailing list