[137944] branches/gsoc15-portfile/github2port/github2port

chunyang at macports.org chunyang at macports.org
Tue Jun 23 10:18:17 PDT 2015


Revision: 137944
          https://trac.macports.org/changeset/137944
Author:   chunyang at macports.org
Date:     2015-06-23 10:18:17 -0700 (Tue, 23 Jun 2015)
Log Message:
-----------
github2port: Use the list command to make proc return value

Modified Paths:
--------------
    branches/gsoc15-portfile/github2port/github2port

Modified: branches/gsoc15-portfile/github2port/github2port
===================================================================
--- branches/gsoc15-portfile/github2port/github2port	2015-06-23 17:06:03 UTC (rev 137943)
+++ branches/gsoc15-portfile/github2port/github2port	2015-06-23 17:18:17 UTC (rev 137944)
@@ -41,21 +41,14 @@
             "expected github url but got \"$url\""
     }
 
-    set res {}
-
     set path [split $urlparts(path) /]
-    set author [lindex $path 0] ; lappend res $author
-    set project [lindex $path 1] ; lappend res $project
+    set author [lindex $path 0]
+    set project [lindex $path 1]
 
     set tarball [lindex $path end]
-    foreach i [parse_tarball_name $tarball] {
-        lappend res $i
-    }
-
     set tarball_from [expr {[string match */releases/download/* $url] ? "release" : ""}]
-    lappend res $tarball_from
 
-    return $res
+    return [list $author $project {*}[parse_tarball_name $tarball] $tarball_from]
 }
 
 proc parse_bitbucket_url {url} {
@@ -65,18 +58,13 @@
             "expected bitbucket url but got \"$url\""
     }
 
-    set res {}
-
     set path [split $urlparts(path) /]
-    set author [lindex $path 0] ; lappend res $author
-    set project [lindex $path 1] ; lappend res $project
+    set author [lindex $path 0]
+    set project [lindex $path 1]
 
     set tarball [lindex $path end]
-    foreach i [parse_tarball_name $tarball] {
-        lappend res $i
-    }
 
-    return $res
+    return [list $author $project {*}[parse_tarball_name $tarball]]
 }
 
 proc request_github {author project} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150623/c6a4550f/attachment.html>


More information about the macports-changes mailing list