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


Groups > linux.debian.user > #194241 > unrolled thread

Re: How to execute user's scripts when upgrading a certain package via apt/aptitude

Started byDavid Wright <deblis@lionunicorn.co.uk>
First post2018-03-28 21:30 +0200
Last post2018-03-28 21:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude David Wright <deblis@lionunicorn.co.uk> - 2018-03-28 21:30 +0200

#194241 — Re: How to execute user's scripts when upgrading a certain package via apt/aptitude

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2018-03-28 21:30 +0200
SubjectRe: How to execute user's scripts when upgrading a certain package via apt/aptitude
Message-ID<vyoVI-798-7@gated-at.bofh.it>
On Wed 28 Mar 2018 at 20:00:34 (+0200), Mikhail Morfikov wrote:
> On 2018-03-28 18:58, Andy Smith wrote:
> > On Wed, Mar 28, 2018 at 06:29:06PM +0200, Mikhail Morfikov wrote:
> >> Is there a way to pass some extra commands/script to apt/aptitude so when the
> >> firefox package is to be upgraded, it would recreate the links automatically?
> > 
> > I've never tried it but looking at "man apt.conf" it seems that
> > setting Apt::Post-Invoke (or possible Apt::Post-Invoke-Success?)
> > might be useful to you, as you could use it to run a script that
> > checks that your firefox setup is as you want it.
> I'm aware of the options, but even if I put some script in Post-Invoke, there's
> still a problem concerning how to pass the information to the script that the
> firefox package was upgraded. Is there some variable that holds, for instance, a
> list of the packages that apt wants to upgrade? In such way it would be easy to
> set this up. But if the script doesn't know which packages are upgraded (or just
> the specific one), it has to be run and remove the hard links with each
> upgrade/installation process, and this isn't really what I want to achieve.

You said these were hardlinks. If so, then the most straightforward
is to look at the link counts. When the old version of the program
and whatever files are involved in the upgrade, is removed (as it
were, because your own links will preserve its existence), the
link count of your hard links will decrease, likely to 1.

As you probably know, the link count is given by ls -l in the
second field, between the permissions and the owner.

Cheers,
David.

[toc] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web