From joeldiaz@bellsouth.net  Fri Dec 10 14:24:12 2004
Return-Path: <joeldiaz@bellsouth.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DC96816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Dec 2004 14:24:12 +0000 (GMT)
Received: from imf23aec.mail.bellsouth.net (imf23aec.mail.bellsouth.net [205.152.59.71])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 70AE143D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Dec 2004 14:24:12 +0000 (GMT)
	(envelope-from joeldiaz@bellsouth.net)
Received: from fbsd.launchmodem.com ([65.8.96.129])
          by imf23aec.mail.bellsouth.net
          (InterMail vM.5.01.06.11 201-253-122-130-111-20040605) with ESMTP
          id <20041210142411.HTZI2382.imf23aec.mail.bellsouth.net@fbsd.launchmodem.com>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Fri, 10 Dec 2004 09:24:11 -0500
Message-Id: <1102688649.0@fbsd.launchmodem.com>
Date: Fri, 10 Dec 2004 09:24:09 -0500
From: "Joel Diaz" <joeldiaz@bellsouth.net>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: sysutils/bpm - Patch which fixes running bpm on CURRENT
X-Send-Pr-Version: gtk-send-pr 0.4.1 
X-GNATS-Notify:

>Number:         74916
>Category:       ports
>Synopsis:       sysutils/bpm - Patch which fixes running bpm on CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 10 14:30:25 GMT 2004
>Closed-Date:    Wed Mar 16 13:21:14 GMT 2005
>Last-Modified:  Wed Mar 16 13:21:14 GMT 2005
>Originator:     Joel Diaz
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 6.0-CURRENT #0: Fri Dec 10 03:19:12 EST 2004
    jdiaz@fbsd.launchmodem.com:/usr/obj/usr/src/sys/MYKERNEL



>Description:


There is no check in src/refresh.c for anything higher than 500036.  The patch adjust the compilation for users of 6-CURRENT.


>How-To-Repeat:


Try running bpm on CURRENT, and you get a message saying INDEX-5 couldn't be found.


>Fix:


--- patch-src::refresh.c begins here ---
--- src/refresh.c.orig	Mon Aug 23 22:40:08 2004
+++ src/refresh.c	Fri Dec 10 08:58:03 2004
@@ -62,7 +62,13 @@
 __RCSID("$Id: refresh.c,v 1.32 2004/08/24 02:40:08 sethk Exp $");
 
 /* XXX use libinstall/lib.h */
+#if __FreeBSD_version >= 600000
+#define	INDEX_FN    PORTS_BASE "/INDEX-6"
+#elif __FreeBSD_version >= 500036
+#define	INDEX_FN    PORTS_BASE "/INDEX-5"
+#else
 #define	INDEX_FN    PORTS_BASE "/INDEX"
+#endif
 #define INDEX_MAXLN 4096
 #define DB_DIR	    "/var/db/pkg"
 #define ITER_BYTES  (128 * 1024)
@@ -183,10 +189,12 @@
 	if (*sp == '|')
 	    ++i;
 
-    if (i != (PFIELD_NFIELD - 1))
+    if (i < (PFIELD_NFIELD - 1))
     {
 #ifdef DEBUG
-	warnx("invalid number of fields");
+	warnx("invalid number of fields (%d should be %d)",
+		i + 1,
+		PFIELD_NFIELD);
 #endif /* DEBUG */
 	return FALSE;
     }
@@ -195,12 +203,9 @@
 
     for (i = 0; i < PFIELD_NFIELD; ++i)
     {
-	if (i < PFIELD_NFIELD - 1)
-	{
-	    if (!(sp = strchr(line, '|')))
-		break;
-	    *sp++ = '\0';
-	}
+	if (!(sp = strchr(line, '|')) && i < PFIELD_NFIELD - 1)
+	    break;
+	*sp++ = '\0';
 
 	switch (i)
 	{
@@ -320,7 +325,6 @@
 
 	if (_refresh_index_parse(ln, portdp, rdp) != TRUE)
 	{
-	    _refresh_portfree(portdp);
 #ifdef DEBUG
 	    warnx("%s:%u: invalid format", INDEX_FN, rdp->rd_linec);
 #endif /* DEBUG */
--- patch-src::refresh.c ends here ---



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: vs 
State-Changed-When: Wed Dec 15 12:55:38 GMT 2004 
State-Changed-Why:  
Forwarded PR to maintainer 

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

From: "Volker Stolz" <vs@freebsd.org>
To: freebsd-gnats-submit@freebsd.org, joeldiaz@bellsouth.net,
	sethk@meowfishies.com
Cc:  
Subject: Re: ports/74916: sysutils/bpm - Patch which fixes running bpm on CURRENT
Date: Wed, 15 Dec 2004 13:55:23 +0100

 Dear maintainer, please review the proposed patch!
 
 Volker

From: Seth Kingsley <sethk@meowfishies.com>
To: freebsd-gnats-submit@FreeBSD.org, joeldiaz@bellsouth.net
Cc:  
Subject: Re: ports/74916: sysutils/bpm - Patch which fixes running bpm on CURRENT
Date: Sat, 26 Feb 2005 21:48:17 -0800

 --zx4FCpZtqtKETZ7O
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Sorry about the delay; this patch looks good.  I've already added it to my
 repository for the next release.
 
 --=20
 || Seth Kingsley || sethk@meowfishies.com ||
 || http://www.meowfishies.com/ | Meow ^_^ ||
 
 --zx4FCpZtqtKETZ7O
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.2 (FreeBSD)
 
 iD8DBQFCIV8gD1AymFxBOwgRAlgYAJ4nAlyPs6SLNychOeB/zZBpIUM4gwCcCJZL
 fX6JeCGx4BBZJ6szFCen99w=
 =+257
 -----END PGP SIGNATURE-----
 
 --zx4FCpZtqtKETZ7O--
State-Changed-From-To: feedback->closed 
State-Changed-By: vs 
State-Changed-When: Wed Mar 16 13:21:04 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74916 
>Unformatted:
