Panu Matilainen 5a40a0
commit 94fb6eed6a7a8957152035c3156974fc00bc4b42
Panu Matilainen 5a40a0
Author: Jindrich Novy <jnovy@redhat.com>
Panu Matilainen 5a40a0
Date:   Mon Apr 4 16:03:11 2011 +0200
Panu Matilainen 5a40a0
Panu Matilainen 5a40a0
    Don't list packages which will not be created in spec query (RhBug:693338)
Panu Matilainen 5a40a0
    - particularly, while doing "rpm -q --specfile "
Panu Matilainen 5a40a0
Panu Matilainen 5a40a0
diff --git a/build/spec.c b/build/spec.c
Panu Matilainen 5a40a0
index 6861753..353ae47 100644
Panu Matilainen 5a40a0
--- a/build/spec.c
Panu Matilainen 5a40a0
+++ b/build/spec.c
Panu Matilainen 5a40a0
@@ -412,8 +412,10 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
Panu Matilainen 5a40a0
 
Panu Matilainen 5a40a0
     res = 0;
Panu Matilainen 5a40a0
     if (qva->qva_source == RPMQV_SPECRPMS) {
Panu Matilainen 5a40a0
-	for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next)
Panu Matilainen 5a40a0
+	for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
Panu Matilainen 5a40a0
+	    if (pkg->fileList == NULL) continue;
Panu Matilainen 5a40a0
 	    xx = qva->qva_showPackage(qva, ts, pkg->header);
Panu Matilainen 5a40a0
+	}
Panu Matilainen 5a40a0
     } else {
Panu Matilainen 5a40a0
 	xx = qva->qva_showPackage(qva, ts, spec->sourceHeader);
Panu Matilainen 5a40a0
     }