Skip to content

Commit

Permalink
mock: fix dynamic buildrequires unnecesarry loop
Browse files Browse the repository at this point in the history
per discussion here: rpm-software-management#434
Mock should accept return code 0 from rpm.

Relates: rpm-software-management#434
  • Loading branch information
hrnciar committed Feb 20, 2020
1 parent 6c9682c commit afbb79f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mock/py/mockbuild/backend.py
Expand Up @@ -699,7 +699,6 @@ def get_command(mode):
# * it fails
# * installSrpmDeps does nothing
# * or we run out of dynamic_buildrequires_max_loops tries
packages_before = self.buildroot.all_chroot_packages()
try:
self.buildroot.doChroot(get_command(['-br']),
shell=False, logger=self.buildroot.build_log, timeout=timeout,
Expand All @@ -712,14 +711,12 @@ def get_command(mode):
except Error as e:
if e.resultcode != 11:
raise e
finally:
max_loops -= 1
self.buildroot.root_log.info("Dynamic buildrequires detected")
self.buildroot.root_log.info("Going to install missing buildrequires")
buildreqs = glob.glob(bd_out + '/SRPMS/*.buildreqs.nosrc.rpm')
self.installSrpmDeps(*buildreqs)
packages_after = self.buildroot.all_chroot_packages()
if packages_after == packages_before:
success = True
for f_buildreqs in buildreqs:
os.remove(f_buildreqs)
if not sc:
Expand Down

0 comments on commit afbb79f

Please sign in to comment.