Bug 152804 - [patch] Add USE_SRC and ONLY_FOR_*VER to bsd.port.mk
Summary: [patch] Add USE_SRC and ONLY_FOR_*VER to bsd.port.mk
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 13:40 UTC by Ganael LAPLANCHE
Modified: 2019-09-05 20:21 UTC (History)
0 users

See Also:


Attachments
file.diff (2.56 KB, patch)
2010-12-03 13:40 UTC, Ganael LAPLANCHE
no flags Details | Diff
patch-OSVER.txt (4.00 KB, patch)
2011-05-09 08:01 UTC, Ganael LAPLANCHE
no flags Details | Diff
patch-OSVER.txt (4.03 KB, patch)
2011-08-24 07:36 UTC, Ganael LAPLANCHE
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ganael LAPLANCHE freebsd_committer freebsd_triage 2010-12-03 13:40:09 UTC
As proposed on ports@, here is a patch that provides a check for the presence of kernel sources when building a port. This check can be activated by defining :

- USE_SRC : to be set to "yes" or a space-separated list of files to check under ${SRC_BASE}
- SRC_BASE : by default /usr/src if ${USE_SRC} is set

A standard message is then displayed if kernel sources are missing.

Several ports that check for the presence of kernel sources also often check for a specific version of FreeBSD, so the patch also provides :

ONLY_FOR_MINVER / ONLY_FOR_MINVER_REASON : the minimal version of
FreeBSD required to build the port, and a given reason (if any)

ONLY_FOR_MAXVER / ONLY_FOR_MAXVER_REASON : the maximal version of
FreeBSD required to build the port, and a given reason (if any)

Those variables will help us avoid duplicating the same kind of checks
again and again in our ports tree, as well as providing standard error messages.

Finally, find here :

http://people.freebsd.org/~martymac/patches/20101203-patch-uhso-kmod.txt

an example that shows how those variables could be used
(comms/uhso-kmod). Note that in this example, a change of behaviour is
introduced : the port will now refuse to build if OSVERSION > 800500,
while it was only displaying a warning in the previous version. This
patch to hso-kmod is *not* to be committed, but just a showcase.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-12-03 13:40:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool)
Comment 2 Florent Thoumie 2011-05-05 13:49:56 UTC
I like the concept but not the implementation.

How about something like:

- ONLY_FOR_OSVER: that takes as argument "700000+", "699999-" or
"600000-699999" (or a combination of them).
- ONLY_FOR_OSVER_REASON: same as yours, except you make it fit in only
one variable.

That makes the code slightly more complicated but also much more flexible.

-- 
Florent Thoumie
flz@FreeBSD.org
FreeBSD Committer
Comment 3 Florent Thoumie freebsd_committer freebsd_triage 2011-05-05 13:50:34 UTC
State Changed
From-To: open->feedback

Waiting for feedback.
Comment 4 Ganael LAPLANCHE freebsd_committer freebsd_triage 2011-05-06 00:24:24 UTC
On Thu, 5 May 2011 13:49:56 +0100, Florent Thoumie wrote

Hi Florent,

> How about something like:
> 
> - ONLY_FOR_OSVER: that takes as argument "700000+", "699999-" 
> or "600000-699999" (or a combination of them). - 
> ONLY_FOR_OSVER_REASON: same as yours, except you make it fit 
> in only one variable.
> 
> That makes the code slightly more complicated but also much 
> more flexible.

Good idea :) I've started to think about that and I'll follow up with an
updated patch ASAP.

Best regards,

--
Ganael LAPLANCHE <ganael.laplanche@martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org
Comment 5 Ganael LAPLANCHE freebsd_committer freebsd_triage 2011-05-09 08:01:30 UTC
On Fri,  6 May 2011 01:24:24 +0200 (CEST), Ganael LAPLANCHE wrote

Hi Florent,

> Good idea :) I've started to think about that and I'll follow 
> up with an updated patch ASAP.

Here is finally a new version of the patch.

Best regards,

--
Ganael LAPLANCHE <ganael.laplanche@martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2011-08-02 03:28:37 UTC
State Changed
From-To: feedback->open

feedback received
Comment 7 Baptiste Daroussin freebsd_committer freebsd_triage 2011-08-02 08:44:19 UTC
State Changed
From-To: open->feedback

I like the idea, however 2 points here, when using USE_SRC it will be 
great that is check the sources version it be sure it is in sync with 
the OSVERSION defined, combining ONLY_FOR_OSVER with something that auto 
deprecate and expire the ports when the max supported version is EOL 
will be geat. That would require a new macro let say 
(MIN_OSVERSION_SUPPORTED?) to allow the check. With this we would never 
forget to remove expired ports
Comment 8 Ganael LAPLANCHE freebsd_committer freebsd_triage 2011-08-24 07:36:44 UTC
On Tue, 2 Aug 2011 07:44:20 GMT, bapt wrote

Hi Baptiste,

> I like the idea, however 2 points here, when using USE_SRC it will be
great
> that is check the sources version it be sure it is in sync with the
OSVERSION
> defined,

As discussed with you yesterday, here is an updated version of the patch
resolving this first point.  I have also removed SRC_BASE
initialization, which
has been added meanwhile in bsd.ports.mk.

> combining ONLY_FOR_OSVER with something that auto deprecate and expire the
> ports when the max supported version is EOL will be geat. That would
require a
> new macro let say (MIN_OSVERSION_SUPPORTED?) to allow the check. With
this we
> would never forget to remove expired ports

This second idea is good. Anyway, not sure it could be implemented easily as
some earlier releases are supported longer than newer ones, and I am not
sure
whether we have a mechanism to tell if a specific release is still
supported or
not... ? It could be a future improvement of this patch.

Best regards,

--
Ganael LAPLANCHE <ganael.laplanche@martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org
Comment 9 Ganael LAPLANCHE freebsd_committer freebsd_triage 2012-02-01 12:10:40 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 11 Mark Linimon freebsd_committer freebsd_triage 2014-06-02 03:10:34 UTC
Sorry, bad paste.  should have been Infrastructure PR.
Comment 12 Baptiste Daroussin freebsd_committer freebsd_triage 2019-09-04 13:36:42 UTC
I do think this patch is not needed anymore is it?
Comment 13 Ganael LAPLANCHE freebsd_committer freebsd_triage 2019-09-05 20:21:46 UTC
Hi Baptiste. It is quite old now so I don't think so :p