From nobody@FreeBSD.org  Mon Mar 26 16:32:54 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id DF89516A402
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Mar 2007 16:32:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id C2DD913C45E
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Mar 2007 16:32:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2QGWrHZ011336
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Mar 2007 16:32:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2QGRpgh010342;
	Mon, 26 Mar 2007 16:27:51 GMT
	(envelope-from nobody)
Message-Id: <200703261627.l2QGRpgh010342@www.freebsd.org>
Date: Mon, 26 Mar 2007 16:27:51 GMT
From: Panagiotis Christias<p.christias@noc.ntua.gr>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsd.port.mk: small fix for FreeBSD 4.8 (or older versions) support
X-Send-Pr-Version: www-3.0

>Number:         110870
>Category:       ports
>Synopsis:       bsd.port.mk: small fix for FreeBSD 4.8 (or older versions) support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 26 16:40:04 GMT 2007
>Closed-Date:    Mon Mar 26 16:48:51 GMT 2007
>Last-Modified:  Mon Mar 26 17:00:09 GMT 2007
>Originator:     Panagiotis Christias
>Release:        FreeBSD 4.8
>Organization:
NTUA NOC
>Environment:
I understand that FreeBSD 4.x is no longer supported but since the solution is so simple (see attached patch file) it would be easy to include it.

>Description:
e have a dozen of old FreeBSD 4.8 boxes in production operating as transparent proxies. Trying to build any port fails:

% cd /usr/ports/www/squid 
% make
"/usr/ports/Mk/bsd.port.mk", line 2274: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 2274: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 2274: Malformed conditional (((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info))
"/usr/ports/Mk/bsd.port.mk", line 2275: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 2275: warning: String comparison operator should be either == or !=
"/usr/ports/Mk/bsd.port.mk", line 2275: Malformed conditional ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install")
"/usr/ports/Mk/bsd.port.mk", line 2290: if-less else
"/usr/ports/Mk/bsd.port.mk", line 2290: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 2304: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 2304: Need an operator
"/usr/ports/Mk/bsd.port.mk", line 5947: if-less endif
"/usr/ports/Mk/bsd.port.mk", line 5947: Need an operator
make: fatal errors encountered -- cannot continue

>How-To-Repeat:
Just run "make" in any port directory of a FreeBSD 4.8 box:

% cd /usr/ports/www/squid 
% make

>Fix:
I understand that FreeBSD 4.x is no longer supported but since the solution is so simple (see attached patch file) it would be easy to include it.


Patch attached with submission follows:

--- /usr/ports/Mk/bsd.port.mk.orig	Mon Mar 26 18:10:25 2007
+++ /usr/ports/Mk/bsd.port.mk	Mon Mar 26 16:53:35 2007
@@ -2271,8 +2271,8 @@
 PKGORIGIN?=		${PKGCATEGORY}/${PORTDIRNAME}
 
 
-.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info)
-.if (${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012)) && ${PKGORIGIN} != "ports-mgmt/pkg_install"
+.if ((${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103 ) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012 )) && ${PKGORIGIN} != "ports-mgmt/pkg_install") || exists(${LOCALBASE}/sbin/pkg_info)
+.if (${OSVERSION} < 504105 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600103 ) || (${OSVERSION} >= 700000 && ${OSVERSION} < 700012 )) && ${PKGORIGIN} != "ports-mgmt/pkg_install"
 EXTRACT_DEPENDS+=	${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/ports-mgmt/pkg_install
 .endif
 .if !defined(DESTDIR)

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 26 16:40:20 UTC 2007 
Responsible-Changed-Why:  
bsd.port.mk is port manager territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110870 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Mon Mar 26 16:48:26 UTC 2007 
State-Changed-Why:  
Sorry, but we no longer support FreeBSD 4.X. 

You will probably have all those machines upgraded to FreeBSD 6 before we 
manage to process this patch, anyway. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110870 

From: linimon@lonesome.com (Mark Linimon)
To: Panagiotis Christias <p.christias@noc.ntua.gr>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/110870: bsd.port.mk: small fix for FreeBSD 4.8 (or older versions) support
Date: Mon, 26 Mar 2007 11:58:29 -0500

 This is from the code that we removed after the RELENG_4_EOL tag was
 laid down.  If you are still, for some reason, running 4.X, you need to
 revert to the ports codebase as of that tag.  This was discussed in at
 least one HEADSUP message.
 
 Since that tag, not only have we removed infrastructure, but most port
 maintainers have been removing the special-case 4.X code, so that they
 can simplify their maintainance tasks.
 
 Finally, 4.8 even has the old, buggy, make, so it has been a pain to
 support for several years (occasional port checkins break under the
 old make).
 
 Your only feasible choice at this point is to upgrade.
>Unformatted:
