File fix-ghost-file-handling.diff of Package rpmlint

From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Thu, 9 Apr 2015 12:01:29 +0200
Subject: [PATCH] fix ghost file handling

always take into consideration the missingok files when checking for
missing ghost files.
---
 PostCheck.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/PostCheck.py b/PostCheck.py
index a87964a..aeb18d3 100644
--- a/PostCheck.py
+++ b/PostCheck.py
@@ -123,15 +123,15 @@ class PostCheck(AbstractCheck.AbstractCheck):
         if ghost_files:
             postin = pkg[rpm.RPMTAG_POSTIN]
             prein = pkg[rpm.RPMTAG_PREIN]
-            if not postin and not prein:
-                printWarning(pkg, 'ghost-files-without-postin')
-            else:
-                for f in ghost_files:
-                    if (not postin or f not in postin) and \
-                       (not prein or f not in prein) and \
-                       f not in pkg.missingOkFiles():
-                        printWarning(pkg,
-                                     'postin-without-ghost-file-creation', f)
+            for f in ghost_files:
+                if f in pkg.missingOkFiles():
+                    continue
+                if not postin and not prein:
+                    printWarning(pkg, 'ghost-files-without-postin')
+                if (not postin or f not in postin) and \
+                        (not prein or f not in prein):
+                    printWarning(pkg,
+                                 'postin-without-ghost-file-creation', f)
 
     def check_aux(self, pkg, files, prog, script, tag, prereq):
         if script:
openSUSE Build Service is sponsored by