[Bug 225843] ports-mgmt/portmaster: -v pollutes gen_dep_list output

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Feb 12 03:47:25 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225843

            Bug ID: 225843
           Summary: ports-mgmt/portmaster: -v pollutes gen_dep_list output
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: se at FreeBSD.org
          Reporter: z7dr6ut7gs at snkmail.com
          Assignee: se at FreeBSD.org
             Flags: maintainer-feedback?(se at FreeBSD.org)

Created attachment 190535
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=190535&action=edit
[patch] direct export_flavor() output to stderr to avoid polluting
gen_dep_list() output

If you use '-v', that triggers a message in export_flavor() that pollutes the
output of gen_dep_list().

Here's an example of what can happen as a result.  In this example assume
electrum and one of its python dependencies (say security/py-trezor at py36) is
not installed:

% /usr/local/sbin/portmaster -v finance/electrum
===>>> Port directory: /usr/ports/finance/electrum
 .
 .
===>>> The following actions will be taken if you choose to proceed:
        Install finance/electrum
        Install security/py-trezor at py36

===>>> Proceed? y/n [y] y


===>>> Starting build for finance/electrum <<<===

===>>> Starting check for build dependencies
===>>> Gathering dependency list for finance/electrum from ports
===>>> Starting dependency check
===>>> Checking dependency: ===>>>

===>>> Cannot cd to ===>>>
===>>> Aborting update


The problem is that gen_dep_list() calls export_flavor() and there is a pm_v()
call in export_flavor() which outputs to stdout which pollutes the list that is
output by gen_dep_list().  If you run portmaster with -x (sh -x
/usr/local/sbin/portmaster ...), you can see what is happening.

The fix I attached redirects the export_flavor() output in gen_dep_list() to
stderr.

You could also redirect the pm_v output in export_flavor() to stderr.  Maybe
that's better, but the other export_flavor() calls in portmaster are not
vulnerable to this problem (they don't need stdout to be clean).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list