Web lists-archives.com

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




On 2018-03-28 18:58, Andy Smith wrote:
> Hi Mikhail,
> 
> 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.
> 
> Another option could be to build your own firefox package with a
> post-inst script that does what you want, but given the size and
> complexity of the firefox packages that is perhaps a bit ambitious.
> 
> Then, there is always the option of creating your own firefox
> executable which is a script that checks your environment, fixes it
> up if necessary, and then calls the real firefox binary.
I think hard links are fine, but I need some automatic way to also upgrade them
when the firefox package is upgraded.
> 
> Cheers,
> Andy
> 




Attachment: signature.asc
Description: OpenPGP digital signature