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

and.damore at macports.org and.damore at macports.org
Mon Feb 6 14:28:02 PST 2012


Revision: 89692
          http://trac.macports.org/changeset/89692
Author:   and.damore at macports.org
Date:     2012-02-06 14:28:02 -0800 (Mon, 06 Feb 2012)
Log 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

Revision Links:
--------------
    http://trac.macports.org/changeset/89670

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 22:26:17 UTC (rev 89691)
+++ trunk/dports/_resources/port1.0/group/github-1.0.tcl	2012-02-06 22:28:02 UTC (rev 89692)
@@ -38,11 +38,27 @@
 #   github.setup            author project version [tag_prefix]
 
 options github.author github.project github.version github.tag_prefix
-options github.homepage github.raw github.master_sites
+options github.homepage github.raw github.master_sites github.tarball_from
 
 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} ""]${github.version}}
+default github.tarball_from {tags}
 
+option_proc github.tarball_from handle_tarball_from
+
+proc handle_tarball_from {option action args} {
+    global github.author github.project github.master_sites master_sites
+
+    # keeping the default at tags like many portfiles already do
+    # the port writer can set github.tarball_from to "downloads" and have the URI path accordingly changed
+    if {[string equal ${action} "set"] && $args == "downloads"} {
+        github.tarball_from ${args}
+        github.master_sites https://github.com/downloads/${github.author}/${github.project}
+        master_sites        ${github.master_sites}    
+    }
+}
+
 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,19 +72,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
     
     post-extract {
-        if {![file exists ${worksrcpath}] && "standard" == ${fetch.type} && ${master_sites} == ${github.master_sites} && [llength ${distfiles}] > 0} {
+        if {![file exists ${worksrcpath}] && "standard" == ${fetch.type} && \
+            ${master_sites} == ${github.master_sites} && [llength ${distfiles}] > 0} {
             move [glob ${workpath}/*] ${worksrcpath}
         }
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120206/1600a477/attachment.html>


More information about the macports-changes mailing list