Skip site navigation (1)Skip section navigation (2)
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:    ports/74916: sysutils/bpm - Patch which fixes running bpm on CURRENT
Message-ID:  <1102688649.0@fbsd.launchmodem.com>
Resent-Message-ID: <200412101430.iBAEUPU1076350@freefall.freebsd.org>

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

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 10 14:30:25 GMT 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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