Page MenuHomeFreeBSD

Mk/bsd.port.mk: Override Uses/*.Mk with overlays
Needs ReviewPublic

Authored by bofh on Mar 18 2024, 3:39 PM.
Referenced Files
Unknown Object (File)
Oct 4 2024, 6:43 AM
Unknown Object (File)
Oct 3 2024, 9:55 PM
Unknown Object (File)
Sep 29 2024, 7:42 PM
Unknown Object (File)
Sep 24 2024, 11:12 AM
Unknown Object (File)
Sep 22 2024, 5:36 AM
Unknown Object (File)
Sep 14 2024, 10:07 PM
Unknown Object (File)
Sep 11 2024, 3:56 PM
Unknown Object (File)
Sep 11 2024, 10:22 AM
Subscribers

Details

Reviewers
arrowd
Group Reviewers
portmgr
Summary

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/php.mk using ${OVERLAYS}/MkUses/php.mk 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/php.mk 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

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bofh requested review of this revision.Mar 18 2024, 3:39 PM
bofh created this revision.
arrowd added inline comments.
Mk/bsd.port.mk
1489

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

Mk/bsd.port.mk
1489

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/bsd.port.mk: Override USES/*.Mk with overlays to Mk/bsd.port.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
Mk/bsd.port.mk
1489

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

1994

Same here, OVERLAYS can have more than one entry.

Mk/bsd.port.mk
1489

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