amake / go2port

A tool for generating MacPorts portfiles for Go projects
BSD 3-Clause "New" or "Revised" License
7 stars 7 forks source link

go2port update does not add dependencies #6

Open jasperweiss opened 3 years ago

jasperweiss commented 3 years ago

I used go2port to update an existing portfile (see this commit for the resulting changes) But apparently it does not ~update the go.vendors part~ add the go.vendors part if it's not already there. For that I had to go2port get a new portfile and copy over the go.vendors part manually. I'd be great if the dependencies were ~also recomputed~ added when updating a portfile.

Edit: the issue seems to be that there was no go.vendors part in the first place so there's nothing to update there. Just adding go.vendors to the file and running go2port update again solves the problem. I'm not sure if this is intentional behaviour but otherwise it should perhaps add the go.vendors part if it's not there yet.

amake commented 3 years ago

The update-in-place functionality is very rudimentary and, as you found, only works when there is an existing string to replace.

The feature works as intended for the use cases I envisioned, and I did not envision your use case, but I think it's a valid one.

(To be clear I am not intending to work on this, but I would definitely accept a patch that handles this use case.)