#1474 Add short note to Directory_Replacement page
Closed by james. Opened by tjuhasz.
tjuhasz/packaging-committee master  into  master

Download 1474.patch

Hi,

I have recently tried to use the scriplet specified in this page of docs and came across issue which I feel could be documented.

I have tried to work on change in nodejs which would turn node_modules from a symlink to directory, but copying the scriplet from the documentation I still encountered conflicts upon attempting dnf upgrade.

Eventually I came across some python packages that have previously used this scriplet that also added the -n option to the scriplet header, to specify the package name and with this added to my change, the upgrade was successful.

It seems without it, the scriplet was never invoked by dnf upgrade. Based on my testing I believe that this is because nodejs specfile produces multiple rpms, that need to be installed simultaneously, in which case rpm doesn't know for which package should the scriplet be invoked.

Recent email exchange on fedora-devel (Strange rpm conflicts) - leads me to believe I am not the only one who dealt with this issue, as attempted usage of the scriplet (https://bugzilla.redhat.com/show_bug.cgi?id=2384303) had the same shortcoming as my first attempts and adding the -n option fixed it.

If there is anything about the way I wrote the note/or my placement of it, you don't like, please tell me and I will adjust it.

I'm slightly confused.

in which case rpm doesn't know for which package should the scriplet be invoked.

The -n <package name> flag for scriptlets has always been necessary to tell RPM for which (sub)package a scriptlet needs to be run?

I'm slightly confused.

in which case rpm doesn't know for which package should the scriplet be invoked.

The -n <package name> flag for scriptlets has always been necessary to tell RPM for which (sub)package a scriptlet needs to be run?

If it was I didn't notice anything written about this on any related documentation page, or the linked bugzilla threads.

I didn't mean specific to this issue, but in general.

For example, if you have a package foo that builds a package called foo-bar, then you need to write %post -n foo-bar too to have that %post scriptlet run on installation of foo-bar.

Right, looking at it retrospectively, it should have been obvious, but I'm not the most experience maintainer and sometimes intuition falters.

I wanted to add this note primary because of the mailing exchange, where the exact same issue was encountered and also because when I asked some other maintainers for help with my suggested scriplet, they didn't immediately know what was the issue.

I didn't mean specific to this issue, but in general.

For example, if you have a package foo that builds a package called foo-bar, then you need to write %post -n foo-bar too to have that %post scriptlet run on installation of foo-bar.

Pull-Request has been closed by james

Metadata