[Rpm-maint] [rpm-software-management/rpm] API improvement to accommodate for RPM CoW (PR#1470) (Discussion #2057)

Panu Matilainen notifications at github.com
Tue Jun 7 12:35:23 UTC 2022


> Another new concept that needs to be introduced to the RPM plugin API is the ability for a plugin hook to stop the plugin chain from being executed. Currently, every plugin that registers to a specific hook is called as part of the plugin chain, regardless of whatever action may have been performed by a previous plugin. In cases such as installing file or creating the rpmfi iterator, as soon as a plugin has performed that action, the chain must be interrupted. In the current code, this is done by the introduction of the RPMRC_PLUGIN_CONTENTS return code.

I already said this in the original PR but maybe it got lost in the noise: this needs a different kind of API, interrupted chains is not a supportable concept. Something that allows the plugin to register as the owner of this payload format and the handler(s) called at appropriate times, with appropriate data. Such as the package file descriptor, and such as to actually install the file by reflinking it - AFAICS fsmUnpack(), or actually rpmfiArchiveReadToFilePsm() is the precise thing you'd want to replace with your own: you get a writable fd and you get to populate it with content by whatever means, while letting rpm handle all the other logic. That's about the extent of control I'm willing to consider handling to plugins.

So... what it all really comes down to is ability to define a custom archive type (see rpmfiNewArchiveReader()), and register them so that rpm knows to call it from fsmIter() in place of the internal default. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2057#discussioncomment-2897701
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/2057/comments/2897701 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220607/f5fbff39/attachment-0001.html>


More information about the Rpm-maint mailing list