<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/8ab73db6de508336f30f1f09886c397d46d97477">https://github.com/macports/macports-ports/commit/8ab73db6de508336f30f1f09886c397d46d97477</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 8ab73db6de508336f30f1f09886c397d46d97477
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Tue Feb 8 02:27:03 2022 +0100
<span style='display:block; white-space:pre;color:#404040;'> golang-1.0: Do not fail when pkgs conflict on prefix
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> A port that has both gopkg.in/src-d/go-git.v4 and
</span><span style='display:block; white-space:pre;color:#404040;'> gopkg.in/src-d/go-git-fixtures.v3 in its go.vendors would previously
</span><span style='display:block; white-space:pre;color:#404040;'> fail, because no sha1_short was given for such ports, and src-d-go-git
</span><span style='display:block; white-space:pre;color:#404040;'> is a prefix of src-d-go-git-fixtures. This caused the glob expression in
</span><span style='display:block; white-space:pre;color:#404040;'> the post-extract to match both folders, move both folders, and then fail
</span><span style='display:block; white-space:pre;color:#404040;'> when processing the second package.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Resolve this by only choosing the match from the glob expression that
</span><span style='display:block; white-space:pre;color:#404040;'> does not contain dashes in the part that matched the wildcard.
</span>---
_resources/port1.0/group/golang-1.0.tcl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/golang-1.0.tcl b/_resources/port1.0/group/golang-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index ff889399ec5..3d633d57293 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/golang-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/golang-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -355,13 +355,27 @@ post-extract {
</span>
foreach vlist ${go.vendors_internal} {
lassign ${vlist} sha1_short vpackage vresolved
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "Processing vendored dependency (sha1_short: ${sha1_short}, vpackage: ${vpackage}, vresolved: ${vresolved})"
</span>
file mkdir ${gopath}/src/[file dirname ${vpackage}]
if {${sha1_short} ne ""} {
move [glob ${workpath}/*-${sha1_short}*] ${gopath}/src/${vpackage}
} else {
lassign [go._translate_package_id ${vresolved}] _ vauthor vproject
<span style='display:block; white-space:pre;background:#ffe0e0;'>- move [glob ${workpath}/${vauthor}-${vproject}-*] ${gopath}/src/${vpackage}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # In some cases, this can match multiple folders, e.g.,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # gopkg.in/src-d/go-git.v4 and gopkg.in/src-d/go-git-fixtures.v3.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # We want the one that does not have any dashes in the wildcard of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # our glob expression, so use regex to identify that.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set candidates [glob ${workpath}/${vauthor}-${vproject}-*]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach candidate $candidates {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[regexp -nocase "^[quotemeta $workpath]/[quotemeta $vauthor]-[quotemeta $vproject]-\[^-\]*$" $candidate]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "Choosing $candidate for ${workpath}/${vauthor}-${vproject}-*"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ move $candidate ${gopath}/src/${vpackage}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "Rejecting $candidate for ${workpath}/${vauthor}-${vproject}-* because it contains dashes in the wildcard match"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
}
}
</pre><pre style='margin:0'>
</pre>