summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2019-11-03 13:26:35 +0100
committerDavid Ostrovsky <david@ostrovsky.org>2019-11-03 13:27:49 +0100
commit4cdd7f7d86f682c481480c75032cd9b47eface66 (patch)
tree2ce8c654cb8bc30bac0ccaedf4a7f6946f658d43
parenta7e95e5bc17359a638f1e7183abc28e71becf9be (diff)
Bazel: Special handling for plugins not under git control
To be compatible with the shell script, ignore "not a git repository error" and report "unknown" version. Change-Id: Ifa5dafea63743e6e09958f4283231c3eb7e45afe
-rw-r--r--tools/workspace_status.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/workspace_status.py b/tools/workspace_status.py
index eef864eee3..86df519ed5 100644
--- a/tools/workspace_status.py
+++ b/tools/workspace_status.py
@@ -29,8 +29,8 @@ def revision(directory, parent):
print('could not invoke git: %s' % err, file=sys.stderr)
sys.exit(1)
except subprocess.CalledProcessError as err:
- print('error using git: %s' % err, file=sys.stderr)
- sys.exit(1)
+ # ignore "not a git repository error" to report unknown version
+ return None
finally:
os.chdir(parent)
@@ -40,5 +40,5 @@ for d in os.listdir(os.path.join(ROOT, 'plugins')):
p = os.path.join('plugins', d)
if os.path.isdir(p):
v = revision(p, ROOT)
- if v:
- print('STABLE_BUILD_%s_LABEL %s' % (os.path.basename(p).upper(), v))
+ print('STABLE_BUILD_%s_LABEL %s' % (os.path.basename(p).upper(),
+ v if v else 'unknown'))