summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2017-12-13 12:26:24 +0200
committerPanu Matilainen <pmatilai@redhat.com>2018-03-28 13:28:09 +0300
commit08b2b2e5a262445be70e2a3e5709324777cad1a9 (patch)
tree88d42bc13b57ea76aad00f478e8bde82728b2c7b
parente414dc2af8d29ec0b38fe8d53cc27e102dc83f9d (diff)
downloadrpm-08b2b2e5a262445be70e2a3e5709324777cad1a9.tar.gz
Fix file lists getting fed to file triggers multiple times (#370)
A prefix can have arbitrary number of matches within a given header, but each header should be fed into the file list iteration just once. Otherwise we end up feeding the same file list over and over to the scriptlet - hundreds of megs or gigs of waste in worser cases. (cherry picked from commit e6effe3c91b66e822db571d3129e49164ddc45ba)
-rw-r--r--lib/rpmtriggers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c
index 743ba8dee..08ed14e0b 100644
--- a/lib/rpmtriggers.c
+++ b/lib/rpmtriggers.c
@@ -327,6 +327,8 @@ static const char *matchFilesNext(matchFilesIter mfi)
RPMDBI_DIRNAMES, mfi->pfx, 0);
rpmdbFilterIterator(mfi->pi, mfi->tranPkgs, 0);
+ /* Only walk through each header with matches once */
+ rpmdbUniqIterator(mfi->pi);
} while (fx >= 0);