Ticket #42273: patch-github_portgroup.diff

File patch-github_portgroup.diff, 1.8 KB (added by anddam (Andrea D'Amore), 10 years ago)

use github.homepage

  • github-1.0.tcl

     
    4747
    4848default master_sites {${github.master_sites}}
    4949
    50 # The ability to host downloads on github is going away
     50# The old GitHub "downloads" system is no longer accepting new files.
    5151# https://github.com/blog/1302-goodbye-uploads
     52# It was replaced by "releases", which use different download URLs.
     53# https://github.com/blog/1547-release-your-software
    5254default github.tarball_from {tags}
    5355option_proc github.tarball_from handle_tarball_from
    5456proc handle_tarball_from {option action args} {
    55     global github.author github.project github.master_sites
     57    global github.author github.project github.master_sites git.branch github.homepage
    5658
    5759    # keeping the default at tags like many portfiles already do
    58     # the port writer can set github.tarball_from to "downloads" and have the URI path accordingly changed
     60    # the port writer can set github.tarball_from to "downloads" or "releases" and have the URI path accordingly changed
    5961    if {${action} eq "set" && $args eq "downloads"} {
    6062        github.tarball_from ${args}
    6163        github.master_sites https://github.com/downloads/${github.author}/${github.project}
     64    } elseif {${action} eq "set" && $args eq "releases"} {
     65       
     66        #  port maintainers will have to explictly set tag_prefix and distname
     67        #  in order to match the port's needs since there's no standard
     68        #  specifically if a release URL has a dash sign in it then tag prefix
     69        #  needs to contain the dash as well
     70        #  i.e. "v-1.2.3" requires a "v-" tag_prefix argument to github.setup
     71       
     72        github.tarball_from ${args}
     73        github.master_sites ${github.homepage}/releases/download/${git.branch}
    6274    }
    6375}
    6476