Panu Matilainen 13df4a
commit 8b540fbf1bb77320772b87d40518d761f62752b3
Panu Matilainen 13df4a
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 13df4a
Date:   Mon Aug 25 11:03:00 2014 +0300
Panu Matilainen 13df4a
Panu Matilainen 13df4a
    Resurrect rpmlib() dependencies on source rpms
Panu Matilainen 13df4a
    
Panu Matilainen 13df4a
    - Commit 0bda2faa4de368a87f85084856a5fed701774acb caused a regression
Panu Matilainen 13df4a
      where rpmlib() dependencies are no longer added to src.rpm packages
Panu Matilainen 13df4a
      as the header is populated early, whereas rpmlib() dependencies
Panu Matilainen 13df4a
      get added late in the game. So nothing was pushing the rpmlib
Panu Matilainen 13df4a
      stuff to header. Sigh.
Panu Matilainen 13df4a
Panu Matilainen 13df4a
diff --git a/build/pack.c b/build/pack.c
Panu Matilainen 13df4a
index 71d75f5..4aa4a66 100644
Panu Matilainen 13df4a
--- a/build/pack.c
Panu Matilainen 13df4a
+++ b/build/pack.c
Panu Matilainen 13df4a
@@ -708,6 +708,16 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
Panu Matilainen 13df4a
     headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost());
Panu Matilainen 13df4a
     headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
Panu Matilainen 13df4a
 
Panu Matilainen 13df4a
+    for (int i=0; i
Panu Matilainen 13df4a
+	/* Nuke any previously added dependencies from the header */
Panu Matilainen 13df4a
+	headerDel(sourcePkg->header, rpmdsTagN(sourcePkg->dependencies[i]));
Panu Matilainen 13df4a
+	headerDel(sourcePkg->header, rpmdsTagEVR(sourcePkg->dependencies[i]));
Panu Matilainen 13df4a
+	headerDel(sourcePkg->header, rpmdsTagF(sourcePkg->dependencies[i]));
Panu Matilainen 13df4a
+	headerDel(sourcePkg->header, rpmdsTagTi(sourcePkg->dependencies[i]));
Panu Matilainen 13df4a
+	/* ...and add again, now with automatic dependencies included */
Panu Matilainen 13df4a
+	rpmdsPutToHeader(sourcePkg->dependencies[i], sourcePkg->header);
Panu Matilainen 13df4a
+    }
Panu Matilainen 13df4a
+
Panu Matilainen 13df4a
     /* XXX this should be %_srpmdir */
Panu Matilainen 13df4a
     {	char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL);
Panu Matilainen 13df4a
 	char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL);