Description of problem: If a postinstall script runs for a long enough time and produces output during this time, and you perform a 'dnf upgrade' that invokes such a postinstall script, dnf5 will repeatedly re-print the entire output to date every time it prints some sort of progress update, for example when it is removing now-upgraded packages. The specific situation I am seeing this in is during kernel upgrades, where the upgrade runs DKMS and DKMS re-runs the configuration process for ZFS on Linux's DKMS kernel module, which (slowly) produces the usual large amount of configure output. This entire multi-line output is then repeatedly printed out every time dnf prints a progress output for removing old kernel packages. dnf4 saved up the entire output of the postinstall and printed it out at once, at the end. I understand why dnf5 might want to do better, but the current result is essentially impossible to read and follow, and dnf5 provides no option to disable the progress reports or produce the output only at the end. Version-Release number of selected component (if applicable): dnf5-5.2.8.1-1.fc41.x86_64 How reproducible: Always.
I tried to reproduce the issue with this made-up package: ``` Name: test-scriptlet-output Epoch: 0 Version: 2.0 Release: 1 License: Public Domain URL: None Summary: The made up package for scriptlets testing. %description Successfully runs post scriptlet %post for i in {1..15}; do echo "Number: $i" sleep 2 done %files %changelog ``` The post-install scriptlet output was printed only once after the scriptlet finished. I must have missed something important to reproduce the issue. Can you share a print screen to illustrate the wrong behavior? You can also try to reproduce it with the latest nightly dnf5 build from copr repository https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-testing-nightly/ (there are some enhancement to progress bars behavior that are still not released).
I think I wasn't clear in my initial description; this requires other packages being upgraded at the same time, so that the script output from one package is intermixed with dnf's progress reporting of updating and removing other packages. As far as I know and have seen, if you update a single package with this sort of long-running script output, everything works fine. I have a test Fedora 41 VM with a DKMS kernel module, but my attempt to reproduce the problem under 'script' failed with a different problem, where DKMS didn't rebuild the module at all for some reason, so I'm going to have to do more work before I can provide a demonstration (which will be very noisy when I manage it).
I have a typescript now, from 'script' capturing a kernel upgrade with a DKMS module rebuild (OpenZFS), which I'll attach. When looking at the typescript, watch how the DKMS output is repeatedly shown in full each time DNF does a progress report about the package removal that happens concurrently with it.
Created attachment 2065312 [details] typescript of 'dnf upgrade' for a kernel upgrade with a DKMS package rebuild
Thanks for clarifying - I really appreciate the script recording! Now I can see what you mean and confirm the bug. It looks like the reproducer would require several post-transaction and file-triggered scripts to be present in the transaction.