Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 1996 23:30:27 -0700 (PDT)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        jkh@time.cdrom.com
Cc:        ports@freebsd.org
Subject:   Re: Request for feedback: REQUIRES_OS_VERSION feature.
Message-ID:  <199606010630.XAA12039@silvia.HIP.Berkeley.EDU>
In-Reply-To: <20695.833472415@time.cdrom.com> (jkh@time.cdrom.com)

next in thread | previous in thread | raw e-mail | index | archive | help
Well, here it is, a patch relative to -current.  I also changed the
IGNORE code a bit, it now prints out a suitable message than silently
ignoring it.

I decided to put OS_VERSION in bsd.port.mk, because bsd.port.mk is
part of the OS and is installed by "make world", and should thus
reflect the state of the machine quite accurately no matter how you
upgrade it (as opposed to, say, /etc/make.conf).

OS_VERSION is an integer, so that we can compare it using ">" with
REQUIRES_OS_VERSION.  Note this doesn't allow one to check for a
"range" of versions or any fancy stuff, but the -current ports tree is
supposed to work with the latest -current, so there shouldn't be any
problem with this.

The reason why I made it a 5-digit integer?  Well, we already have a
track record of releasing one with 4 version numbers in it (1.1.5.1),
so I added one more digit for safety. :)

Comments welcome!

Satoshi
=======
--- /usr/src/share/mk/bsd.port.mk	Fri May 31 22:45:40 1996
+++ /usr/share/mk/bsd.port.mk	Fri May 31 23:20:08 1996
@@ -105,6 +105,9 @@
 #				  during a build.  User can then decide to skip this port by
 #				  setting ${BATCH}, or compiling only the interactive ports
 #				  by setting ${INTERACTIVE}.
+# REQUIRES_OS_VERSION - Set this if the port requires a certain release or
+#                       newer to compile.  Note this is a 5-digit integer,
+#                       so 2.2.7.3 will become 22730.
 # FETCH_DEPENDS - A list of "prog:dir" pairs of other ports this
 #				  package depends in the "fetch" stage.  "prog" is the
 #				  name of an executable.  make will search your $PATH
@@ -201,6 +204,10 @@
 .include "${.CURDIR}/../Makefile.inc"
 .endif
 
+# The version of FreeBSD this bsd.port.mk is part of.  Note this has to
+# be an integer for the comparison with REQUIRES_OS_VERSION to work.
+OS_VERSION?=	22000
+
 # These need to be absolute since we don't know how deep in the ports
 # tree we are and thus can't go relative.  They can, of course, be overridden
 # by individual Makefiles.
@@ -413,6 +420,9 @@
 ################################################################
 # Many ways to disable a port.
 #
+# Ignore ports that defines REQUIRES_OS_VERSION which is larger
+# than the OS_VERSION (defined above).
+#
 # If we're in BATCH mode and the port is interactive, or we're
 # in interactive mode and the port is non-interactive, skip all
 # the important targets.  The reason we have two modes is that
@@ -431,16 +441,37 @@
 # Don't build a port if it's broken.
 ################################################################
 
-.if (defined(IS_INTERACTIVE) && defined(BATCH)) || \
-	(!defined(IS_INTERACTIVE) && defined(INTERACTIVE)) || \
-	(defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)) || \
-	(defined(NO_CDROM) && defined(FOR_CDROM)) || \
-	(defined(RESTRICTED) && defined(NO_RESTRICTED)) || \
-	defined(BROKEN)
-IGNORE=	yes
+.if defined(REQUIRES_OS_VERSION) && ${REQUIRES_OS_VERSION} > ${OS_VERSION}
+IGNORE=	"${PKGNAME} isn't supported in this OS release; skipping."
+.endif
+
+.if defined(IS_INTERACTIVE) && defined(BATCH)
+IGNORE=	"${PKGNAME} is interactive; skipping in batch mode."
+.endif
+
+.if !defined(IS_INTERACTIVE) && defined(INTERACTIVE)
+IGNORE=	"${PKGNAME} is not interactive; skipping in interactive mode."
+.endif
+
+.if defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)
+IGNORE=	"${PKGNAME} requires Motif; skipping."
+.endif
+
+.if defined(NO_CDROM) && defined(FOR_CDROM)
+IGNORE=	"${PKGNAME} requires Motif; skipping."
+.endif
+
+.if defined(RESTRICTED) && defined(NO_RESTRICTED)
+IGNORE=	"${PKGNAME} is restricted because of \"${RESTRICTED}\"; skipping."
+.endif
+
+.if defined(BROKEN)
+IGNORE=	"${PKGNAME} is broken; skipping."
 .endif
 
 .if defined(IGNORE)
+.BEGIN:
+	@${ECHO_MSG} ${IGNORE}
 all:
 	@${DO_NADA}
 build:



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