<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[137934] branches/gsoc15-portfile</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/137934">137934</a></dd>
<dt>Author</dt> <dd>chunyang@macports.org</dd>
<dt>Date</dt> <dd>2015-06-23 03:39:00 -0700 (Tue, 23 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge bitbucket2port into github2port</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesgsoc15portfilegithub2portgithub2port">branches/gsoc15-portfile/github2port/github2port</a></li>
<li><a href="#branchesgsoc15portfileportcreate">branches/gsoc15-portfile/port-create</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchesgsoc15portfilegithub2portbitbucket2port">branches/gsoc15-portfile/github2port/bitbucket2port</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesgsoc15portfilegithub2portbitbucket2port"></a>
<div class="delfile"><h4>Deleted: branches/gsoc15-portfile/github2port/bitbucket2port (137933 => 137934)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/github2port/bitbucket2port        2015-06-23 10:30:09 UTC (rev 137933)
+++ branches/gsoc15-portfile/github2port/bitbucket2port        2015-06-23 10:39:00 UTC (rev 137934)
</span><span class="lines">@@ -1,92 +0,0 @@
</span><del>-#!/usr/bin/env port-tclsh
-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-#
-# Generate a bitbucket group template Portfile given bitbucket homepage or tarball URL
-
-package require uri
-
-proc usage {{channel stderr}} {
-    global argv0
-    puts $channel &quot;Usage: $argv0 URL&quot;
-    puts $channel &quot;&quot;
-    puts $channel &quot;URL is the bitbucket homepage URL&quot;
-    puts $channel &quot;&quot;
-    puts $channel &quot;Example:&quot;
-    puts $channel &quot;  $argv0 https://bitbucket.org/sshguard/sshguard&quot;
-}
-
-proc val_or_def {val def} {
-    expr {$val ne &quot;&quot; ? $val : $def}
-}
-
-proc parse_tarball_name {v} {
-    set version &quot;&quot;
-    set tag_prefix &quot;&quot;
-
-    if {[regexp {[0-9]+([.-][0-9]+)+} $v version]} {
-        if {[string length $version] &lt; [string length $v]} {
-            set tag_prefix [string range $v 0 [expr [string first $version $v] -1]]
-        }
-    }
-    return [list $version $tag_prefix]
-}
-
-proc parse_bitbucket_url {url} {
-    array set urlparts [uri::split $url]
-
-    if {![string equal $urlparts(host) bitbucket.org]} {
-        return -code error \
-            &quot;expected bitbucket url but got \&quot;$url\&quot;&quot;
-    }
-
-    set path [split $urlparts(path) /]
-    set author [lindex $path 0]
-    set project [lindex $path 1]
-    set tarball [lindex $path end]
-
-    return [concat $author $project [parse_tarball_name $tarball]]
-}
-
-if {$argc != 1} {
-    usage
-    exit 1
-}
-
-set url [lindex $argv 0]
-set tmp [parse_bitbucket_url $url]
-
-set author     [val_or_def [lindex $tmp 0] &quot;author&quot;]
-set project    [val_or_def [lindex $tmp 1] &quot;project&quot;]
-set version    [val_or_def [lindex $tmp 2] &quot;version&quot;]
-set tag_prefix [val_or_def [lindex $tmp 3] &quot;tag_prefix&quot;]
-
-puts &quot;# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4&quot;
-puts &quot;# \$Id\$&quot;
-puts &quot;&quot;
-puts &quot;PortSystem          1.0&quot;
-
-puts &quot;PortGroup           bitbucket 1.0&quot;
-puts &quot;&quot;
-puts &quot;bitbucket.setup     ${author} ${project} ${version} ${tag_prefix}&quot;
-
-puts &quot;categories          replaceme&quot;
-puts &quot;platforms           darwin&quot;
-
-set maintainers &quot;replaceme&quot;
-
-if {[info exist env(EMAIL)]} {
-    set maintainers $env(EMAIL)
-}
-
-puts &quot;maintainers         $maintainers&quot;
-
-puts &quot;license             replaceme&quot;
-
-puts &quot;&quot;
-puts &quot;description         replaceme&quot;
-puts &quot;long_description    replaceme&quot;
-puts &quot;&quot;
-
-puts &quot;&quot;
-puts &quot;checksums           rmd160  12345 \\&quot;
-puts &quot;                    sha256  6789a&quot;
</del></span></pre></div>
<a id="branchesgsoc15portfilegithub2portgithub2port"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/github2port/github2port (137933 => 137934)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/github2port/github2port        2015-06-23 10:30:09 UTC (rev 137933)
+++ branches/gsoc15-portfile/github2port/github2port        2015-06-23 10:39:00 UTC (rev 137934)
</span><span class="lines">@@ -8,14 +8,14 @@
</span><span class="cx"> 
</span><span class="cx"> proc usage {{channel stderr}} {
</span><span class="cx">     global argv0
</span><del>-    puts $channel &quot;Usage: $argv0 URL&quot;
</del><ins>+    puts $channel &quot;Usage: $argv0 \[-github|-bitbucket &lt;URL&gt;\]&quot;
</ins><span class="cx">     puts $channel &quot;&quot;
</span><del>-    puts $channel &quot;URL is the github tarball or project URL&quot;
</del><ins>+    puts $channel &quot;URL is the github/bitbucket tarball or project URL&quot;
</ins><span class="cx">     puts $channel &quot;&quot;
</span><span class="cx">     puts $channel &quot;Example:&quot;
</span><del>-    puts $channel &quot;  $argv0 https://github.com/tmux/tmux&quot;
-    puts $channel &quot;  $argv0 https://github.com/tmux/tmux/releases/download/2.0/tmux-2.0.tar.gz&quot;
-    puts $channel &quot;  $argv0 https://github.com/jonas/tig/archive/tig-2.1.1.tar.gz&quot;
</del><ins>+    puts $channel &quot;  $argv0 -github https://github.com/tmux/tmux&quot;
+    puts $channel &quot;  $argv0 -github https://github.com/tmux/tmux/releases/download/2.0/tmux-2.0.tar.gz&quot;
+    puts $channel &quot;  $argv0 -bitbucket https://bitbucket.org/sshguard/sshguard&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc val_or_def {val def} {
</span><span class="lines">@@ -52,6 +52,22 @@
</span><span class="cx">     return [concat $author $project [parse_tarball_name $tarball] $tarball_from]
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+proc parse_bitbucket_url {url} {
+    array set urlparts [uri::split $url]
+
+    if {![string equal $urlparts(host) bitbucket.org]} {
+        return -code error \
+            &quot;expected bitbucket url but got \&quot;$url\&quot;&quot;
+    }
+
+    set path [split $urlparts(path) /]
+    set author [lindex $path 0]
+    set project [lindex $path 1]
+    set tarball [lindex $path end]
+
+    return [concat $author $project [parse_tarball_name $tarball]]
+}
+
</ins><span class="cx"> proc request_github {author project} {
</span><span class="cx">     set json &quot;/tmp/${author}-${project}.json&quot;
</span><span class="cx">     set api &quot;https://api.github.com/repos/${author}/${project}&quot;
</span><span class="lines">@@ -73,31 +89,59 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if {$argc != 1} {
-    usage
-    exit 1
-}
</del><ins>+set PortGroup &quot;&quot;
</ins><span class="cx"> 
</span><del>-set url [lindex $argv 0]
-set tmp [parse_github_url $url]
</del><ins>+set author author
+set project project
+set version version
+set tag_prefix tag_prefix
</ins><span class="cx"> 
</span><del>-set author        [val_or_def [lindex $tmp 0] &quot;author&quot;]
-set project       [val_or_def [lindex $tmp 1] &quot;project&quot;]
-set version       [val_or_def [lindex $tmp 2] &quot;version&quot;]
-set tag_prefix    [val_or_def [lindex $tmp 3] &quot;tag_prefix&quot;]
-set tarball_from  [val_or_def [lindex $tmp 4] &quot;&quot;]
</del><ins>+set tarball_from &quot;&quot;
</ins><span class="cx"> 
</span><span class="cx"> set description replaceme
</span><span class="cx"> set homepage &quot;&quot;
</span><span class="cx"> 
</span><del>-# request_github
</del><ins>+if {$argc != 2} {
+    usage ; exit 1
+} else {
+    if {[string equal [lindex $argv 0] &quot;-github&quot;]} {
+        set PortGroup &quot;github 1.0&quot;
</ins><span class="cx"> 
</span><ins>+        set url [lindex $argv 1]
+        set tmp [parse_github_url $url]
+
+        set author        [val_or_def [lindex $tmp 0] &quot;author&quot;]
+        set project       [val_or_def [lindex $tmp 1] &quot;project&quot;]
+        set version       [val_or_def [lindex $tmp 2] &quot;version&quot;]
+        set tag_prefix    [val_or_def [lindex $tmp 3] &quot;tag_prefix&quot;]
+        set tarball_from  [val_or_def [lindex $tmp 4] &quot;&quot;]
+
+        set description replaceme
+        set homepage &quot;&quot;
+
+        # request_github
+
+    } elseif {[string equal [lindex $argv 0] &quot;-bitbucket&quot;]} {
+        set PortGroup &quot;bitbucket 1.0&quot;
+
+        set url [lindex $argv 1]
+        set tmp [parse_bitbucket_url $url]
+
+        set author     [val_or_def [lindex $tmp 0] &quot;author&quot;]
+        set project    [val_or_def [lindex $tmp 1] &quot;project&quot;]
+        set version    [val_or_def [lindex $tmp 2] &quot;version&quot;]
+        set tag_prefix [val_or_def [lindex $tmp 3] &quot;tag_prefix&quot;]
+    } else {
+        usage ; exit 1
+    }
+}
+
</ins><span class="cx"> puts &quot;# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4&quot;
</span><span class="cx"> puts &quot;# \$Id\$&quot;
</span><span class="cx"> puts &quot;&quot;
</span><span class="cx"> puts &quot;PortSystem          1.0&quot;
</span><span class="cx"> 
</span><del>-puts &quot;PortGroup           github 1.0&quot;
</del><ins>+puts &quot;PortGroup           ${PortGroup}&quot;
</ins><span class="cx"> puts &quot;&quot;
</span><span class="cx"> puts &quot;github.setup        ${author} ${project} ${version} ${tag_prefix}&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesgsoc15portfileportcreate"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/port-create (137933 => 137934)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/port-create        2015-06-23 10:30:09 UTC (rev 137933)
+++ branches/gsoc15-portfile/port-create        2015-06-23 10:39:00 UTC (rev 137934)
</span><span class="lines">@@ -38,10 +38,10 @@
</span><span class="cx"> proc get_group {group argv} {
</span><span class="cx">     switch $group {
</span><span class="cx">         github {
</span><del>-            puts [exec github2port/github2port {*}$argv]
</del><ins>+            puts [exec github2port/github2port -github {*}$argv]
</ins><span class="cx">         }
</span><span class="cx">         bitbucket {
</span><del>-            puts [exec github2port/bitbucket2port {*}$argv]
</del><ins>+            puts [exec github2port/github2port -bitbucket {*}$argv]
</ins><span class="cx">         }
</span><span class="cx">         default {
</span><span class="cx">             puts [exec portfile-gen/portfile-gen -g $group {*}$argv]
</span></span></pre>
</div>
</div>

</body>
</html>