Bug 285040 - Mk/bsd.port.mk: expansion of INDEX to include flavor setting (impacted by portsnap)
Summary: Mk/bsd.port.mk: expansion of INDEX to include flavor setting (impacted by por...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-25 19:08 UTC by John Marino
Modified: 2025-05-26 13:10 UTC (History)
2 users (show)

See Also:


Attachments
Appends flavor column to end of INDEX (788 bytes, patch)
2025-02-25 19:08 UTC, John Marino
no flags Details | Diff
Appends flavor column to end of INDEX (794 bytes, patch)
2025-02-25 23:47 UTC, Mark Linimon
no flags Details | Diff
Appends flavor column to end of INDEX (789 bytes, patch)
2025-02-25 23:48 UTC, Mark Linimon
no flags Details | Diff
Appends flavor column to end of INDEX (805 bytes, patch)
2025-03-16 15:57 UTC, Mark Linimon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2025-02-25 19:08:53 UTC
Created attachment 257937 [details]
Appends flavor column to end of INDEX

I recently brought up a proposal to extend the number of columns in the index[1].  The referenced post explains the rationale and the benefit of doing so, but essentially when flavors were introduced into FreeBSD ports, a new column should have been added to the index to list the flavor used on the package.  The patch to accomplish this is simple and attached.

However, back in 2011 there was another request[2] to expand the index to add license information and it was revealed that the portsnap index maker would break if the index is expanded.  A consumer of the index should not put restrictions on the index's future evolution, but that is the situation here.  I've checked the src tree (portsnap home for FreeBSD release 13 and earlier) and the ports tree, and it seems like the proposed fix for portsnap's index maker (to ignore any columns after the 13th column) was never done.

Due to the importance and prevalence of portsnap, no expansion of the index can occur until the ports-mgmt/portsnap is modified and FreeBSD 13 is EOL.

I propose that the restriction portsnap's index generator is causing be removed soon.  I think the attached patch could be modified such that the index remains the same on FreeBSD release 13.x and that index includes the flavor column on FreeBSD 14 and later, thus preventing any breakage to portsnap.  The wiki page on the INDEX would also need to be updated[3].

The original bug report [2] also proposed changes to Mk/bsd.port.subdir.mk and Tools/make_index files.  I'm not sure at this time if similar changes are need for this proposal.

What do people think?
John

[1] https://lists.freebsd.org/archives/freebsd-ports/2025-February/007347.html
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=159946
[3] https://wiki.freebsd.org/Ports/INDEX#:~:text=An%20index%20file%20can%20either,by%20the%20make%20describe%20command
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2025-02-25 23:47:10 UTC
Created attachment 257968 [details]
Appends flavor column to end of INDEX

^Triage: rebase patch.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2025-02-25 23:48:43 UTC
Created attachment 257969 [details]
Appends flavor column to end of INDEX

^Triage: try once again to rebase patch.
Comment 3 John Marino 2025-03-07 19:09:21 UTC
Could Colin or someone else work on modifying portsnap so that it won't malfunction when the index has more than 13 columns?

Does that need a separate bug report to track?

If people want, I could try the modification but I don't think I'm the best choice for that.
Comment 4 John Marino 2025-03-07 19:10:50 UTC
To be clear, I'm talking about modifying ports-mgmt/portsnap, not the version in FreeBSD 13 base.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2025-03-16 15:57:38 UTC
Created attachment 258733 [details]
Appends flavor column to end of INDEX

^Triage: rebase patch, take 2.
Comment 6 John Marino 2025-05-26 13:10:54 UTC
I imported portsnap v1.1 into a github repository, then applied all it's current patches.  If somebody wants to switch ports-mgmt/portsnap to that repo and remove all the patches, they can:

https://github.com/jrmarino/portsnap/releases/tag/v1.1

The next commit removes the 13-column limitation:

https://github.com/jrmarino/portsnap/commit/5a10a59a81f9d17f0473d5dfe25844f180255443

But it turns it that this may not help synth users that much.
I thought using portsnap resulted in a fresh INDEX file every update and from my experimentation, that doesn't seem to be true.

However, if this patch removes the 13-field limitation on the index file, I still think it's worth applying to ports-mgmt/portsnap.