[Rpm-maint] [rpm-software-management/rpm] Implement a transaction set change notification callback (#1367)

Jaroslav Rohel notifications at github.com
Fri Sep 25 06:19:47 UTC 2020


@pmatilai 
I am working on a new microdnf. I did some tests of your new C API. It is really an improvement. I have a better overview of the packages in the transaction now.

There is still a grey area for me. Transaction elements with scriptlets.
Example:
The "iftop" package reinstall action runs scripts from other packages that are installed but not part of the transaction.
New API provides transaction element (instead of header) in the calbacks. So I can see more information about scriptlets. I see: `rpmteType` is `TR_RPMDB` /*!< Package from the rpmdb. */, `rpmteParent` is `NULL`, `rpmteDependsOn` is `NULL`

The question is, who triggers this scriptlet? Dependency between scriptlets? It was a simple example. However, for a bigger transaction with multiple packages, the question is:  Why the scriptlet from installed package XY was started? Perhaps this is seen in the chronological order of callbacks.

**Anyway, I have more information than before. And the new C API is better and new callbacks helps.
I hope the new API will be merged soon. I especially need the C API as soon as possible. Now I use my own RPM build with your PR backported.**

===========================
### Example output from my new testing microdnf:
**microdnf reinstall iftop**
```
ts_change_callback: 1 0x90abd0 (nil) 0x7a9fe8
ts_change_callback: 1 0x7a1440 0x90abd0 0x7a9fe8

Running transaction:
[1/2] Verify package files                                 100% | 333.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                  100% |   7.0   B/s |   2.0   B |  00m00s
[3/4] Reinstalling iftop-0:1.0-1.0.x86_64                  100% |   4.2 MiB/s | 108.3 KiB |  00m00s
[4/4] Cleanup iftop-0:1.0-1.0.x86_64                       100% |  45.0   B/s |  11.0   B |  00m00s
>>> Running scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Stop scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Running scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Stop scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
---------------------------------------------------------------------------------------------------
[4/4] Total                                                100% | 206.0 KiB/s | 108.3 KiB |  00m00s


```
**microdnf reinstall man-db-0:2.9.0-3.fc32.x86_64**
```
ts_change_callback: 1 0x18fac80 (nil) 0x18f4788
ts_change_callback: 1 0x1938680 0x18fac80 0x18f4788

Running transaction:
[1/2] Verify package files                                 100% |  90.0   B/s |   1.0   B |  00m00s
[2/3] Prepare transaction                                  100% |   7.0   B/s |   2.0   B |  00m00s
>>> Running scriptlet: systemd-0:245.6-245.6.x86_64
>>> Stop scriptlet: systemd-0:245.6-245.6.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
[3/4] Reinstalling man-db-0:2.9.0-2.9.0.x86_64             100% |  12.1 MiB/s |   2.5 MiB |  00m00s
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
[4/4] Cleanup man-db-0:2.9.0-2.9.0.x86_64                  100% | 473.0   B/s | 326.0   B |  00m00s
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Running scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Stop scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Running scriptlet: systemd-0:245.6-245.6.x86_64
>>> Stop scriptlet: systemd-0:245.6-245.6.x86_64
>>> Running scriptlet: systemd-0:245.6-245.6.x86_64
>>> Stop scriptlet: systemd-0:245.6-245.6.x86_64
>>> Running scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Stop scriptlet: glibc-common-0:2.31-2.31.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Running scriptlet: man-db-0:2.9.0-2.9.0.x86_64
>>> Stop scriptlet: man-db-0:2.9.0-2.9.0.x86_64
---------------------------------------------------------------------------------------------------
[4/4] Total                                                100% |   2.2 MiB/s |   2.5 MiB |  00m01s
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1367#issuecomment-698744467
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200924/ce2766c8/attachment.html>


More information about the Rpm-maint mailing list