Description of problem: SUBJ. Around the line 100 of /usr/bin/yum-builddep there's a check if self.doUtilBuildTransaction() is available with a sebsequent call in case it is. Trouble is that the functions is being called discarding the exit result: if hasattr(self, 'doUtilBuildTransaction'): self.doUtilBuildTransaction() else: try: self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if len(self.tsInfo) < 1: print 'No uninstalled build requires' sys.exit() Thus it is imposible to distinguish the fact that there are no uninstalled build requires on the system from the fact that there were some problems building the transaction. Here is my quick-n-dirty hack to solve the problem: if hasattr(self, 'doUtilBuildTransaction'): transresult = self.doUtilBuildTransaction() else: transresult = 0 try: transresult = self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if transresult != 0: msg = "There was a problem building the transaction, exiting.\n" self.logger.error(msg) sys.exit(1) if len(self.tsInfo) < 1: print 'No uninstalled build requires' sys.exit() Version-Release number of selected component (if applicable): yum-utils-1.1.30-2 How reproducible: Try to use yum-builddep to install buildreqs in a situation when it's imposible to solve the dependency graph. Steps to Reproduce: Imagine the following situation: there'are two versions of package libbar: 1.0 and 2.0. First one provides libbar.so.1, while second one provides libbar.so.2. In case we've got libbar >= 2.0 as a direct build dependency for a package, while other builddep packages require libbar-1.0 (i.e. libbar.so.1) - we're in trobles. Actual results: yum-builddep fails to solve the transaction and install builddeps. Not noticing the fact that there were problems it merely prints: "No uninstalled builddeps." and exits with 0 exit code. Expected results: yum-builddep should print that there were some problems resolving dependencies/building transaction and exit non-zero.
Hmm, looks like the dirty hack I mentioned seems to fail for a some reason. Looks like I need to dig deeper into yum-utils sources to solve it.
Well, being mainly asm/c/c++/php programmer it's really hard to write python or perl code. This way it works as I expect it to work: if hasattr(self, 'doUtilBuildTransaction'): transresult = self.doUtilBuildTransaction() else: transresult = 0 try: transresult = self.buildTransaction() except yum.Errors.YumBaseError, e: self.logger.critical("Error building transaction: %s" % e) sys.exit(1) if transresult > 0: msg = "There was a problem building the transaction, error code = %d exiting.\n" % transresult self.logger.error(msg) sys.exit(1) if len(self.tsInfo) < 1: print 'No uninstalled build requires' sys.exit()
*** This bug has been marked as a duplicate of bug 716267 ***