Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136694274
D869.id1832.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D869.id1832.diff
View Options
Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk
+++ Mk/bsd.port.mk
@@ -1186,10 +1186,10 @@
OPSYS!= ${UNAME} -s
.endif
+UNAMER!=${UNAME} -r
+
# Get the operating system revision
-.if !defined(OSREL)
-OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//'
-.endif
+OSREL?= ${UNAMER:S/-.*//}
# Get __FreeBSD_version
.if !defined(OSVERSION)
@@ -1198,10 +1198,19 @@
.elif exists(${SRC_BASE}/sys/sys/param.h)
OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h
.else
-OSVERSION!= ${SYSCTL} -n kern.osreldate
+.error Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
.endif
.endif
+# Convert OSVERSION to major release number
+_OSVERSION_MAJOR= ${OSVERSION:C/([0-9]?[0-9])([0-9][0-9])[0-9]{3}/\1/}
+# Sanity checks for chroot/jail building.
+.if ${_OSVERSION_MAJOR} != ${UNAMER:R}
+.error UNAME_r (${UNAMER}) and OSVERSION (${OSVERSION}) do not agree on major version number.
+.elif ${_OSVERSION_MAJOR} != ${OSREL:R}
+.error OSREL (${OSREL}) and OSVERSION (${OSVERSION}) do not agree on major version number.
+.endif
+
# Enable new xorg for FreeBSD versions after Radeon KMS was imported unless
# WITHOUT_NEW_XORG is set.
.if (${OSVERSION} >= 902510 && ${OSVERSION} < 1000000) || ${OSVERSION} >= 1000704
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 19, 10:26 PM (19 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25685729
Default Alt Text
D869.id1832.diff (1 KB)
Attached To
Mode
D869: Add sanity checks for chroot/jail building and stop asking kernel for OSVERSION.
Attached
Detach File
Event Timeline
Log In to Comment