Panu Matilainen d2ca31
commit 1566c18b6efbda7b4c367f4c0ee31b4d5be2d2fe
Panu Matilainen d2ca31
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen d2ca31
Date:   Wed Aug 20 15:10:36 2014 +0300
Panu Matilainen d2ca31
Panu Matilainen d2ca31
    Delete trigger indexes too from header before adding again (RhBug:1131892)
Panu Matilainen d2ca31
    
Panu Matilainen d2ca31
    - Fixes regression introduced in the regression-fix
Panu Matilainen d2ca31
      commit 0bda2faa4de368a87f85084856a5fed701774acb, *facepalm*
Panu Matilainen d2ca31
    - Unlike other dependency types, trigger dependencies involve a fourth
Panu Matilainen d2ca31
      tag which we forgot to delete before adding again, causing duplicate
Panu Matilainen d2ca31
      trigger indexes
Panu Matilainen d2ca31
Panu Matilainen d2ca31
diff --git a/build/pack.c b/build/pack.c
Panu Matilainen d2ca31
index 4abca48..78a4f0e 100644
Panu Matilainen d2ca31
--- a/build/pack.c
Panu Matilainen d2ca31
+++ b/build/pack.c
Panu Matilainen d2ca31
@@ -617,8 +617,9 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
Panu Matilainen d2ca31
 	headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost());
Panu Matilainen d2ca31
 	headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
Panu Matilainen d2ca31
 
Panu Matilainen d2ca31
+	/* Nuke any previously added dependencies from the header */
Panu Matilainen d2ca31
+	headerDel(pkg->header, RPMTAG_TRIGGERINDEX);
Panu Matilainen d2ca31
 	for (int i=0; i
Panu Matilainen d2ca31
-	    /* Nuke any previously added dependencies from the header */
Panu Matilainen d2ca31
 	    headerDel(pkg->header, rpmdsTagN(pkg->dependencies[i]));
Panu Matilainen d2ca31
 	    headerDel(pkg->header, rpmdsTagEVR(pkg->dependencies[i]));
Panu Matilainen d2ca31
 	    headerDel(pkg->header, rpmdsTagF(pkg->dependencies[i]));