bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-update program cache feature


From: Jeffrey Walton
Subject: Re: Auto-update program cache feature
Date: Thu, 4 Oct 2018 02:19:58 -0400

On Wed, Oct 3, 2018 at 9:33 PM Eduardo A. Bustamante López
<dualbus@gmail.com> wrote:
>
> On Wed, Oct 03, 2018 at 04:45:44PM -0400, Jeffrey Walton wrote:
> > Hi Everyone,
> >
> > I noticed a fair number of new Linux users have trouble with stale
> > program caches. Users install a package from a package manager or
> > sources and then are confused when the new package is not used. They
> > do not realize they need to run 'bash -r'; and most don't know where
> > to begin searching.
>
> You mean `hash -r' ?
>
> > (...)
> > so monitoring of common commands seems like a sensible way to
> > implement the feature.
>
> > A single terminal can monitor for a regex that looks for 'make
> > install' and perhaps other common  installation commands. Multiple
> > terminals seems like a trickier case, and could use a scheme where the
> > source terminal broadcasts an 'update cache' message to other open
> > terminals.
>
> A shell is not a terminal. A terminal is a hardware (or emulated) device that
> provides input/output capabilities. Nowadays most terminals are emulated
> (gnome-terminal, xterm, urxvt, ...), but there are still physical terminals in
> use. It seems quite complicated to have all terminal emulators and physical
> terminals introduce this functionality.
>
> And even if you manage to do that... how would that work? Terminals are only
> aware of the input typed by the user, and the output provided by the programs
> that run attached to that terminal device... that excludes a bunch of cases
> like...

How Bash achieves it is an implementation detail left to the experts.
I made a few suggestions that don't seem to fit well. That's OK
because Bash internals is not my area of expertise.

Architecturally each instance of Bash is an object could receive a
"clear cache" message. How it is achieved does not matter to me. What
is important is, the right thing is done to relieve users from the
extra work for the common case.

> If you don't care about performance, why don't you just run `hash -r' through
> PROMPT_COMMAND? That seems simple enough?

This was answered in the problem statement: new users don't know what
they have to do, and don't know where to go looking for the answer
when things don't work as expected.

It would be helpful if programs like Autotools and CMake finished with
a prompt like, "Run 'hash -r' to tell users their next step but they
don't. (It also would not help the multiple sessions case, but it
would go a long way in helping users with the problem).

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]