diff --git a/.ci/lib/apkbuild_linting.py b/.ci/lib/apkbuild_linting.py index cfe0425ef..5f77d5dbe 100755 --- a/.ci/lib/apkbuild_linting.py +++ b/.ci/lib/apkbuild_linting.py @@ -41,7 +41,6 @@ if __name__ == "__main__": custom_valid_options += kconfigcheck_categories os.environ["CUSTOM_VALID_OPTIONS"] = " ".join(custom_valid_options) - common.add_upstream_git_remote() apkbuilds = {file for file in common.get_changed_files(removed=False) if os.path.basename(file) == "APKBUILD"} if len(apkbuilds) < 1: diff --git a/.ci/lib/build_changed_aports.py b/.ci/lib/build_changed_aports.py index c88195c51..6f54444b2 100755 --- a/.ci/lib/build_changed_aports.py +++ b/.ci/lib/build_changed_aports.py @@ -32,7 +32,6 @@ if __name__ == "__main__": arch = sys.argv[1] # Get and print modified packages - common.add_upstream_git_remote() packages = common.get_changed_packages() # Load context diff --git a/.ci/lib/check_changed_aports_versions.py b/.ci/lib/check_changed_aports_versions.py index 41788ac3e..b0eb3793c 100755 --- a/.ci/lib/check_changed_aports_versions.py +++ b/.ci/lib/check_changed_aports_versions.py @@ -216,7 +216,6 @@ Thank you and sorry for the inconvenience. if __name__ == "__main__": # Get and print modified packages - common.add_upstream_git_remote() packages = common.get_changed_packages() if len(packages) == 0: print("no aports changed in this branch") diff --git a/.ci/lib/check_changed_kernels.py b/.ci/lib/check_changed_kernels.py index 27cdd93b1..88a46cc08 100755 --- a/.ci/lib/check_changed_kernels.py +++ b/.ci/lib/check_changed_kernels.py @@ -75,8 +75,6 @@ def show_error_all(): if __name__ == "__main__": - common.add_upstream_git_remote() - if "kconfigcheck.toml" in common.get_changed_files(): print("kconfigcheck.toml changed -> checking all kernels") if not check_kconfig_all(): diff --git a/.ci/lib/common.py b/.ci/lib/common.py index 0f008de5c..83a4fa304 100755 --- a/.ci/lib/common.py +++ b/.ci/lib/common.py @@ -32,13 +32,6 @@ def run_git(parameters, check=True, stderr=None): return None -def add_upstream_git_remote(): - """ Add a remote pointing to postmarketOS/pmaports. """ - run_git(["remote", "add", "upstream", - "https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False) - run_git(["fetch", "-q", "upstream"]) - - def commit_message_has_string(needle): base_commit = get_base_commit() @@ -102,6 +95,11 @@ def get_base_commit() -> str: if commit is not None: return commit + # Add a remote pointing to postmarketOS/pmaports + run_git(["remote", "add", "upstream", + "https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False) + run_git(["fetch", "-q", "upstream"]) + branch_upstream = f"upstream/{get_upstream_branch()}" commit_head = run_git(["rev-parse", "HEAD"])[:-1] commit_upstream = run_git(["rev-parse", branch_upstream])[:-1] diff --git a/.ci/lib/deviceinfo_linting.py b/.ci/lib/deviceinfo_linting.py index af78acccd..4c579e88b 100755 --- a/.ci/lib/deviceinfo_linting.py +++ b/.ci/lib/deviceinfo_linting.py @@ -8,7 +8,6 @@ import subprocess import sys if __name__ == "__main__": - common.add_upstream_git_remote() deviceinfo_files = {file for file in common.get_changed_files(removed=False) if os.path.basename(file) == "deviceinfo"} diff --git a/.ci/lib/generate_build_jobs.py b/.ci/lib/generate_build_jobs.py index f5af6c0d7..e609e7f53 100755 --- a/.ci/lib/generate_build_jobs.py +++ b/.ci/lib/generate_build_jobs.py @@ -184,7 +184,6 @@ if __name__ == "__main__": devices_under_test = set() packages_modified = set() # Get and print modified packages - common.add_upstream_git_remote() for file in common.get_changed_files(): path = Path(file) diff --git a/.ci/lib/verify_checksums.py b/.ci/lib/verify_checksums.py index 72ae12b49..26c5c6b74 100755 --- a/.ci/lib/verify_checksums.py +++ b/.ci/lib/verify_checksums.py @@ -26,7 +26,6 @@ def verify_checksums(packages): if __name__ == "__main__": # Get and print modified packages - common.add_upstream_git_remote() packages = common.get_changed_packages() # Load context