Page MenuHomeFreeBSD

Incorporate a search mechanism for PORTSDIR.
ClosedPublic

Authored by will on Sep 18 2014, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 8:29 AM
Unknown Object (File)
Jan 15 2024, 7:45 AM
Unknown Object (File)
Jan 15 2024, 6:34 AM
Unknown Object (File)
Dec 19 2023, 10:36 PM
Unknown Object (File)
Dec 10 2023, 10:54 AM
Unknown Object (File)
Sep 6 2023, 12:58 AM
Unknown Object (File)
Aug 27 2023, 1:57 PM
Unknown Object (File)
Aug 6 2023, 10:48 AM
Subscribers
None

Details

Reviewers
bapt
bdrewery
Summary

Instead of requiring the user to specify where their ports tree root is,
search for Mk/bsd.port.mk starting from the current directory. This will
still default to /usr/ports, and allow the user to override.

Test Plan

Apply diff, use a ports tree not in /usr/ports without specifying PORTSDIR,
and see that the correct Mk files are used. Also test the previously
supported cases, they should not be affected.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will retitled this revision from to Incorporate a search mechanism for PORTSDIR..
will updated this object.
will edited the test plan for this revision. (Show Details)
will added reviewers: bdrewery, bapt.

The same should be applied to bsd.port.subdir.mk

will edited edge metadata.

Version with bsd.port.subdir.mk also adjusted.

I could change this to use make conditionals instead and to explicitly check only .. and ../.. since those are the only reasonable cases really supported by ports right now.

share/mk/bsd.port.mk
5

At least use $${PWD} here.

share/mk/bsd.port.mk
7

Perhaps to avoid POLA this should say "Using $$curdir for PORTSDIR" to stderr.

will edited edge metadata.

Updated version that doesn't use a shell callout.

This will only search up 2 levels at most. It also (on top of my comment)
searches the current directory, which is required because ports/Makefile
includes <bsd.port.subdir.mk>.

Tested both with and without an existing /usr/ports.

Updated with a comment and ../../.. check in case ports grows a third level.

bapt edited edge metadata.
This revision is now accepted and ready to land.Sep 26 2014, 9:26 PM