Ignore:
Timestamp:
Feb 6, 2012, 10:28:02 PM (8 years ago)
Author:
and.damore@…
Message:

fixing the issue with ports using github portgroup introduced with r89670, adding new option github.tarball_from and a option_proc to handle its changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/github-1.0.tcl

    r89688 r89692  
    3939
    4040options github.author github.project github.version github.tag_prefix
    41 options github.homepage github.raw github.master_sites
     41options github.homepage github.raw github.master_sites github.tarball_from
    4242
    4343default github.homepage {https://github.com/${github.author}/${github.project}}
    4444default github.raw {https://raw.github.com/${github.author}/${github.project}}
     45default github.master_sites {${github.homepage}/tarball/[join ${github.tag_prefix} ""]${github.version}}
     46default github.tarball_from {tags}
     47
     48option_proc github.tarball_from handle_tarball_from
     49
     50proc handle_tarball_from {option action args} {
     51    global github.author github.project github.master_sites master_sites
     52
     53    # keeping the default at tags like many portfiles already do
     54    # the port writer can set github.tarball_from to "downloads" and have the URI path accordingly changed
     55    if {[string equal ${action} "set"] && $args == "downloads"} {
     56        github.tarball_from ${args}
     57        github.master_sites https://github.com/downloads/${github.author}/${github.project}
     58        master_sites        ${github.master_sites}   
     59    }
     60}
    4561
    4662proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""}} {
     
    5773    git.url                 ${github.homepage}.git
    5874    git.branch              [join ${github.tag_prefix}]${github.version}
    59     # github supports two types of downloads "tags" and "downloads" with different URI scheme
    60     # choose either one according to existence of tag_prefix optional argument
    61     if {[info exists github.tag_prefix] && ![string equal ${github.tag_prefix} "{}"]} {
    62         github.master_sites ${github.homepage}/tarball/[join ${github.tag_prefix} ""]
    63     } else {
    64         github.master_sites https://github.com/downloads/${github.author}/${github.project}
    65     }
    6675    master_sites            ${github.master_sites}
    6776    distname                ${github.project}-${github.version}
     
    6978   
    7079    post-extract {
    71         if {![file exists ${worksrcpath}] && "standard" == ${fetch.type} && ${master_sites} == ${github.master_sites} && [llength ${distfiles}] > 0} {
     80        if {![file exists ${worksrcpath}] && "standard" == ${fetch.type} && \
     81            ${master_sites} == ${github.master_sites} && [llength ${distfiles}] > 0} {
    7282            move [glob ${workpath}/*] ${worksrcpath}
    7383        }
Note: See TracChangeset for help on using the changeset viewer.