Replies: 16 comments 1 reply
-
Not sure what you mean by Zypp not supporting transfiletrigger, all the (file or otherwise) triggers are implemented inside librpm and the only thing an API user such as Zypp can do about them is to explicitly disable (RPMTRANS_FLAG_NOFOO) Triggers lacking arguments is well known, but ... shockingly seems there's no upstream bug for that 😳 , just this: https://bugzilla.redhat.com/show_bug.cgi?id=1301677 I could've sworn we moved that to here ages ago but apparently not. The multitude of filetriggerin-runs comes from both the installed and the in-transaction package triggering, once for the existing files and once for the files in the transaction. I'd call this stuff file trigger design flaws, somewhat hard to fix now that it's widely deployed (typical chicken-egg situation: hard to develop such stuff when nobody is using it when it's experimental, hard to change flaws after declared stable so people would use it) |
Beta Was this translation helpful? Give feedback.
-
zypp installs rpms individually and disables transaction scripts: If a script knew why it was called it could probably decide to ignore the "useless" calls. Like eg by passing more arguments. Legacy scripts would not use them and continue to function. |
Beta Was this translation helpful? Give feedback.
-
Hmm, that seems strange. I get that with zypp doing multiple smaller transactions (IIRC), the transaction triggers would execute more often than just once, but since there will inevitably be far fewer partial transactions than packages, it'd still seem beneficial to do the expensive cache updates etc there. As for arguments, no argument there. "Just" a matter of designing and implementing something sane in that space, together with bunch of other semantics fixes/clarifications etc that real-world usage has pointed out to minimize disruption. |
Beta Was this translation helpful? Give feedback.
-
zypper calls the rpm command. So a new transaction for each package.. |
Beta Was this translation helpful? Give feedback.
-
s/zypper/zypp/ |
Beta Was this translation helpful? Give feedback.
-
At least for e.g.
After an upgrade of this package, every file in |
Beta Was this translation helpful? Give feedback.
-
The "proper" way would be to count the owners of the file, but calling |
Beta Was this translation helpful? Give feedback.
-
(Just FYI: libzypp will support posttrans file triggers soonish. So you could use that to do the info install after the uninstall.) |
Beta Was this translation helpful? Give feedback.
-
The problem with counting owners is that it's a per-file thing, and a file-trigger can match any arbitrary number of them, so the count would have to be per-file and so can't be in the global argument. I should've just dropped both the global arguments while at it... |
Beta Was this translation helpful? Give feedback.
-
The documentation says: "File triggers execute once for package". So unlike In this particular case, only the case that Though I currently wonder why |
Beta Was this translation helpful? Give feedback.
-
That's not true if the package containing the trigger is installed/erased (the so called "immed" case). Here, the trigger is called with a set of files coming from multiple packages. |
Beta Was this translation helpful? Give feedback.
-
In that case the triggering package is the package containing the trigger. |
Beta Was this translation helpful? Give feedback.
-
Speaking of file trigger issues: what's the deal with the %transfiletriggerpostun triggers? Why are they not fed a list of matching files so they can check if there is really something to do? And why is the implementation so weird? I don't see any reason for that rpmtriggersPrepPostUnTransFileTrigs() function, all it does can also be done at the end of the transaction. |
Beta Was this translation helpful? Give feedback.
-
Ran into this old issue while browsing around...
Hmm? AFAIK they should behave like the other triggers, if not then it sounds like a bug.
At the end of the transaction where posttrans really runs, the packages that would match are already be gone and the triggers would never run at all. Of course if you look at it from the Zypper POV of doing one package at a time transactions, many things will look drastically different, but that's not how rpm is intended to be used. |
Beta Was this translation helpful? Give feedback.
-
Moved to a discussion because this is so open-ended. We'll create tickets for individual things when we know what exactly to implement. |
Beta Was this translation helpful? Give feedback.
-
With the first argument to file triggers now implemented on master (as the number of instances of the triggered package to remain after the operation, much like with regular triggers), I wonder what the semantics of the second argument, if any, should be. I've submitted a PR (#2883) adding |
Beta Was this translation helpful? Give feedback.
-
Trying to implement file triggers for mandoc to register and unregister man pages in the whatis database I ran into some strange behavior. Note I can't use transfiletrigger as zypp doesn't support that :(
Beta Was this translation helpful? Give feedback.
All reactions