> Hmm. I thought we wouldn't need any new NULL checks because I thought that's
> what happens with --noplugins anyway, but apparently --noplugins ends up
> initializing an empty rpmPlugins struct, and just falling through with that.
Oh, I didn't realize that. That seems like a good precedent for doing just
that, instead of messing around with NULL checks just to accommodate for this
very use case.
> One observation from a closer look is that we also have various per-te plugin
> hooks in psm, and those shouldn't be called on an src.rpm either. I don't
> think they get called currently ... yup, because the src.rpm unpack sneaks
> its way around it. It's weird that you can add src.rpm's to a transaction but
> then not do anything with them there. Except okay, check dependencies, _that_
> is why it's permitted.
Yeah, I don't think any non-fsm hooks get called for src.rpms. Only binary
packages are added to the transaction set in `rpmInstall()` so the code paths
eventually separate for binary and source packages (`rpmcliTransaction()` vs.
`rpmInstallSource()`). The tsm and psm hooks only fire when going through
`rpmcliTransaction()` (`rpmtsRun()` for the former, `rpmpsmRun()` for the
latter).
Running with `--debug` confirms this, too (no "calling hook" messages for
anything else than `init` when installing a src.rpm).
> So with all that, perhaps the easiest way is probably to temporarily replace
> ts->plugins with an empty set during rpmInstallSourcePackage().
Why would that be needed, though, assuming the above is true?
> Another possibility might be checking for src.rpm centrally from
> RPMPLUGINS_SET_HOOK_FUNC, we could pass a te/NULL to it and let it "return"
> NULL hookFunc for any src.rpm.
Right, that would indeed be another way, I'll exercise that as an option
:smile:
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3470#issuecomment-2519874103
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3470/c2519874...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint