<div dir="ltr">Thank you!<div><br></div><div>I haven't yet tried it with any currently existing (unaffected) versions, but it is already substantially more promising. I think that I have a few more changes, but I will look at submitting a PR once I have finished testing.</div><div><br></div><div>-a</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 4, 2024 at 11:13 PM Joshua Root <<a href="mailto:jmr@macports.org">jmr@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On 5/2/2024 14:58, Austin Ziegler wrote:<br>
> I think I have found a bug in the golang portgroup, and I think I have <br>
> an idea on how to fix it, but I'm not sure how to test such a modification.<br>
<br>
You'd make the change in your local copy of the ports tree and check <br>
that a port affected by the bug now works correctly, and that some <br>
existing ports still work correctly.<br>
<br>
> For those interested, it's in go._translate_package_id. If I have a <br>
> package ID <a href="http://github.com/jmespath/go-jmespath/internal/testify" rel="noreferrer" target="_blank">github.com/jmespath/go-jmespath/internal/testify</a> <br>
> <<a href="http://github.com/jmespath/go-jmespath/internal/testify" rel="noreferrer" target="_blank">http://github.com/jmespath/go-jmespath/internal/testify</a>>, the <br>
> *subproject* is internal/testify, not internal. But the line `set <br>
> subproject [lindex ${parts} 3]` will *only* grab `internal`.<br>
> <br>
> So this:<br>
> <br>
> ```tcl<br>
> set parts [split ${package_id} /]<br>
> <br>
> set domain [lindex ${parts} 0]<br>
> set author [lindex ${parts} 1]<br>
> set project [lindex ${parts} 2]<br>
> # possibly empty<br>
> set subproject [lindex ${parts} 3]<br>
> ```<br>
> <br>
> Should probably be this:<br>
> <br>
> ```tcl<br>
> set parts [split $package_id /]<br>
> <br>
> set domain [lindex $parts 0]<br>
> set author [lindex $parts 1]<br>
> set project [lindex $parts 2]<br>
> # Join the remaining parts to get the full subproject path<br>
> if {[llength $parts] > 3} {<br>
> set subproject [join [lrange $parts 3 end] /]<br>
> } else {<br>
> set subproject ""<br>
> }<br>
> ```<br>
<br>
This could be simplified further to something like:<br>
<br>
set parts [split $package_id /]<br>
set remaining_parts [lassign $parts domain author project]<br>
set subproject [join $remaining_parts /]<br>
<br>
- Josh<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Austin Ziegler • <a href="mailto:halostatue@gmail.com" target="_blank">halostatue@gmail.com</a> • <a href="mailto:austin@halostatue.ca" target="_blank">austin@halostatue.ca</a><br><a href="http://www.halostatue.ca/" target="_blank">http://www.halostatue.ca/</a> • <a href="http://twitter.com/halostatue" target="_blank">http://twitter.com/halostatue</a></div>