summaryrefslogtreecommitdiffstats
path: root/bin/git_sha1_gen.py
Commit message (Collapse)AuthorAgeFilesLines
* git_sha1_gen: create empty file in fallback pathEric Engestrom2017-10-301-0/+2
| | | | | | | | | | | I missed this part in my conversion, the old stream redirection meant the file was always created. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103496 Fixes: 7088622e5fb506b64c90 "buildsys: move file regeneration logic to the script itself" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* buildsys: move file regeneration logic to the script itselfEric Engestrom2017-10-271-1/+12
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* git_sha1_gen: use git_sha1.h.in on all build systemsEric Engestrom2017-10-161-1/+4
| | | | | | | | | | | | | | | Meson already uses this, let's get the other build sys to use it too. Note: rstrip() was dropped, as truncating to the first 10 chars already gets rid of the terminating newline (not an issue with the env var either, unless maliciously crafted to break the build... not sure this is a real-world issue). Verified to work and give the same output as before on both python 2 and 3 :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* git_sha1_gen: accept MESA_GIT_SHA1_OVERRIDE env varBrian Paul2017-10-101-13/+26
| | | | | | | | | | | | | | | | If one uses a parent build script to download/build Mesa we may not have a full git repository (maybe a tar archive) so the 'git rev-parse' command will fail. This updates the script to look for a MESA_GIT_SHA1_OVERRIDE env var. If it's set, use that sha1 instead of using git rev-parse. With this change we can put a git hash in the GL_VERSION string even when we don't have a git repo. v2: incorporate Dylan's suggestions to simplify the code Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* git_sha1_gen: fix output on python3Eric Engestrom2017-09-251-1/+1
| | | | | | | | | | | | | | | | String handling has changed on python3. Before this patch, on python3: #define MESA_GIT_SHA1 "git-b'b99dcbfeb3'" After: #define MESA_GIT_SHA1 "git-b99dcbfeb3" (No change on python2, it always looked ok) Cc: Jose Fonseca <[email protected]> Fixes: b99dcbfeb344390fea99 "build: Convert git_sha1_gen script to Python." Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* git_sha1_gen: catch any error the same wayEric Engestrom2017-08-021-5/+2
| | | | | Acked-by: Jose Fonseca <[email protected]> Signed-off-by: Eric Engestrom <[email protected]>
* build: Don't bail on OSError in git_sha1_gen.pyTobias Klausmann2017-08-021-0/+3
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* build: Convert git_sha1_gen script to Python.Jose Fonseca2017-08-011-0/+20
Python is the scripting language we've been using for scripts that need to run across all supported platforms. Shell is *not* a portable language for scripts. Reviewed-by: Eric Engestrom <[email protected]>