Ignore:
Timestamp:
Sep 23, 2014, 2:02:07 PM (5 years ago)
Author:
ryandesign@…
Message:

bitbucket-1.0.tcl: set better default distname when tarball_from is downloads; set better default livecheck when version is not a commit; remove unnecessary bitbucket.livecheck_type variable

File:
1 edited

Legend:

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

    r125634 r125639  
    3838#   bitbucket.setup         author project version [tag_prefix]
    3939
    40 options bitbucket.author bitbucket.project bitbucket.version bitbucket.tag_prefix bitbucket.livecheck_type
     40options bitbucket.author bitbucket.project bitbucket.version bitbucket.tag_prefix
    4141options bitbucket.homepage bitbucket.master_sites bitbucket.tarball_from
    4242
     
    4444default bitbucket.master_sites {${bitbucket.homepage}/get}
    4545default bitbucket.tarball_from {tags}
    46 default bitbucket.livecheck_type ""
    4746
    4847default master_sites {${bitbucket.master_sites}}
     
    5150
    5251proc handle_tarball_from {option action args} {
    53     global bitbucket.author bitbucket.project bitbucket.master_sites
     52    global bitbucket.author bitbucket.project bitbucket.master_sites bitbucket.version
    5453
    5554    # the port writer can set bitbucket.tarball_from to "downloads" and have the URI path accordingly changed
     
    5756        bitbucket.tarball_from ${args}
    5857        bitbucket.master_sites https://bitbucket.org/${bitbucket.author}/${bitbucket.project}/downloads
     58        default distname {${bitbucket.project}-${bitbucket.version}}
    5959    }
    6060}
    6161
     62proc bitbucket.livecheck_regex {} {
     63    global bitbucket.tag_prefix bitbucket.tarball_from distname extract.suffix version
     64    switch ${bitbucket.tarball_from} {
     65        tags {
     66            set dir get
     67        }
     68        default {
     69            set dir ${bitbucket.tarball_from}
     70        }
     71    }
     72    return ${dir}/[regsub -- [quotemeta ${version}] ${distname} {([0-9.]+)}][quotemeta [quotemeta ${extract.suffix}]]
     73}
     74
    6275proc bitbucket.setup {bb_author bb_project bb_version {bb_tag_prefix ""}} {
    63     global bitbucket.author bitbucket.project bitbucket.version bitbucket.tag_prefix bitbucket.homepage bitbucket.master_sites extract.suffix bitbucket.livecheck_type
     76    global bitbucket.author bitbucket.homepage bitbucket.master_sites bitbucket.project bitbucket.tag_prefix bitbucket.version extract.suffix
    6477
    6578    bitbucket.author        ${bb_author}
     
    7386    hg.url                  ${bitbucket.homepage}
    7487    hg.tag                  [join ${bitbucket.tag_prefix}]${bitbucket.version}
    75     distname                [join ${bitbucket.tag_prefix}]${bitbucket.version}
     88    default distname        {${hg.tag}}
    7689    fetch.ignore_sslcert    yes
    7790
     
    88101    if {[join ${bitbucket.tag_prefix}] eq "" && \
    89102        [regexp "^\[0-9a-f\]{9,}\$" ${bitbucket.version}]} {
    90         bitbucket.livecheck_type commits
     103        default livecheck.type      regexm
     104        default livecheck.url       {${bitbucket.homepage}/atom}
     105        default livecheck.regex     {<id>changeset:(\[0-9a-f\]{[string length ${bitbucket.version}]})\[0-9a-f\]*</id>}
    91106    } else {
    92         bitbucket.livecheck_type tags
     107        default livecheck.type      regex
     108        default livecheck.url       {${bitbucket.homepage}/downloads}
     109        default livecheck.regex     {[bitbucket.livecheck_regex]}
    93110    }
    94111
    95     switch {${bitbucket.livecheck_type}} {
    96         commits {
    97             livecheck.type      regexm
    98             livecheck.url       ${bitbucket.homepage}/atom
    99             livecheck.version   ${bitbucket.version}
    100             livecheck.regex     <id>changeset:(\[0-9a-f\]{[string length ${bitbucket.version}]})\[0-9a-f\]*</id>
    101         }
    102         default {
    103             livecheck.type      regex
    104             livecheck.version   ${bitbucket.version}
    105             livecheck.url       ${bitbucket.homepage}/downloads
    106             livecheck.regex     get/[join ${bitbucket.tag_prefix}](\[0-9\.\]+)${extract.suffix}
    107         }
    108     }
     112    default livecheck.version   {${bitbucket.version}}
    109113}
    110114
Note: See TracChangeset for help on using the changeset viewer.