diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-04-08 15:21:07 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-04-08 15:21:07 +0530 |
commit | 468232b6bc498449bc9e1d733012733f7ebd1077 (patch) | |
tree | eb0b4dd968a22442c4ef9c94ef2f0c1f8d446d37 /scripts | |
parent | d5b6cc88f9308bfd73d9f9f7a2ef586ee1d1c79d (diff) | |
download | gstreamer-468232b6bc498449bc9e1d733012733f7ebd1077.tar.gz |
git-update: Make fetching of external repos non-fatal on the CI
Fixes intermittent failures when external repos have downtime. This is
common with GNOME Gitlab. Only error out on CI if a FDO gitlab repo
fails to fetch.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/240>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/common.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/common.py b/scripts/common.py index f9c19850d2..ec0cc707db 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -113,10 +113,17 @@ class Colors: -def git(*args, repository_path='.'): - return subprocess.check_output(["git"] + list(args), cwd=repository_path, - stdin=subprocess.DEVNULL, - stderr=subprocess.STDOUT).decode() +def git(*args, repository_path='.', fatal=True): + try: + ret = subprocess.check_output(["git"] + list(args), cwd=repository_path, + stdin=subprocess.DEVNULL, + stderr=subprocess.STDOUT).decode() + except subprocess.CalledProcessError as e: + if fatal: + raise e + print("Non-fatal error running git {}:\n{}".format(' '.join(args), e)) + return None + return ret def accept_command(commands): """Search @commands and returns the first found absolute path.""" |