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:
Responsible Changed From-To: freebsd-ports-bugs->portmgr bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool)
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
State Changed From-To: open->feedback Waiting for feedback.
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
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
State Changed From-To: feedback->open feedback received
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
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
State Changed From-To: feedback->open Feedback received.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190454
Sorry, bad paste. should have been Infrastructure PR.
I do think this patch is not needed anymore is it?
Hi Baptiste. It is quite old now so I don't think so :p