Testing a modified portgroup

Austin Ziegler halostatue at gmail.com
Mon Feb 5 03:58:21 UTC 2024


I think I have found a bug in the golang portgroup, and I think I have an
idea on how to fix it, but I'm not sure how to test such a modification.

For those interested, it's in go._translate_package_id. If I have a
package ID
github.com/jmespath/go-jmespath/internal/testify, the *subproject* is
internal/testify, not internal. But the line `set subproject [lindex
${parts} 3]` will *only* grab `internal`.

So this:

```tcl
    set parts [split ${package_id} /]

    set domain [lindex ${parts} 0]
    set author [lindex ${parts} 1]
    set project [lindex ${parts} 2]
    # possibly empty
    set subproject [lindex ${parts} 3]
```

Should probably be this:

```tcl
set parts [split $package_id /]

set domain [lindex $parts 0]
set author [lindex $parts 1]
set project [lindex $parts 2]
# Join the remaining parts to get the full subproject path
if {[llength $parts] > 3} {
    set subproject [join [lrange $parts 3 end] /]
} else {
    set subproject ""
}
```

-a
-- 
Austin Ziegler • halostatue at gmail.comaustin at halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20240204/6cf894d8/attachment.htm>


More information about the macports-dev mailing list