Web lists-archives.com

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

On 2018-03-30 04:00, John Crawley (johnraff) wrote:
> On 2018-03-29 09:15, Abdullah Ramazanoglu wrote:
>> On Wed, 28 Mar 2018 20:00:34 +0200 Mikhail Morfikov said:
>>> 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.
> apt list --upgradable
> will print out a list, but the output of 'apt' is not considered suitable for
> parsing by scripts (still unstable).
> apt-get --simulate upgrade
> will also print the packages to be upgraded, along with a lot of noise that your
> script would have to filter.
> But:
>> On Wed, 28 Mar 2018 20:18:24 +0200 Mikhail Morfikov said:
>>> But I will try to do something with the trigger and see how that will
>>> work.
> It looks as if that worked for you. You created a new package 'firefox-trigger'
> with a trigger that looked for upgrades to firefox, right?
Yes, it was pretty much it. The trigger also works fine when installing a
different version of firefox via "dpkg -i" and also when downgrading the package:

# dpkg -i firefox_59.0.1-1_amd64.deb
dpkg: warning: downgrading firefox from 59.0.2-1 to 59.0.1-1
(Reading database ... 248272 files and directories currently installed.)
Preparing to unpack .../firefox_59.0.1-1_amd64.deb ...
Unpacking firefox (59.0.1-1) over (59.0.2-1) ...
Setting up firefox (59.0.1-1) ...
Processing triggers for firefox-trigger (1.0) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.8.2-1) ...

So I think it won't be causing any problems in the future.

> That sounds like the
> neatest solution, and I will make a note of it for my personal reference. Thanks.

Attachment: signature.asc
Description: OpenPGP digital signature