You are not logged in.

#1 2017-03-12 14:48:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,910

[SOLVED] pacman hook or .install file ?

Upstream for the aur openrc package i am co-maintainer of has decided to split of some functionality into  a separate package [1] .

I am writing a PKGBUILD for the new package and realised i need to execute 2 commands after installation, and upon removal of the package those commands should be reversed.


These commands are specific to this package and I doubt they are usable for other packages.
In the past i would have used the post_install / post_remove functions of a  .install-file for this.

We do have pacman hooks now and i could use them.

Since the commands differ i expect to need 2 pacman hooks .

Which would be better in this case, one .install-file or 2 pacman hooks ?


[1]https://github.com/OpenRC/openrc/blob/master/NEWS.md , OpenRC-0.23

Last edited by Lone_Wolf (2017-03-13 12:10:40)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#2 2017-03-12 22:43:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] pacman hook or .install file ?

These commands are specific to this package and I doubt they are usable for other packages.

That removes the main reason to use a hook.

So don't use a hook unless the commands specifically have to be run after all transactions have occurred (which is something install scripts are incapable of). mkinitcpio  is a good example of where this matters.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-03-13 12:10:16

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,910

Re: [SOLVED] pacman hook or .install file ?

Thanks,

that confirms my feeling this use-case is best served by a .install-file .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB