wuyuoss / rpms / rpm

Forked from rpms/rpm 3 years ago
Clone
3791cf
diff --git a/lib/query.c b/lib/query.c
3791cf
index 6f2d593a7..8a2623241 100644
3791cf
--- a/lib/query.c
3791cf
+++ b/lib/query.c
3791cf
@@ -150,8 +150,8 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h)
3791cf
 	if ((qva->qva_flags & QUERY_FOR_LICENSE) && !(fflags & RPMFILE_LICENSE))
3791cf
 	    continue;
3791cf
 
3791cf
-	/* If not querying %ghost, skip ghost files. */
3791cf
-	if ((qva->qva_fflags & RPMFILE_GHOST) && (fflags & RPMFILE_GHOST))
3791cf
+	/* Skip on attributes (eg from --noghost) */
3791cf
+	if (fflags & qva->qva_fflags)
3791cf
 	    continue;
3791cf
 
3791cf
 	if (qva->qva_flags & QUERY_FOR_STATE) {
3791cf
diff --git a/lib/verify.c b/lib/verify.c
3791cf
index eb6f2e15e..df17a7b01 100644
3791cf
--- a/lib/verify.c
3791cf
+++ b/lib/verify.c
3791cf
@@ -378,10 +378,11 @@ static const char * stateStr(rpmfileState fstate)
3791cf
  * @param ts		transaction set
3791cf
  * @param h		header to verify
3791cf
  * @param omitMask	bits to disable verify checks
3791cf
- * @param ghosts	should ghosts be verified?
3791cf
+ * @param skipAttr	skip files with these attrs (eg %ghost)
3791cf
  * @return		0 no problems, 1 problems found
3791cf
  */
3791cf
-static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts)
3791cf
+static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask,
3791cf
+			rpmfileAttrs skipAttrs)
3791cf
 {
3791cf
     rpmVerifyAttrs verifyResult = 0;
3791cf
     int ec = 0;		/* assume no problems */
3791cf
@@ -398,8 +399,8 @@ static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts)
3791cf
 	char ac;
3791cf
 	int rc;
3791cf
 
3791cf
-	/* If not verifying %ghost, skip ghost files. */
3791cf
-	if ((fileAttrs & RPMFILE_GHOST) && !ghosts)
3791cf
+	/* Skip on attributes (eg from --noghost) */
3791cf
+	if (skipAttrs & fileAttrs)
3791cf
 	    continue;
3791cf
 
3791cf
 	rc = rpmVerifyFile(ts, fi, &verifyResult, omitMask);
3791cf
@@ -494,7 +495,6 @@ static int verifyDependencies(rpmts ts, Header h)
3791cf
 int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
3791cf
 {
3791cf
     rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS);
3791cf
-    int ghosts = (qva->qva_fflags & RPMFILE_GHOST);
3791cf
     int ec = 0;
3791cf
     int rc;
3791cf
 
3791cf
@@ -503,7 +503,7 @@ int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
3791cf
 	    ec = rc;
3791cf
     }
3791cf
     if (qva->qva_flags & VERIFY_FILES) {
3791cf
-	if ((rc = verifyHeader(ts, h, omitMask, ghosts)) != 0)
3791cf
+	if ((rc = verifyHeader(ts, h, omitMask, qva->qva_fflags)) != 0)
3791cf
 	    ec = rc;
3791cf
     }
3791cf
     if (qva->qva_flags & VERIFY_SCRIPT) {