Browse Source

Backup dependency cache to save frustration when you accidentally hit a wrong option

rdb 16 years ago
parent
commit
5343fa0969
1 changed files with 5 additions and 0 deletions
  1. 5 0
      makepanda/makepandacore.py

+ 5 - 0
makepanda/makepandacore.py

@@ -319,6 +319,11 @@ def CxxGetIncludes(path):
 ########################################################################
 ########################################################################
 
 
 def SaveDependencyCache():
 def SaveDependencyCache():
+    try:
+        if (os.path.exists(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"))):
+            os.rename(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache-backup"),
+                      os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"))
+    except: pass
     try: icache = open(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"),'wb')
     try: icache = open(os.path.join(OUTPUTDIR, "tmp", "makepanda-dcache"),'wb')
     except: icache = 0
     except: icache = 0
     if (icache!=0):
     if (icache!=0):