From fd1a0147f4d20e6edf9c765fb12377f3e8b7b2c9 Mon Sep 17 00:00:00 2001 From: Dalton Miner Date: Mar 03 2022 17:02:43 +0000 Subject: Check for centpkg separately from git server addr Currently, this will fail and tell you to install centpkg if you're using any git server address rather than the redhat/centos-stream one. To fix, the check that looks for the centpkg binary needs to be separate from the address comparison. --- diff --git a/distgit-obsimport.py b/distgit-obsimport.py index 3938ac9..57bc868 100755 --- a/distgit-obsimport.py +++ b/distgit-obsimport.py @@ -144,15 +144,16 @@ repo_commit = git_repository[git_repository.head.target].hex # Fetch Dist-Git resources # XXX: There's not a nice API available to do this cleanly, so subprocessing it is :( -if "gitlab.com/redhat/centos-stream" in args.git_server_addr and os.path.exists("/usr/bin/centpkg"): - try: - subprocess.run("centpkg sources", shell=True, cwd=git_checkout_dir, check=True, universal_newlines=True) - except subprocess.CalledProcessError: - print("Failed to fetch Dist-Git sources!") - sys.exit(5) -else: - print("centpkg is missing, please install it!") - sys.exit(6) +if "gitlab.com/redhat/centos-stream" in args.git_server_addr: + if os.path.exists("/usr/bin/centpkg"): + try: + subprocess.run("centpkg sources", shell=True, cwd=git_checkout_dir, check=True, universal_newlines=True) + except subprocess.CalledProcessError: + print("Failed to fetch Dist-Git sources!") + sys.exit(5) + else: + print("centpkg is missing, please install it!") + sys.exit(6) # XXX: There's not a nice API available to do this cleanly, so subprocessing it is :( if os.path.exists("/usr/bin/fedpkg"):