termux-pacman / pacman-for-termux

Special configured pacman for termux.
https://termux-pacman.dev
MIT License
73 stars 6 forks source link

`post_install()` isn't run #24

Closed stevenxxiu closed 3 months ago

stevenxxiu commented 3 months ago

Recently I added the https://github.com/termux/termux-packages/blob/ab539a2c2fa5b10757193d148841b479bf485b72/packages/pueue/build.sh package to Termux.

post_install() doesn't appear to run when I install this. I don't get :: Running post-transaction hooks....

$ pacman --sync pueue
warning: pueue-3.4.1-0 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) pueue-3.4.1-0

Total Installed Size:  10.30 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                     100%
(1/1) checking package integrity                   100%
(1/1) loading package files                        100%
(1/1) checking for file conflicts                  100%
(1/1) checking available disk space                100%
:: Processing package changes...
(1/1) reinstalling pueue                           100%

Is this reproducible or is there some issue with my config? My Pacman config is fairly vanilla.

Maxython commented 3 months ago

The post_install() function is only run when the package is fully installed on the device, i.e. it will not be run when the package is reinstalled or updated.

To make the post_install() function run after reinstalling or upgrading a package, you must use the post_upgrade() function. Here's an example to help you understand how to implement this in the Termux package: https://github.com/termux-pacman/termux-packages/blob/master/packages/python-pip/build.sh#L56