Ignore:
Timestamp:
Feb 4, 2013, 5:11:36 PM (6 years ago)
Author:
sean@…
Message:

github-1.0.tcl: automatically livecheck the rss feed if the version is a committish

File:
1 edited

Legend:

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

    r100626 r102489  
    3838#   github.setup            author project version [tag_prefix]
    3939
    40 options github.author github.project github.version github.tag_prefix
     40options github.author github.project github.version github.tag_prefix github.livecheck_type
    4141options github.homepage github.raw github.master_sites github.tarball_from
    4242
     
    4444default github.raw {https://raw.github.com/${github.author}/${github.project}}
    4545default github.master_sites {${github.homepage}/tarball/[join ${github.tag_prefix} ""]${github.version}}
     46default github.livecheck_type ""
    4647
    4748default master_sites {${github.master_sites}}
     
    6364
    6465proc github.setup {gh_author gh_project gh_version {gh_tag_prefix ""}} {
    65     global extract.suffix github.author github.project github.version github.tag_prefix github.homepage github.master_sites
     66    global extract.suffix github.author github.project github.version github.tag_prefix github.homepage github.master_sites github.livecheck_type
    6667
    6768    github.author           ${gh_author}
     
    8586    }
    8687
    87     livecheck.type          regex
    88     livecheck.version       ${github.version}
    89     livecheck.url           ${github.homepage}/tags
    90     livecheck.regex         archive/[join ${github.tag_prefix} ""](\[^"\]+)${extract.suffix}"
     88    if {[join ${github.tag_prefix}] == "" && [regexp "^\[0-9a-f\]{9,}\$" ${github.version}]} {
     89        github.livecheck_type "commits"
     90    } else {
     91        github.livecheck_type "tags"
     92    }
     93
     94    if {[string equal ${github.livecheck_type} "commits"]} {
     95        livecheck.type          regexm
     96        livecheck.url           ${github.homepage}/commits/master.atom
     97        livecheck.version       ${github.version}
     98        livecheck.regex         <id>tag:github.com,2008:Grit::Commit/(\[0-9a-f\]{[string length ${github.version}]})\[0-9a-f\]*</id>
     99    } else {
     100        livecheck.type          regex
     101        livecheck.version       ${github.version}
     102        livecheck.url           ${github.homepage}/tags
     103        livecheck.regex         archive/[join ${github.tag_prefix} ""](\[^"\]+)${extract.suffix}
     104    }
    91105}
Note: See TracChangeset for help on using the changeset viewer.