aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2017-01-17 23:49:16 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2017-01-17 23:49:16 +0800
commit9bfbfb094ab920dd9f4fc69c25ca910318645834 (patch)
tree5a0aca17cf57ad1ab1cc8138b7ccb9d9809d18e7 /Mk
parent4d84e8abc6baa0f8be23c6342e32e66b5673d4e0 (diff)
downloadfreebsd-ports-gnome-9bfbfb094ab920dd9f4fc69c25ca910318645834.tar.gz
freebsd-ports-gnome-9bfbfb094ab920dd9f4fc69c25ca910318645834.tar.zst
freebsd-ports-gnome-9bfbfb094ab920dd9f4fc69c25ca910318645834.zip
- Refuse (overridable) to build ports on unsupported system version
Unfortunately, it's not uncommon for FreeBSD users to not update their systems timely and thus end up using unsupported FreeBSD release. These users continue to update ports tree as usual and expect it to work, either unaware of the release EoL, or not clearly understanding the consequences, which results in unexpected build failures, bogus bug reports, attempts to bring back removed legacy support bits and general discontent. This change introduces system version check which makes ports refuse to build anything on unsupported system. This makes users aware of EoL of their system and makes it clear that no port is guaranteed to build. The error message tells how to override the check (by defining ALLOW_UNSUPPORTED_SYSTEM, in which case it's turned into a simple warning), additionally stressing that this configurartion is not supported. Currently outdated are OSVERSION < 1003000 (pre 10.3-RELEASE) and 1100000 <= OSVERSION < 1100122 (from 11-CURRENT'2013 to 11.0-PRERELEASE) I expect these to be kept up to date with base system lifetimes, be updated BEFORE removing any support for outdated release from the tree and also serve as a reference of which OSVERSION checks may be removed. Approved by: portmgr (swills, mat) Differential Revision: D9210
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk21
1 files changed, 20 insertions, 1 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index de136bc261a0..361ea58a0b3f 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1144,6 +1144,24 @@ OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC
.endif
_EXPORTED_VARS+= OSVERSION
+.if (${OPSYS} == FreeBSD && (${OSVERSION} < 1003000 || (${OSVERSION} >= 1100000 && ${OSVERSION} < 1100122))) || \
+ (${OPSYS} == DragonFly && ${DFLYVERSION} < 400400)
+_UNSUPPORTED_SYSTEM_MESSAGE= Ports Collection support for your ${OPSYS} version has ended, and no ports\
+ are guaranteed to build on this system. Please upgrade to a supported release.
+. if defined(ALLOW_UNSUPPORTED_SYSTEM)
+WARNING+= "${_UNSUPPORTED_SYSTEM_MESSAGE}"
+. else
+show-unsupported-system-error:
+ @${ECHO_MSG} "/!\\ ERROR: /!\\"
+ @${ECHO_MSG}
+ @${ECHO_MSG} "${_UNSUPPORTED_SYSTEM_MESSAGE}" | ${FMT} 75 79
+ @${ECHO_MSG}
+ @${ECHO_MSG} "No support will be provided if you silence this message by defining ALLOW_UNSUPPORTED_SYSTEM." | ${FMT} 75 79
+ @${ECHO_MSG}
+ @${FALSE}
+. 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.
@@ -5168,7 +5186,8 @@ _TARGETS_STAGES= SANITY PKG FETCH EXTRACT PATCH CONFIGURE BUILD INSTALL TEST PAC
# If you change the pre-foo and post-foo values here, go and keep them in sync
# in _OPTIONS_TARGETS in bsd.options.mk
-_SANITY_SEQ= 050:post-chroot 100:pre-everything 150:check-makefile \
+_SANITY_SEQ= 050:post-chroot 100:pre-everything \
+ 125:show-unsupported-system-error 150:check-makefile \
200:show-warnings 210:show-dev-warnings 220:show-dev-errors \
250:check-categories 300:check-makevars \
350:check-desktop-entries 400:check-depends \