macports / macports-webapp

Web application to display information about ports, build history and installation statistics
https://ports.macports.org/
BSD 2-Clause "Simplified" License
53 stars 25 forks source link

Changes in port name capitalization are not reflected on web site #367

Open ryandesign opened 8 months ago

ryandesign commented 8 months ago

The web app shows a port named speexDSP. There used to be a port named speexDSP but it was removed and a new port named speexdsp was created. The ports web site should reflect the change in capitalization because although MacPorts is documented to handle port names case insensitively, there are some bugs where it does not do so.

If the ports web site usually handles this correctly, maybe the reason why it did not do so here is that the new speexdsp port was added first, creating a duplicate port. Later, the original speexDSP port was deleted.

arjunsalyan commented 7 months ago

As far as I can remember, while designing the port add/update logic, it was assumed that port names will be unique (case-insensitive).

Here is how the current logic would behave for the given situation: When the speexdsp port was added (creating a duplicate), the site would have basically just overridden all the parameters of the existing port speexDSP with those from the newer one, but would not update the port name. And the same behaviour would carry on even after the old port was deleted. Never in this process the site would treat speexdsp and speexDSP as two separate ports.

The bugs mentioned probably got overlooked when deciding the above.

It would be quite some work to change this behaviour across the website. But one quick Action Item I can think of is to also update the port name when updating ports, so that case changes in name are taken care of.

ryandesign commented 7 months ago

it was assumed that port names will be unique (case-insensitive).

MacPorts does intend to treat port names case-insensitively, and they are supposed to be unique. The web app should treat port names case-insensitively and the name should be a unique key. However, it is inevitable that, from time to time, someone will make a mistake and commit a duplicate port (with matching case or not). While that duplicate port exists, of course I would expect the web app to only contain information about one of them. The issue might get resolved by removing the original port as happened with speexDSP, or the new duplicate port might get deleted. Whichever resolution, it would be nice if the web app would end up containing the information of the port that remains.

But one quick Action Item I can think of is to also update the port name when updating ports, so that case changes in name are taken care of.

Yes that should be done. Port name case changes have happened before too.

nilason commented 6 months ago

I have the same issue with pdal, after a renaming it to lowercase.

I noticed also that the web livecheck doesn't detect updates, while port livecheck pdal does. So this could possibly be related.