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


Groups > linux.debian.user > #194238

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

From Sven Joachim <svenjoac@gmx.de>
Newsgroups linux.debian.user
Subject Re: How to execute user's scripts when upgrading a certain package via apt/aptitude
Date 2018-03-28 20:20 +0200
Message-ID <vynPX-6uS-1@gated-at.bofh.it> (permalink)
References <vymAx-5yN-5@gated-at.bofh.it> <vyndg-60Z-17@gated-at.bofh.it> <vynPX-6uS-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2018-03-28 19:46 +0200, Mikhail Morfikov wrote:

> On 2018-03-28 19:29, Sven Joachim wrote:
>> On 2018-03-28 18:29 +0200, Mikhail Morfikov wrote:
>> 
>>> I have some packages, for instance firefox, which need a little bit of
>>> customization from a user side. So basically when I install the new version of
>>> firefox, I also have to do some extra steps and so far I've been doing it
>>> manually because I don't know any better way.
>>>
>>> In the case of firefox, I have to create some hard links. Those hard links are
>>> used as additional executable files to be profiled in AppArmor. But when I
>>> upgrade my system, and firefox is on the package list, the hard links basically
>>> stop working and they have to be removed and recreated manually after the
>>> upgrade is done.
>>>
>>> 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?
>> 
>> You could use a dpkg trigger for that, a short intro how to do this is
>> on stackoverflow[1].  See also deb-triggers(5).
> Is this a solution for a user or rather for maintainer of the package? I think
> it's the second one and hence I can't use it.

It requires you to create your own package (since there is no other way
to register triggers in dpkg), but it does not have to contain any
files, you only need to include the triggers list and a postinst script
which manages the links.

An alternative is to use the dpkg's post-invoke option, but that is
rather inefficient, since it will be run on every dpkg invocation and
not only when one of the packages which interest you is
updated/installed/removed.

Cheers,
       Sven

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: How to execute user's scripts when upgrading a certain package via apt/aptitude Sven Joachim <svenjoac@gmx.de> - 2018-03-28 19:40 +0200
  Re: How to execute user's scripts when upgrading a certain package via apt/aptitude Sven Joachim <svenjoac@gmx.de> - 2018-03-28 20:20 +0200
    Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude <tomas@tuxteam.de> - 2018-03-28 20:50 +0200
      Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude "John Crawley (johnraff)" <john@bunsenlabs.org> - 2018-03-29 01:10 +0200
      Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude "John Crawley (johnraff)" <john@bunsenlabs.org> - 2018-03-29 01:10 +0200
    Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude Abdullah Ramazanoglu <ar018@yahoo.com> - 2018-03-29 02:20 +0200
      Re: How to execute user's scripts when upgrading a certain package  via apt/aptitude "John Crawley (johnraff)" <john@bunsenlabs.org> - 2018-03-30 04:10 +0200

csiph-web