summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2019-06-26 15:41:17 +0200
committerFlorian Festi <ffesti@redhat.com>2019-07-22 16:42:15 +0200
commit0fcf8c2b8692fbe06b0bb353247f9d70c91c14a1 (patch)
tree4942a2c32aca7b0943e75e1a19ce0083cad5deb9 /lib/verify.c
parentff42a556e68763a90d014a4f70e267bc8f1b2ed9 (diff)
downloadrpm-0fcf8c2b8692fbe06b0bb353247f9d70c91c14a1.tar.gz
Use an erase element to delete packages with same NEVRA
Rpm used to rely on the "replacepkgs hack" to get rid of the old header entry when reinstalling a package. This has a number of problems when the headers are not identical or different install flags were used. To mitigate this, a '--reinstall' option was added that made rpm use an erase element in this case. This commit takes this one step further by changing the code to also use an erase element in the --upgrade case. The code is mostly simpler, but we need a different implementation for commit fd40d58efa, as we now have erase elements both for --reinstall and --upgrade. Thus we need to store the addop in the transaction element. The commit does not change the behaviour of 'rpm --install'.
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/verify.c b/lib/verify.c
index b135e8548..469328d9f 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -246,7 +246,7 @@ static int rpmVerifyScript(rpmts ts, Header h)
if (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)) {
/* fake up a transaction element */
- rpmte p = rpmteNew(ts, h, TR_RPMDB, NULL, NULL);
+ rpmte p = rpmteNew(ts, h, TR_RPMDB, NULL, NULL, 0);
if (p != NULL) {
rpmteSetHeader(p, h);