Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 2008 09:40:42 GMT
From:      Trevor Johns <trevor@tjohns.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/125823: [PATCH] Ports-mgmt/portupgrade does not use custom ECHO_MSG handler if defined
Message-ID:  <200807210940.m6L9eg18071021@www.freebsd.org>
Resent-Message-ID: <200807210950.m6L9o1lv021962@freefall.freebsd.org>

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

>Number:         125823
>Category:       ports
>Synopsis:       [PATCH] Ports-mgmt/portupgrade does not use custom ECHO_MSG handler if defined
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 21 09:50:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Trevor Johns
>Release:        6.3-RELEASE
>Organization:
Google
>Environment:
FreeBSD timon.usc.edu 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 04:18:52 UTC 2008     root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386


>Description:
The ports-mgmt/portupgrade tool does not check to see if a given port has defined a custom value for the ECHO_MSG variable when outputing the reason that port has been marked as IGNORE.

Since the value used for ECHO_MSG influences the content of the IGNORE variable (for example, ECHO_MSG may be set to /usr/bin/printf, allowing escape codes in ECHO_MSG), blindly outputting the contents of IGNORE can cause ugly or unreadable output.

>How-To-Repeat:
Run portupgrade such that it would try to rebuild java/jdk16 without first downloading tzupdater-1_3_6-2008c.zip. The following will be output (note presence of "\n" in output):

** Port marked as IGNORE: java/jdk16:
        :\n Due to licensing restrictions, certain files must be fetched manually.\n\n Please open http://java.sun.com/javase/downloads/index.jsp\n in a web browser and follow the \"Download\" link for\n \"JDK US DST Timezone Update Tool - 1_3_6\" to obtain the\n time zone update file, tzupdater-1_3_6-2008c.zip.\n\n Please place the downloaded file(s) in /usr/ports/distfiles \n and restart the build.\n\n


>Fix:


Patch attached with submission follows:

Fix portupgrade so that custom ECHO_MSG settings are taken into account.

Since ports that use this tend to be a bit more creative with their
formatting, this change also tries to correct for that behavior.

Patch by: Trevor Johns <trevor@tjohns.net>

Index: bin/portupgrade
===================================================================
RCS file: /cvsroot/portupgrade/pkgtools/bin/portupgrade,v
retrieving revision 1.61
diff -r1.61 portupgrade
1453c1453
<   output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE -V NO_IGNORE 2>&1`.scan(/.*\n/)
---
>   output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE -V NO_IGNORE -V ECHO_MSG 2>&1`.scan(/.*\n/)
1455c1455
<   if output.size != 3
---
>   if output.size != 4
1462a1463
>   echo_msg = output[3].chomp
1465a1467,1470
>     ignore = `#{echo_msg} "#{ignore}"`
>     # Some packages ouptut a ':\n ' to try to look nice when using the normal
>     # ports build process. That looks really bad here, so we undo that.
>     ignore.slice!(0..2) if (ignore.match /^:\n /)


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



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