Page MenuHomeFreeBSD

Mk/ Override Uses/*.Mk with overlays
Needs ReviewPublic

Authored by bofh on Mar 18 2024, 3:39 PM.
Referenced Files
F86261914: D44410.diff
Mon, Jun 17, 7:22 PM
Unknown Object (File)
Wed, May 29, 7:57 AM
Unknown Object (File)
May 9 2024, 7:01 PM
Unknown Object (File)
May 9 2024, 3:37 PM
Unknown Object (File)
May 4 2024, 1:23 PM
Unknown Object (File)
May 4 2024, 8:21 AM
Unknown Object (File)
Apr 26 2024, 4:19 AM
Unknown Object (File)
Apr 14 2024, 5:48 PM


Group Reviewers

Although at first glance it seems that with the code it is easy to override Mk/Uses/*.mk with something from ${OVERLAYS}/k/Uses/*.mk practically it is not possible with the current code. For example if we want to override something from the Mk/Uses/ using ${OVERLAYS}/MkUses/ it is not possible with the current code as both files are included with the for loop and it actually overrides with the original Mk/Uses/ as USESDIR takes place in a later order.

This patch at first tries to find whether if there is a file named ${OVERLAYS}/Mk/Uses/*.mk. If not it falls back to ${USESDIR}/Mk/Uses/*.mk. And if not found as usual it throws the error Unknown USES=.

Diff Detail

R11 FreeBSD ports repository
Lint Skipped
Tests Skipped

Event Timeline

bofh requested review of this revision.Mar 18 2024, 3:39 PM
bofh created this revision.
arrowd added inline comments.

_usefound would be never defined there? It is undefed in the previos line.


I know that. But there must have been some history behind this. Look at the left side where it was checked in the previous.

LGTM, but I didn't run-test this, as I don't use overlays.

This revision is now accepted and ready to land.Mar 18 2024, 4:12 PM
bofh retitled this revision from Mk/ Override USES/*.Mk with overlays to Mk/ Override Uses/*.Mk with overlays.Mar 18 2024, 9:53 PM

Can you re-upload the diff with arcanist or by generating the diff with more context, like arcanist does (git diff -U9999)

Update diff with more context

This revision now requires review to proceed.Mar 19 2024, 5:45 PM

Does that work if there is more than one directory in OVERLAYS ? (OVERLAYS is plural)


Same here, OVERLAYS can have more than one entry.


Oh damn. I never knew that. Let me rework.