Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14685

Re: Auto-update program cache feature

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Jeffrey Walton <noloader@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Auto-update program cache feature
Date Thu, 4 Oct 2018 02:19:58 -0400
Lines 65
Approved bug-bash@gnu.org
Message-ID <mailman.1696.1538634032.1284.bug-bash@gnu.org> (permalink)
References <CAH8yC8kgkFRBaq85Z-tf+4x+DNqEU1CD-iZMgzJ6nYge-N4Sgg@mail.gmail.com> <20181004013022.GA28424@ubuntu>
Reply-To noloader@gmail.com
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1538634033 4587 208.118.235.17 (4 Oct 2018 06:20:33 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:content-transfer-encoding; bh=EfLmBI8AvUzNwEt3KZX45fsFzV4B3CDwWZaIRRwSb+4=; b=MTJY1TkgfOCo8yhG51pm2bFc+xKlXM6bKlqwI2rNQM0aMrdqh9R25yA7YL+QEerxnw +6P8x3I8dwz+waysJ+iLgLDQB9d3sRkOfxY8viaW6yrJfU8cKfcx/2hg7KjHKWxg62ei 2LC1M2SC174UPZjDuZM1MMvTWDaYIsPHCdDyJTKsijqf5jXP3fhHoGOjFdP27azwibjn G2D1XOGlfaVEZENwhZCOTkcJiQzDqkO7xqNKwtR6pnUI+0hjJC3JwDrysTCVNIUF7fC7 EVf6Ai2C69dA/6uJNj4VdrXQnbaC6h5QWTOCXfxyNY4wiSujLssrUt48QMdIF9GHpbb7 5l6Q==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:content-transfer-encoding; bh=EfLmBI8AvUzNwEt3KZX45fsFzV4B3CDwWZaIRRwSb+4=; b=bYYNBdUyvZ6hVObU5gJOKZd6exf2ReTcumapq2ht877xMGkIb5kwvpa9wI55cz7FE3 e6j7CDEDPcyExmtKC0qIlAa5nBVhG0YJQ/DscP3dx+FRY0Ty1Py/EnmiumhY/Z6UMZZ6 iU6WvCtTyneTCo16bBkBmb0rvdWOLFh7Yz0S9BJVk0eruXWDBjzEXNXH4FGqaVuFVl5B 5W30F1NsLsNGSWw8c+yUARHU41gysYYO9X+2Qhlg41kEalXvWlqf6MbLB6OYYAuU7Y1U 55la/o/EUdIoHXtmXdUW39BvRr9gDjJM60Woa2CSH5u2fEUnwi8+SLFLPuxooVRRdL6z OVEQ==
X-Gm-Message-State ABuFfoi5tgWG5lsPCXWuoo0K5CuIv8O/XkPm/SPdHKvy47RqmPIvBLB3 Kvgi0gPmqhlBaTmrDEBlQnRADI6EkyWNrJ/4S2fcsw==
X-Google-Smtp-Source ACcGV62uetUOvnOzu1ifzj6Jb35X09pM7UrYFdspQaHqH/2DIsRH4x+O0wXicHQPyc0BTy9U6eD+jpdMgu1U69tPgE8=
X-Received by 2002:a9d:4d0c:: with SMTP id n12mr2981045otf.90.1538634013213; Wed, 03 Oct 2018 23:20:13 -0700 (PDT)
In-Reply-To <20181004013022.GA28424@ubuntu>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:4864:20::32e
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14685

Show key headers only | View raw


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

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Auto-update program cache feature Jeffrey Walton <noloader@gmail.com> - 2018-10-04 02:19 -0400

csiph-web