radeonsi: change PIPE_SHADER to MESA_SHADER (si_dump_descriptors)
[mesa.git] / bin / git_sha1_gen.py
old mode 100755 (executable)
new mode 100644 (file)
index c624066..a457b31
@@ -1,11 +1,7 @@
-#!/usr/bin/env python
-
 """
 Generate the contents of the git_sha1.h file.
-The output of this script goes to stdout.
 """
 
-
 import argparse
 import os
 import os.path
@@ -23,11 +19,12 @@ def get_git_sha1():
             'rev-parse',
             'HEAD',
         ], stderr=open(os.devnull, 'w')).decode("ascii")
-    except:
+    except Exception:
         # don't print anything if it fails
         git_sha1 = ''
     return git_sha1
 
+
 def write_if_different(contents):
     """
     Avoid touching the output file if it doesn't need modifications
@@ -40,6 +37,7 @@ def write_if_different(contents):
     with open(args.output, 'w') as file:
         file.write(contents)
 
+
 parser = argparse.ArgumentParser()
 parser.add_argument('--output', help='File to write the #define in',
                     required=True)
@@ -47,6 +45,6 @@ args = parser.parse_args()
 
 git_sha1 = os.environ.get('MESA_GIT_SHA1_OVERRIDE', get_git_sha1())[:10]
 if git_sha1:
-    write_if_different('#define MESA_GIT_SHA1 "git-' + git_sha1 + '"')
+    write_if_different('#define MESA_GIT_SHA1 " (git-' + git_sha1 + ')"')
 else:
-    write_if_different('')
+    write_if_different('#define MESA_GIT_SHA1 ""')