Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2006 13:06:03 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 99805 for review
Message-ID:  <200606221306.k5MD635X064404@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99805

Change 99805 by gabor@spitfire on 2006/06/22 13:05:50

	Try to get OSVERSION from userland if possible, since userland
	has more impact on the ports as kernel does and this approach also
	fixes issues when we have a kernel and a jail with different
	OSVERSIONs and issues with DESTDIR.  If getting OSVERSION from
	userland is impossible it is still got from the kernel.

Affected files ...

.. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#4 edit

Differences ...

==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#4 (text+ko) ====

@@ -1137,13 +1137,18 @@
 OSREL!=	${UNAME} -r | ${SED} -e 's/[-(].*//'
 .endif
 
-### FIXME: OSVERSION in DESTDIR and in jail
-
 # Get __FreeBSD_version
 .if !defined(OSVERSION)
-OSVERSION!=	${SYSCTL} -n kern.osreldate
+.if exists(${DESTDIR}/usr/include/sys/param.h)
+OSVERSION!=     ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/include/sys/param.h
+.elif exists(${DESTDIR}/usr/src/sys/sys/param.h)
+OSVERSION!=     ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/src/sys/sys/param.h
+.else
+OSVERSION!=     /sbin/sysctl -n kern.osreldate
+.endif
 .endif
 
+
 # Get the object format.
 .if !defined(PORTOBJFORMAT)
 PORTOBJFORMAT!=		${TEST} -x /usr/bin/objformat && /usr/bin/objformat || ${ECHO_CMD} aout



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606221306.k5MD635X064404>