[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14605] trunk/blender/SConstruct: * improve the clean code.

Nathan Letwory jesterking at letwory.net
Mon Apr 28 21:48:58 CEST 2008


Revision: 14605
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14605
Author:   jesterking
Date:     2008-04-28 21:48:44 +0200 (Mon, 28 Apr 2008)

Log Message:
-----------
* improve the clean code. Instead of doing it the dumb way, do it smarter.

Modified Paths:
--------------
    trunk/blender/SConstruct

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct	2008-04-28 19:21:51 UTC (rev 14604)
+++ trunk/blender/SConstruct	2008-04-28 19:48:44 UTC (rev 14605)
@@ -264,23 +264,18 @@
     if os.path.exists(B.root_build_dir):
         print B.bc.HEADER+'Cleaning...'+B.bc.ENDC
         dirs = os.listdir(B.root_build_dir)
-        for dir in dirs:
-            if os.path.isdir(B.root_build_dir + dir) == 1:
-                print "clean dir %s"%(B.root_build_dir+dir)
-                shutil.rmtree(B.root_build_dir+dir)
+        for entry in dirs:
+            if os.path.isdir(B.root_build_dir + entry) == 1:
+                print "clean dir %s"%(B.root_build_dir+entry)
+                shutil.rmtree(B.root_build_dir+entry)
+            else: # remove file
+                print "remove file %s"%(B.root_build_dir+entry)
+                os.remove(B.root_build_dir+entry)
         for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
                 'extern/xvidcore/build/generic/platform.inc']:
             if os.path.exists(confile):
                 print "clean file %s"%confile
                 os.remove(confile)
-
-        if platform in ('win32-vc', 'win32-mingw'):
-            makesdnafile = B.root_build_dir+'makesdna.exe'
-        else:
-            makesdnafile = B.root_build_dir+'makesdna'
-        if os.path.exists(makesdnafile):
-            print "removing", makesdnafile
-            os.remove(makesdnafile)
         print B.bc.OKGREEN+'...done'+B.bc.ENDC
     else:
         print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC





More information about the Bf-blender-cvs mailing list