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

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