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

Lawrence Velázquez larryv at macports.org
Tue Jun 23 10:11:04 PDT 2015


On Jun 23, 2015, at 1:06 PM, chunyang at macports.org wrote:

> Revision
> 137943 <https://trac.macports.org/changeset/137943>Author
> chunyang at macports.org <mailto:chunyang at macports.org>Date
> 2015-06-23 10:06:03 -0700 (Tue, 23 Jun 2015)
> Log Message
> 
> github2port: Simplify regexp use and use list rather than concat for making proc return
> Modified Paths
> 
> branches/gsoc15-portfile/github2port/github2port <x-msg://60/#branchesgsoc15portfilegithub2portgithub2port>
> +    set res {}
> +
>      set path [split $urlparts(path) /]
> -    set author [lindex $path 0]
> -    set project [lindex $path 1]
> +    set author [lindex $path 0] ; lappend res $author
> +    set project [lindex $path 1] ; lappend res $project
> +
>      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 [concat $author $project [parse_tarball_name $tarball] $tarball_from]
> +    return $res
>  }

I think this would be clearer if you used the "list" command:

	return [list $author $project {*}[parse_tarball_name $tarball] $tarball_from]

vq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20150623/108235f0/attachment.html>


More information about the macports-dev mailing list