<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-contrib.
</pre>
<p><a href="https://github.com/macports/macports-contrib/commit/045dcb3883173934d6e583f56b1ade8885cde3f0">https://github.com/macports/macports-contrib/commit/045dcb3883173934d6e583f56b1ade8885cde3f0</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 045dcb3883173934d6e583f56b1ade8885cde3f0
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Jul 11 09:23:56 2019 +1000
<span style='display:block; white-space:pre;color:#404040;'> portindex2json: handle unobfuscated maintainer emails
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This is allowed even if it's discouraged.
</span>---
portindex2json/portindex2json.tcl | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/portindex2json/portindex2json.tcl b/portindex2json/portindex2json.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 6ddd257..338ac93 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/portindex2json/portindex2json.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/portindex2json/portindex2json.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,9 +25,17 @@ proc tcl2json_list {tcl_list} {
</span>
proc get_maintainer_array {maintainer} {
foreach entry $maintainer {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[string first @ $entry] != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set first_at [string first @ $entry]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$first_at == 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # @foo = github handle 'foo'
</span> set maintainer_array(github) [::json::write string [string trimleft $entry @]]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$first_at != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # unobfuscated email address
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set email_list [split $entry @]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set email(name) [::json::write string [lindex $email_list 0]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set email(domain) [::json::write string [lindex $email_list 1]]
</span> } else {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # obfuscated email address
</span> if {[string first : $entry] != -1} {
set email_list [split $entry :]
set email(name) [::json::write string [lindex $email_list 1]]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -36,10 +44,11 @@ proc get_maintainer_array {maintainer} {
</span> set email(name) [::json::write string $entry]
set email(domain) [::json::write string "macports.org"]
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set email_subobject [::json::write object {*}[array get email]]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set maintainer_array(email) $email_subobject
</span> }
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[array exists email]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set maintainer_array(email) [::json::write object {*}[array get email]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> return [array get maintainer_array]
}
</pre><pre style='margin:0'>
</pre>