scons: Fix git_sha1.h generation fallback.
authorJose Fonseca <jfonseca@vmware.com>
Mon, 23 Mar 2015 10:48:31 +0000 (10:48 +0000)
committerJose Fonseca <jfonseca@vmware.com>
Wed, 25 Mar 2015 10:42:26 +0000 (10:42 +0000)
I didn't meant to remove the 'if not os.path.exists(filename)' statement.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/SConscript

index a563fd2ff0153dbe0dd69d4ad56de2953e63fbf3..5b80a216feffd226047d32880d90082075a6198b 100644 (file)
@@ -130,9 +130,10 @@ def write_git_sha1_h_file(filename):
         (commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
     except:
         # git log command didn't work
-        dirname = os.path.dirname(filename)
-        if not os.path.exists(dirname):
-            os.makedirs(dirname)
+        if not os.path.exists(filename):
+            dirname = os.path.dirname(filename)
+            if not os.path.exists(dirname):
+                os.makedirs(dirname)
             # create an empty file if none already exists
             f = open(filename, "w")
             f.close()