Blame SOURCES/BZ-1406891-verify-exit-status.patch

5b4f08
commit f62551849e0f8c5cc3151d78af0975fad831e8ed
5b4f08
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5b4f08
Date:   Tue Oct 18 10:31:11 2016 +0200
5b4f08
5b4f08
    yum-plugin-verify: set exit status to 1 in case of problems.
5b4f08
5b4f08
diff --git a/plugins/verify/verify.py b/plugins/verify/verify.py
5b4f08
index 108f96e..94eca26 100644
5b4f08
--- a/plugins/verify/verify.py
5b4f08
+++ b/plugins/verify/verify.py
5b4f08
@@ -287,6 +287,7 @@ Verify packages and display data on bad verifications"""
5b4f08
         
5b4f08
     def show_data(self, base, msg, pkgs, name):
5b4f08
         done = False
5b4f08
+        problem_found = False
5b4f08
         mcb = lambda x: base.matchcallback(x, [])
5b4f08
         for (pkg, results) in self.filter_data(msg, pkgs):
5b4f08
             if not done:
5b4f08
@@ -310,11 +311,13 @@ Verify packages and display data on bad verifications"""
5b4f08
                     (hib, hie) = ("", "")
5b4f08
                 done_prob = False
5b4f08
                 for problem in sorted(results[fname]):
5b4f08
+                    problem_found = True
5b4f08
                     if not done_prob and problem.file_types:
5b4f08
                         tags = ", ".join(problem.file_types)
5b4f08
                         msg("    Tags: " + hib + tags + hie)
5b4f08
                     self.show_problem(base, msg, problem, done_prob)
5b4f08
                     done_prob = True
5b4f08
+        return problem_found
5b4f08
 
5b4f08
     def doCommand(self, base, basecmd, extcmds):
5b4f08
         global _verify_configs
5b4f08
@@ -360,10 +363,10 @@ Verify packages and display data on bad verifications"""
5b4f08
             # nevr() match
5b4f08
             
5b4f08
         ypl = base.returnPkgLists(subgroup + extcmds)
5b4f08
-        self.show_data(base, msg, ypl.installed, 'Installed Packages')
5b4f08
-        self.show_data(base, msg, ypl.extras,    'Extra Packages')
5b4f08
+        result = (self.show_data(base, msg, ypl.installed, 'Installed Packages')
5b4f08
+                  or self.show_data(base, msg, ypl.extras,    'Extra Packages'))
5b4f08
 
5b4f08
-        return 0, [basecmd + ' done']
5b4f08
+        return result, [basecmd + ' done']
5b4f08
 
5b4f08
     def needTs(self, base, basecmd, extcmds):
5b4f08
         if not len(extcmds) or extcmds[0] != 'extras':
5b4f08
5b4f08
commit 7a94cf4434107bfcb32e60420af2106b993c7381
5b4f08
Author: Michal Domonkos <mdomonko@redhat.com>
5b4f08
Date:   Thu Feb 16 17:47:53 2017 +0100
5b4f08
5b4f08
    docs: verify: fix wording. BZ 1406891
5b4f08
5b4f08
diff --git a/docs/yum-verify.1 b/docs/yum-verify.1
5b4f08
index 5246a1c..1a8cc11 100644
5b4f08
--- a/docs/yum-verify.1
5b4f08
+++ b/docs/yum-verify.1
5b4f08
@@ -6,7 +6,7 @@ yum verify plugin
5b4f08
 \fByum\fP [options] verify [package ...]
5b4f08
 .SH "DESCRIPTION"
5b4f08
 .PP 
5b4f08
-This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm \-V. You can change how the verification is done and which files it applies to.
5b4f08
+This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm \-V. You can change how the verification is done and which files it applies to. In case any mismatches are found, the exit status is set to 1.
5b4f08
 .PP 
5b4f08
 added yum \fIcommand\fPs are:
5b4f08
 .br 
5b4f08
@@ -17,7 +17,7 @@ added yum \fIcommand\fPs are:
5b4f08
 .I \fR * verify-all
5b4f08
 .br 
5b4f08
 .PP 
5b4f08
-all of which take the same arguments as the list yum command, obviously you can
5b4f08
+all of which take the same arguments as the list yum command. You can
5b4f08
 only verify packages that are installed on the system.
5b4f08
 .PP
5b4f08
 .br 
5b4f08
@@ -29,8 +29,7 @@ output. It removes all false matches due to multilib and ignores changes to
5b4f08
 configuration files by default.
5b4f08
 .IP
5b4f08
 .IP "\fBverify-rpm\fP"
5b4f08
-Is meant to be 100% compatible with rpm \-V output, and any differences should be
5b4f08
-considered as bugs.
5b4f08
+Does the same checks as rpm \-V.
5b4f08
 .IP
5b4f08
 .IP "\fBverify-all\fP"
5b4f08
 Is used to list all the differences, including some that rpm itself will ignore.