build: Don't bail on OSError in git_sha1_gen.py
authorTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Wed, 2 Aug 2017 01:05:42 +0000 (03:05 +0200)
committerEric Engestrom <eric.engestrom@imgtec.com>
Wed, 2 Aug 2017 13:28:58 +0000 (14:28 +0100)
When building sandboxed, we may encounter additional errors. Ignore the errors,
as we are in a constrained environment.

This can be observed when building latest git with OBS.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
bin/git_sha1_gen.py

index 6d13db1e16f361961f760ed9e3f15cba5ecfcb8e..fe30084a4f87dfd7439bb608ed79ff343f47515a 100755 (executable)
@@ -16,5 +16,8 @@ try:
 except subprocess.CalledProcessError as e:
     # don't print anything if git fails
     pass
+except OSError as eos:
+    # don't fail on inaccessible files when sandboxed
+    pass
 else:
     sys.stdout.write('#define MESA_GIT_SHA1 "git-%s"\n' % git_sha1.rstrip())