Panu Matilainen 5ce01e
commit cac311c2ddb43b62ad9dbdb5543d50848eb9fd65
Panu Matilainen 5ce01e
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 5ce01e
Date:   Tue Sep 9 12:58:08 2014 +0300
Panu Matilainen 5ce01e
Panu Matilainen 5ce01e
    Regression the 13th: The Final Friday
Panu Matilainen 5ce01e
    
Panu Matilainen 5ce01e
    - Yet another regression from the recent dependency refactoring and
Panu Matilainen 5ce01e
      ensuing patches-on-patches-on-patches work: some rpmlib() dependencies
Panu Matilainen 5ce01e
      (payload, tilde) are added as late as writeRPM(), those have been going
Panu Matilainen 5ce01e
      to /dev/null recently.
Panu Matilainen 5ce01e
    - The fix actually removing code is probably a good sign...
Panu Matilainen 5ce01e
Panu Matilainen 5ce01e
diff --git a/build/pack.c b/build/pack.c
Panu Matilainen 5ce01e
index d25449f..74471d9 100644
Panu Matilainen 5ce01e
--- a/build/pack.c
Panu Matilainen 5ce01e
+++ b/build/pack.c
Panu Matilainen 5ce01e
@@ -438,6 +438,17 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
Panu Matilainen 5ce01e
     if (haveTildeDep(pkg->header))
Panu Matilainen 5ce01e
 	(void) rpmlibNeedsFeature(pkg, "TildeInVersions", "4.10.0-1");
Panu Matilainen 5ce01e
 
Panu Matilainen 5ce01e
+    /* All dependencies added finally, write them into the header */
Panu Matilainen 5ce01e
+    for (int i = 0; i < PACKAGE_NUM_DEPS; i++) {
Panu Matilainen 5ce01e
+	/* Nuke any previously added dependencies from the header */
Panu Matilainen 5ce01e
+	headerDel(pkg->header, rpmdsTagN(pkg->dependencies[i]));
Panu Matilainen 5ce01e
+	headerDel(pkg->header, rpmdsTagEVR(pkg->dependencies[i]));
Panu Matilainen 5ce01e
+	headerDel(pkg->header, rpmdsTagF(pkg->dependencies[i]));
Panu Matilainen 5ce01e
+	headerDel(pkg->header, rpmdsTagTi(pkg->dependencies[i]));
Panu Matilainen 5ce01e
+	/* ...and add again, now with automatic dependencies included */
Panu Matilainen 5ce01e
+	rpmdsPutToHeader(pkg->dependencies[i], pkg->header);
Panu Matilainen 5ce01e
+    }
Panu Matilainen 5ce01e
+
Panu Matilainen 5ce01e
     /* Create and add the cookie */
Panu Matilainen 5ce01e
     if (cookie) {
Panu Matilainen 5ce01e
 	rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime()));
Panu Matilainen 5ce01e
@@ -623,16 +634,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
Panu Matilainen 5ce01e
 	headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost());
Panu Matilainen 5ce01e
 	headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
Panu Matilainen 5ce01e
 
Panu Matilainen 5ce01e
-	for (int i=0; i
Panu Matilainen 5ce01e
-	    /* Nuke any previously added dependencies from the header */
Panu Matilainen 5ce01e
-	    headerDel(pkg->header, rpmdsTagN(pkg->dependencies[i]));
Panu Matilainen 5ce01e
-	    headerDel(pkg->header, rpmdsTagEVR(pkg->dependencies[i]));
Panu Matilainen 5ce01e
-	    headerDel(pkg->header, rpmdsTagF(pkg->dependencies[i]));
Panu Matilainen 5ce01e
-	    headerDel(pkg->header, rpmdsTagTi(pkg->dependencies[i]));
Panu Matilainen 5ce01e
-	    /* ...and add again, now with automatic dependencies included */
Panu Matilainen 5ce01e
-	    rpmdsPutToHeader(pkg->dependencies[i], pkg->header);
Panu Matilainen 5ce01e
-	}
Panu Matilainen 5ce01e
-
Panu Matilainen 5ce01e
 	if (spec->sourcePkgId != NULL) {
Panu Matilainen 5ce01e
 	    headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
Panu Matilainen 5ce01e
 	}
Panu Matilainen 5ce01e
@@ -714,16 +715,6 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
Panu Matilainen 5ce01e
     headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost());
Panu Matilainen 5ce01e
     headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
Panu Matilainen 5ce01e
 
Panu Matilainen 5ce01e
-    for (int i=0; i
Panu Matilainen 5ce01e
-	/* Nuke any previously added dependencies from the header */
Panu Matilainen 5ce01e
-	headerDel(sourcePkg->header, rpmdsTagN(sourcePkg->dependencies[i]));
Panu Matilainen 5ce01e
-	headerDel(sourcePkg->header, rpmdsTagEVR(sourcePkg->dependencies[i]));
Panu Matilainen 5ce01e
-	headerDel(sourcePkg->header, rpmdsTagF(sourcePkg->dependencies[i]));
Panu Matilainen 5ce01e
-	headerDel(sourcePkg->header, rpmdsTagTi(sourcePkg->dependencies[i]));
Panu Matilainen 5ce01e
-	/* ...and add again, now with automatic dependencies included */
Panu Matilainen 5ce01e
-	rpmdsPutToHeader(sourcePkg->dependencies[i], sourcePkg->header);
Panu Matilainen 5ce01e
-    }
Panu Matilainen 5ce01e
-
Panu Matilainen 5ce01e
     /* XXX this should be %_srpmdir */
Panu Matilainen 5ce01e
     {	char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL);
Panu Matilainen 5ce01e
 	char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL);