index warning and bash-completion

classic Classic list List threaded Threaded
10 messages Options
db
Reply | Threaded
Open this post in threaded view
|

index warning and bash-completion

db
bash-completion for port outputs stderr on pressing tab, right before it completes a word, on certain actions like contents.

$ port contents bash-complWarning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
etion

Can anyone reproduce it?
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Ryan Schmidt-24
On Mar 10, 2018, at 12:18, db wrote:
>
> bash-completion for port outputs stderr on pressing tab, right before it completes a word, on certain actions like contents.
>
> $ port contents bash-complWarning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
> etion
>
> Can anyone reproduce it?

Are your port definitions in fact more than two weeks old?
db
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

db
On 10 Mar 2018, at 20:05, Ryan Schmidt <[hidden email]> wrote:
> Are your port definitions in fact more than two weeks old?

Yes, but I'd expect the warning after I actually ran the command.
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Ryan Schmidt-24

On Mar 10, 2018, at 14:24, db wrote:

> On 10 Mar 2018, at 20:05, Ryan Schmidt wrote:
>> Are your port definitions in fact more than two weeks old?
>
> Yes, but I'd expect the warning after I actually ran the command.

When you press tab, the bash completion code runs. Looking at the contents of /opt/local/share/bash-completion/completions/port, I see that in order to provide the completions to you, it will be running various port commands. For example, if you are typing "port contents bash-compl" and then pressing tab, expecting it to autocomplete the name of an installed port, it has to run "port installed" or something to find the list of installed ports.

I don't know if MacPorts has a flag to suppress the warning. If so, /opt/local/share/bash-completion/completions/port should use it. If not, we should add one.

Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Clemens Lang-2
In reply to this post by db
On Sat, Mar 10, 2018 at 09:24:27PM +0100, db wrote:
> On 10 Mar 2018, at 20:05, Ryan Schmidt <[hidden email]> wrote:
> > Are your port definitions in fact more than two weeks old?
>
> Yes, but I'd expect the warning after I actually ran the command.

Unfortunately that happens because the bash completion executes 'port
-q', which only hides info messages, but still displays warnings. The
source code for this is at
  https://github.com/macports/macports-ports/blob/master/sysutils/bash-completion/files/port
so if you have time you could try modifying it to drop stderr into
nirvana and submit a pull request for that.

--
Clemens
db
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

db
On 10 Mar 2018, at 23:15, Clemens Lang <[hidden email]> wrote:
>  https://github.com/macports/macports-ports/blob/master/sysutils/bash-completion/files/port
> so if you have time you could try modifying it to drop stderr into nirvana and submit a pull request for that.

Ok, I'll have to take a closer look, as it doesn't show for certain actions like info.

Btw, how can I change the two-week period for the warning. I couldn't find an option in macports.conf, either to change the period or to suppress it altogether.
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Ryan Schmidt-24

On Mar 10, 2018, at 17:47, db wrote:

> Btw, how can I change the two-week period for the warning. I couldn't find an option in macports.conf, either to change the period or to suppress it altogether.

I don't think we offer any options to configure that. We want users to stay up to date; we don't want to field bug reports about problems we've already fixed.
db
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

db
On 11 Mar 2018, at 04:01, Ryan Schmidt <[hidden email]> wrote:
> On Mar 10, 2018, at 17:47, db wrote:
>> Btw, how can I change the two-week period for the warning. I couldn't find an option in macports.conf, either to change the period or to suppress it altogether.
> I don't think we offer any options to configure that. We want users to stay up to date; we don't want to field bug reports about problems we've already fixed.

I think I read about such an option a couple of years ago, but couldn't find anything now. Anyway, if there's actually none I suppose I could change it myself and have other means to remind me about when I want to resync.

https://github.com/macports/macports-base/blob/1e9e6f19670b22a47b3cc2bb9a9da985986b6203/src/macports1.0/macports.tcl#L1235
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Bill Cole
In reply to this post by db
On 10 Mar 2018, at 18:47 (-0500), db wrote:

> Btw, how can I change the two-week period for the warning. I couldn't
> find an option in macports.conf, either to change the period or to
> suppress it altogether.

port reclaim --disable-reminders

That puts the word 'disabled' into /opt/local/var/macports/last_reclaim,
which otherwise has the epoch time of the last reclaim run or the last
'port reclaim --enable-reminders'

--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steady Work: https://linkedin.com/in/billcole
Reply | Threaded
Open this post in threaded view
|

Re: index warning and bash-completion

Ryan Schmidt-24

On Mar 11, 2018, at 21:53, Bill Cole wrote:

> On 10 Mar 2018, at 18:47 (-0500), db wrote:
>
>> Btw, how can I change the two-week period for the warning. I couldn't find an option in macports.conf, either to change the period or to suppress it altogether.
>
> port reclaim --disable-reminders
>
> That puts the word 'disabled' into /opt/local/var/macports/last_reclaim, which otherwise has the epoch time of the last reclaim run or the last 'port reclaim --enable-reminders'

I assume that only disables reminders to run reclaim, but does not disable reminders to run selfupdate, which is the warning db was asking about.