You are not logged in.

#1 2024-07-12 18:48:50

bendavis78
Member
Registered: 2014-06-21
Posts: 41

Detect which split package is being installed within .INSTALL script

I have a split PKGBUILD with an single install script, but that install script has a line that needs to run differently depending on which package is being installed. I'd rather not have to create two mostly identical .install scripts. Is there a way to inject a variable like `PKGNAME` into the install script before `.INSTALL` is added to the package? I can't seem to find where `.INSTALL` is added. It seems to be after `package()` is run, because if I do an `ls` at the end of `package()` the `.INSTALL` file is not there.

Offline

#2 2024-07-13 11:20:15

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,535

Re: Detect which split package is being installed within .INSTALL script

https://wiki.archlinux.org/title/PKGBUILD#install

https://wiki.archlinux.org/title/PKGBUILD#install wrote:

Each function is run chrooted inside the pacman install directory. See this thread.

pkgname , pkgver and such are internal to the PKGBUILD and don't exist / have no meaning when the .install script is run.

Also most of the functionality from .install scripts is now provided by pacman hooks

Please show us your PKGBUILD and the .install script you want to use.


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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB