diff options
-rwxr-xr-x | mgagnome | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -1632,6 +1632,17 @@ class Package: return os.path.join(path, "SPECS", "%s.spec" % self.name) + def ensure_checkout(self): + """Ensure that the package is checked out""" + if not os.path.exists(self.spec_path): + try: + package.checkout() + except subprocess.CalledProcessError: + print('WARNING: Cannot checkout package %s. Skipping.' % self.name, file=sys.stderr) + return False + + return True + @retry(subprocess.CalledProcessError) def checkout(self, cwd=None, spec_only=False): """Check out a package from the repository""" @@ -1972,13 +1983,8 @@ def _cmd_clean_spec_multi(args): package = Downstream.package(package_name) cwd = package.path - path = os.path.join(cwd, "SPECS", "%s.spec" % package_name) - if not os.path.exists(path): - try: - package.checkout() - except subprocess.CalledProcessError: - print('WARNING: Cannot check package %s. Skipping.' % package_name, file=sys.stderr) - return False + if not package.ensure_checkout(): + return False spec = package.spec @@ -2017,11 +2023,9 @@ def _cmd_check_spec_multi(args): package = Downstream.package(package_name) cwd = package.path - path = os.path.join(cwd, "SPECS", "%s.spec" % package_name) - if not os.path.exists(path): + if not os.path.exists(package.spec_path): return False - spec = package.spec try: spec.patches |