Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 02:08:33 +0100 (CET)
From:      Dag-Erling Smørgrav <des@des.no>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61856: [PATCH] stop relying on port.mkversion
Message-ID:  <20040125010833.2689E33C9A@dwp.des.no>
Resent-Message-ID: <200401250110.i0P1AGsw069669@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         61856
>Category:       ports
>Synopsis:       [PATCH] stop relying on port.mkversion
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 24 17:10:15 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dag-Erling Smørgrav
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dwp.des.no 5.2-CURRENT FreeBSD 5.2-CURRENT #22: Sat Jan 24 20:11:54 CET 2004 des@dwp.des.no:/usr/obj/usr/src/sys/dwp_smp i386

ports-current

>Description:

/var/db/port.mkversion serves no purpose, and never did.  it is intended
to prevent the use of an up-to-date ports tree on FreeBSD versions older
than approx. 4.2, but the value it contains is simply the date of the
last system upgrade and bears no relation to the actual FreeBSD version
used.  furthermore, the threshold date (20001103) is so far in the past
it has become completely meaningless, and I'd be surprised if the current
ports tree still works on a system built from 20001104 sources.

>How-To-Repeat:

try to use the ports tree on a system that lacks /var/db/port.mkversion
(e.g. a diskless system with a memory-based /var) and watch it tell you
that your system is too old.

>Fix:

apply the attached patch, which replaces the port.mkversion test with an
equivalent but far more reliable and relevant ${OSVERSION} test.

--- ports-mkversion.diff begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.483
diff -u -r1.483 bsd.port.mk
--- Mk/bsd.port.mk	24 Jan 2004 01:26:30 -0000	1.483
+++ Mk/bsd.port.mk	25 Jan 2004 00:49:57 -0000
@@ -2725,24 +2725,9 @@
 # Don't build a port if the system is too old.
 ################################################################
 
-.if ${OSVERSION} >= 300000
+.if ${OSVERSION} < 420000
 # You need an upgrade kit or make world newer than this
-BSDPORTMKVERSION=	20001103
-.if exists(/var/db/port.mkversion)
-VERSIONFILE=	/var/db/port.mkversion
-.else
-VERSIONFILE=	${PKG_DBDIR}/.mkversion
-.endif
-.if exists(${VERSIONFILE})
-.if !defined(SYSTEMVERSION)
-SYSTEMVERSION!=	${CAT} ${VERSIONFILE}
-.endif
-.else
-SYSTEMVERSION=	0
-.endif
-.if ${BSDPORTMKVERSION} > ${SYSTEMVERSION}
 IGNORE=	": Your system is too old to use this bsd.port.mk.  You need a fresh make world or an upgrade kit.  Please go to http://www.FreeBSD.org/ports/ or a mirror site and follow the instructions"
-.endif
 .endif
 
 .if defined(ONLY_FOR_ARCHS)
--- ports-mkversion.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



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