Bug 32423 - Provide URPMI hooks
Summary: Provide URPMI hooks
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-22 18:39 CEST by Jybz
Modified: 2024-03-08 16:52 CET (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Jybz 2023-10-22 18:39:16 CEST
The automation from multiple application grows.
For example:
- updating metric and keys in the TPM after kernel update
- removing very old kernels
- report for sysadm

there is currently no automatic way AFAIK.

I request a feature, the package manager provides hooks for packages.
Suggestion as example:
/etc/${packagemanager}/*kernel*/10_update_tpm.sh
/etc/${packagemanager}/modemmanager/10_send_sms_and_email.sh

I see that regular expression is not the best to be handled from filesystem...
/etc/packagemanager/any-label/configuration.conf
the configuration may contain the regular expression for packages
Marja Van Waes 2023-10-24 23:29:38 CEST

Assignee: bugsquad => mageiatools
CC: (none) => marja11, thierry.vignaud

Comment 1 Jybz 2023-11-25 13:12:39 CET
Any comment ?
Comment 2 Jybz 2023-12-30 13:38:04 CET
No comment ?
Comment 3 Jybz 2024-02-11 11:42:28 CET
No comment ?
Comment 4 Jybz 2024-03-08 09:01:25 CET
No comment…
Comment 5 Dave Hodgins 2024-03-08 15:02:53 CET
rpm already has hooks.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/

Duplicating that at the higher level of urpmi would require modifying not
just urpmi, bug dnf too, and anything done there should also be handled
when manually downloading a package and using rpm -i directly.

The only benefit I see for urpmi/dnf hooks would be allowing rpm to be
called multiple times, for example when force uninstalling a package
with a broken uninstall scriptlet, in order to allow an update to then
be installed cleanly.

CC: (none) => davidwhodgins

Comment 6 Jybz 2024-03-08 15:43:08 CET
Many thanks Dave for showing interrest.
I'm aware of the %post section in the rpm spec, but in my opinion we are mixing the scope. Rpm spec should only focus on the package itself, up to restarting some services. But nothing more.

System administrators may want to have custom script execution for any package update.

We can add to all spec a %post install section executing all scripts matching its name, but I believe it will be a dirty workarround.
Comment 7 Dave Hodgins 2024-03-08 16:52:11 CET
I still think the appropriate place for such a feature would be in rpm itself,
so that it doesn't matter which package manager (if any) is used to install
an update.

I can't think of many use cases for such a feature. Most cases where it
might have been useful also have timing requirements, such as next login,
next gui start, next boot, etc, so have other appropriate places, which
vary depending on which desktop environment (if any) is being used.

Justifying the work involved in changing both urpmi and dnf to handle such
a feature would require clear examples which don't have other existing
places that are more appropriate.

Note You need to log in before you can comment on or make changes to this bug.