Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-02-09 Thread Panu Matilainen
Closed #2755 as completed via 7f59c7dd2f4ff1476bec5c59f37babb1fd231e5a.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#event-11755075899
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-02-02 Thread Michal Domonkos
As for arg2 and the question of "should it be an aggregate count?", I've come 
to realize that it actually should **not** be an aggregate since that would 
prevent the script from detecting a package upgrade. It would also be 
inconsistent with regular triggers. Hence, no aggregate count in #2883.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1924136730
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-24 Thread Michal Domonkos
> Note that there's no technical reason for _not_ adding the second argument 
> (the number of triggering packages) to transaction scriplets here, too. It's 
> the same code path underneath.

OK, looking closer, the challenge with transactional file triggers and package 
counts is that we can't easily obtain the correct value for each involved 
package since we're iterating through *all files* in the transaction set, as 
opposed to each transaction element separately (as we do with non-transactional 
file triggers). This is done for performance reasons (I suppose) so changing it 
just to add a second argument to transactional file triggers doesn't seem worth 
it.

After all, the original requirements of this ticket explicitly mention 
non-trans file triggers. I guess @pmatilai knew what he was talking about when 
filing this ticket, after all :smile: 

> Whether it's useful or not is another question but I'll probably lean towards 
> consistency here and include it.

So nope, taking it back. Let's stick with the plan and only do this for the 
non-trans variants.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1908268213
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-16 Thread Michal Domonkos
Note that there's no technical reason for *not* adding the second argument (the 
number of triggering packages) to transaction scriplets here, too. It's the 
same code path underneath.

Whether it's useful or not is another question but I'll probably lean towards 
consistency here and include it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1893488090
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-05 Thread Michal Domonkos
Good point! We shouldn't just blindly copy what the normal triggers do here. 
There's enough difference that it makes sense to step back for a moment and 
think about what functionality and use cases we really want to cover. Thanks, 
I'll take that into account :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1878665857
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-05 Thread Panu Matilainen
The thing to ponder about is whether there are other arguments that should be 
passed in addition or in stead of these. The only "vision" or "design" behind 
this ticket description is "something close enough to other scriptlets that 
someone familiar with should feel at home". Which may leave some room for 
improvement from a more technical perspective :laughing: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1878658506
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-05 Thread Michal Domonkos
Thanks, the part about usefulness is actually on point :smile: That said, I 
haven't given it too much thought either, this is just the most obvious 
solution that comes to mind. I'll ponder about it a bit more but there's 
probably not much to ponder about anyway.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1878622612
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-05 Thread Panu Matilainen
Aggregate is what I thought of when writing the description, I don't see 
anything else making much sense. But, it's not like I've given this any deep 
meditation. Usefulness is all that matters for the arguments, otherwise we 
could just as well not bother :sweat_smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1878608308
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2024-01-05 Thread Michal Domonkos
> * Non-trans scriptlets have should get a second argument reflecting the 
> triggering package count

I wonder if we want the triggering package count (`arg2`) to be an *aggregate* 
count of all the triggering packages or just that of the *first* match?

There's a subtle difference in the semantics between regular triggers and file 
triggers in the way they are fired. A regular trigger can only ever be 
triggered by *one* package (e.g. `%triggerin -- foo, bar, baz` means "fire if 
any of these packages is installed"), whereas a file trigger can be triggered 
by *multiple* packages (e.g. `%filetriggerin -- /etc/foo.d` means "fire if any 
file with such a prefix is installed, regardless of which package it belongs 
to").

In both cases, the trigger only executes once, however the semantics of "which 
package triggered it" differs. Therefore, for regular triggers, `arg2` is 
straightforward (it's always the one triggering package), however for file 
triggers, it's not.

As an example, consider the following scenario:

```
# bar.spec:
%filetriggerin -- /etc/foo.d

# foo.spec:
%files
/etc/foo.d/foo.conf

# baz.spec:
%files
/etc/foo.d/baz.conf
```

If `bar` is installed first, installing `foo` or `baz` afterwards results in 
the trigger being run once for *each* of those, so the triggering count 
(`arg2`) is straighforward (same as with regular triggers).

However, if `foo` *and* `baz` are installed first, installing `bar` afterwards 
results in the trigger being run once for *both* of those (with both filenames 
served via stdin), so the trigerring count (`arg2`) is now ambiguous - it can 
either be the count of `foo` *or* `baz`, or it can be the sum of both.

My take: The count should be an aggregate since that enables a file trigger 
script to detect when *all* the files subject to the prefix are being removed 
(which is one of the purposes of the arguments in the first place).

Any thoughts?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755#issuecomment-1878388267
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RFE: file trigger scriptlet arguments (Issue #2755)

2023-11-08 Thread Panu Matilainen
Splitting this from #2655 as this is a clearly separate thing that should be 
doable without massive redesign of the whole thing:

- First argument should reflect the triggered package count
- Non-trans scriptlets have should get a second argument reflecting the 
triggering package count

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2755
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint