Opened 5 years ago

Closed 3 years ago

#58452 closed defect (fixed)

bash-completion: port(1) ui_warn output is displayed during tab completion

Reported by: paxperscientiam (Chris) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: bash-completion

Description (last modified by paxperscientiam (Chris))

Never noticed this before, so it may be a new thing. Basically, after writing, for example, sudo port upgrade a and tabbing, the first completion result is "Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'."

Is this intentional?

Demo: https://www.dropbox.com/s/n7v8312bx5l8uej/Screen%20Recording%202019-05-07%20at%209.53.15%20AM.mov?dl=0

EDIT: I forgot to note, that this only occurs when definitions are actually out of date.

Change History (6)

comment:1 Changed 5 years ago by paxperscientiam (Chris)

Description: modified (diff)

comment:2 Changed 5 years ago by jmroot (Joshua Root)

Owner: set to raimue
Port: bash-completion added
Status: newassigned
Summary: `sudo port upgrade <some_port>` tab completion errorbash-completion: port(1) ui_warn output is displayed during tab completion

I'm going to assume you're using bash-completion here.

comment:3 in reply to:  2 Changed 5 years ago by paxperscientiam (Chris)

Yeah, sorry. You are correct!

Replying to jmroot:

I'm going to assume you're using bash-completion here.

comment:4 Changed 5 years ago by raimue (Rainer Müller)

Thanks for the detailed report with the screencast! This is definitely not intentional. I did not want to redirect all error output, because if the port completion command fails, it could contain actual helpful error messages. But I agree that in this case, although correct, it is disruptive. On the other hand, you might have run an port upgrade and installed some outdated version without the warning...

In the hope this will also be useful for other other automated scripts, I propose we change the behavior for the next MacPorts base version. As quiet mode via port -q is already in use in the bash-completion script, we could suppress the warning in quiet mode: https://github.com/macports/macports-base/pull/126

comment:5 Changed 5 years ago by raimue (Rainer Müller)

In a214a721e83cfd30161b3aa209e6506af19b4804/macports-base (master):

port: Suppress old PortIndex warning in quiet mode

If quiet mode is active, suppress the old PortIndex warning in order to
avoid these spurious warnings in non-interactive scripts such as the
bash-completion helper.

See: #58452

comment:6 Changed 3 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

As the solution described above has been released, close this ticket.

Note: See TracTickets for help on using tickets.