On Jun 23, 2015, at 1:06 PM, [email protected] wrote:

> Revision
> 137943 <https://trac.macports.org/changeset/137943>Author
> [email protected] <mailto:[email protected]>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
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to