teknoraver / rpms / rpm

Forked from rpms/rpm 3 months ago
Clone

Blame SOURCES/rpm-4.11.x-skipattr.patch

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