Date: Tue, 10 Jun 2008 22:23:55 +0200 From: "Beat Gätzi" <beat@chruetertee.ch> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/124459: [PATCH] pkg_updating: UPDATING entries were not shown if there is no newline after the port name Message-ID: <200806102023.m5AKNohI090159@marvin.chruetertee.ch> Resent-Message-ID: <200806102030.m5AKU6lk099825@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806102023.m5AKNohI090159>