scons: Ensure git_sha1.h's directory exists.
authorJose Fonseca <jfonseca@vmware.com>
Thu, 19 Mar 2015 13:31:37 +0000 (13:31 +0000)
committerJose Fonseca <jfonseca@vmware.com>
Sun, 22 Mar 2015 08:23:24 +0000 (08:23 +0000)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/SConscript

index cc5d24221c3fcc8d9322b93f6dd36e2c17939e4c..72d98117378f6b7d252d513b54ff8c2865591aa6 100644 (file)
@@ -130,7 +130,9 @@ def write_git_sha1_h_file(filename):
         (commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
     except:
         # git log command didn't work
-        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()