bin/124459: [PATCH] pkg_updating: UPDATING entries were not shown if there is no newline after the port name

Beat Gätzi beat at chruetertee.ch
Tue Jun 10 20:30:06 UTC 2008


>Number:         124459
>Category:       bin
>Synopsis:       [PATCH] pkg_updating: UPDATING entries were not shown if there is no newline after the port name
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 10 20:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Beat Gätzi
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD daedalus.network.local 8.0-CURRENT FreeBSD 8.0-CURRENT #3: Tue Jun 10 17:13:12 CEST 2008 root at daedalus.network.local:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	- Fix bug: UPDATING entries without line break after the port name were not shown
	- Add some debug output
	
>How-To-Repeat:
	- Install devel/gettext
	# cd /usr/ports/devel/gettext && make install clean
	- Run pkg_updating
	# pkg_updating
	- There is no devel/gettext entry like this in the output of pkg_updating:
	AFFECTS: users of devel/gettext (ie: YOU)
	
>Fix:

	

--- pkg_updating_main_c.patch begins here ---
--- src.orig/usr.sbin/pkg_install/updating/main.c	2008-06-09 21:48:59.000000000 +0200
+++ src/usr.sbin/pkg_install/updating/main.c	2008-06-10 22:17:17.000000000 +0200
@@ -175,7 +175,12 @@
 							if((curr = (INSTALLEDPORT *)
 								malloc(sizeof(INSTALLEDPORT))) == NULL)
 								(void)exit(EXIT_FAILURE);
+							if (pname[strlen(pname) - 1] == '\n')
+								pname[strlen(pname) - 1] = '\0';
 							strlcpy (curr->name, pname, strlen(pname)+1);
+#ifdef DEBUG
+							fprintf(stderr, "Installed port: %s\n", curr->name);
+#endif
 							curr->next = head;
 							head = curr;
 						}
@@ -207,13 +212,23 @@
 		if (found == 0) {
 			/* Search for AFFECTS line to parse the portname. */
 			tmpline1 = strstr(updatingline, affects);
-
 			if( tmpline1 != NULL ) {
 				curr = head; 
+#ifdef DEBUG
+				fprintf(stderr, "Found AFFECTS line: %s\n", updatingline);
+#endif
 				while(curr != NULL) {
 					tmpline2 = strstr(updatingline, curr->name);
-					if( tmpline2 != NULL )
+#ifdef DEBUG
+					fprintf(stderr, "Compare AFFECT line: %s", updatingline);
+					fprintf(stderr, "with installed port: %s", curr->name);
+#endif
+					if( tmpline2 != NULL ) {
+#ifdef DEBUG
+						fprintf(stderr, "AFFECTS line matches installed port: %s\n", tmpline2);
+#endif
 						break;
+					}
 					curr = curr->next;
 				}
 				if( tmpline2 != NULL ) {
--- pkg_updating_main_c.patch ends here ---


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


More information about the freebsd-bugs mailing list