Blame SOURCES/BZ-817046-yum-builddep-respect-tolerant-ignore-missing-reqs.patch

7c4f07
commit 744cf9259ccec046a15ab5372270d931b7d74fc9
7c4f07
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
7c4f07
Date:   Thu Jul 2 16:21:22 2015 +0200
7c4f07
7c4f07
    yum-builddep: respect --tolerant to ignore missing dependencies
7c4f07
7c4f07
diff --git a/yum-builddep.py b/yum-builddep.py
7c4f07
index 7c40713..5f59ab8 100755
7c4f07
--- a/yum-builddep.py
7c4f07
+++ b/yum-builddep.py
7c4f07
@@ -145,7 +145,7 @@ class YumBuildDep(YumUtilBase):
7c4f07
                 self.logger.info('Enabling %s repository' % r.id)
7c4f07
                 r.enable()
7c4f07
 
7c4f07
-    def install_deps(self, deplist):
7c4f07
+    def install_deps(self, deplist, opts):
7c4f07
         errors = set()
7c4f07
         for dep in deplist:
7c4f07
             self.logger.debug(' REQ:  %s' % dep)                
7c4f07
@@ -165,7 +165,8 @@ class YumBuildDep(YumUtilBase):
7c4f07
         if errors:
7c4f07
             for i in sorted(errors):
7c4f07
                 self.logger.error("Error: %s" % i)
7c4f07
-            sys.exit(1)
7c4f07
+            if not opts.tolerant:
7c4f07
+                sys.exit(1)
7c4f07
 
7c4f07
     # go through each of the pkgs, figure out what they are/where they are 
7c4f07
     # if they are not a local package then run
7c4f07
@@ -226,7 +227,7 @@ class YumBuildDep(YumUtilBase):
7c4f07
 
7c4f07
         for srpm in toActOn:
7c4f07
             self.logger.info('Getting requirements for %s' % srpm)
7c4f07
-            self.install_deps(srpm.requiresList())
7c4f07
+            self.install_deps(srpm.requiresList(), opts)
7c4f07
     
7c4f07
         for name in specnames:
7c4f07
             # (re)load rpm config for target if set
7c4f07
@@ -248,7 +249,7 @@ class YumBuildDep(YumUtilBase):
7c4f07
                 buildreqs.append(d.DNEVR()[2:])
7c4f07
                 
7c4f07
             self.logger.info('Getting requirements for %s' % name)
7c4f07
-            self.install_deps(buildreqs)
7c4f07
+            self.install_deps(buildreqs, opts)
7c4f07
             
7c4f07
 if __name__ == '__main__':
7c4f07
     setup_locale()