The first commits are just prepwork for the actual change - add tests for all 
the possible scripts that can fail etc, the last one is the one with the actual 
change:

In rpm 4.4.x and earlier, scriptlet failures often caused duplicate packages to 
be left in the database: for example a %post scriptlet failing in an update 
would cause canceling the corresponding erasure element of the old version, but 
the files of the newer version are already on disk at this point. This caused 
all sorts of annoyances to the users, including missed security updates and 
having to periodically mop any failures out of the rpmdb. There was an entire 
ecosystem of tooling and documentation around this phenomena...

In 4.6.0 we started filtering out such "post" scriptlet errors in 
commit 9cfb380cc4529ea6b9314cc67819069c8e9c1a23 - behavior we've done ever 
since. This solved the duplicate syndrome and was good enough for the average 
system out there, but there are use-cases where one needs to know exactly 
whether things went 100% correctly or not. This has been raised several times 
in the intevening years, enough that I now think the implementation in 4.6.0 
was a mistake.

6.0 seems like a better time than most to change such a fundamental behavior 
again. Duplicates were useful for the one person actually troubleshooting it, 
but an annoying pain for the vast majority of users.  Thus, we're not 
bringing duplicates back, just reflecting ANY scriptlet errors in the 
transaction result code. The simplest way to achieve this is to just have a 
central "there was some failure" flag in the transaction set and base 
the final return code on that.

In other words, this is a middle ground between the old and current behavior: 
pre-scriptlets are logged as hard errors that cancel the element and its 
dependents (ie on upgrade, erasure element).  Post-scriptlets are still logged 
as warnings as the files have already been laid out and there's no going 
back, but it IS a sign that not all was well, and so we reflect it with a 
non-zero status from the transaction.

Update the tests to reflect the new expected return code.

Fixes: #2581
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/3819

-- Commit Summary --

  * Split scriptlet failure tests to separate RPMTEST_CHECK() cases
  * Add a missing sysusers keyword to couple of tests
  * Add a testcase for sysusers scriptlet error failing the package install
  * Add failure tests for all trigger and file trigger types
  * Reflect all scriptlet errors in rpmtsRun() return code

-- File Changes --

    M lib/rpmts_internal.hh (1)
    M lib/transaction.cc (3)
    A tests/data/SPECS/ftrigfail.spec (28)
    M tests/data/SPECS/triggers.spec (12)
    M tests/rpmi.at (17)
    M tests/rpmscript.at (487)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/3819.patch
https://github.com/rpm-software-management/rpm/pull/3819.diff

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

Message ID: <rpm-software-management/rpm/pull/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to