add_upstream_git_remote was just being run at beginning of every method using get_changed_packages or get_changed_files, to have upstream available to use get_base_commit. So then, just move it to get_base_commit. As a positive side-effect, since the previous commit get_base_commit will just use the gitlab variable if available. So in CI we will just completely avoid running these two commands! Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7078>
18 lines
522 B
Python
Executable File
18 lines
522 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright 2025 Stefan Hansson
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import common
|
|
import os.path
|
|
import subprocess
|
|
import sys
|
|
|
|
if __name__ == "__main__":
|
|
deviceinfo_files = {file for file in common.get_changed_files(removed=False)
|
|
if os.path.basename(file) == "deviceinfo"}
|
|
|
|
try:
|
|
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)
|
|
except subprocess.CalledProcessError as exception:
|
|
sys.exit(exception.returncode)
|