From 09cda2e74b8b4333874a87b00d8504baf56b767f Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 14 Jul 2004 18:14:49 +0000 Subject: [PATCH] * use sys.exit() instead of exit() * scons clean -> does a quick(er) clean. No need to think, just scons clean (it removes all content of root_build_dir) --- SConstruct | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index cb7871fa456..bf830390e7e 100644 --- a/SConstruct +++ b/SConstruct @@ -10,7 +10,7 @@ if sys.hexversion < 0x2030000: print "You need at least Python 2.3 to build Blender with SCons" print print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - exit() + sys.exit() if sys.platform != 'win32': sys.stdout = os.popen("tee build.log", "w") @@ -1322,11 +1322,21 @@ def printadd(env, target, source): def noaction(env, target, source): print "Empty action" -def DistClean(dir2clean): +def DoClean(dir2clean): """ Do a removal of the root_build_dir the fast way """ + import shutil + print "distcleaning... %s"%dir2clean + dirs = os.listdir(dir2clean) + for dir in dirs: + if os.path.isdir(dir2clean + "/" + dir) == 1: + print "clean dir %s"%(dir2clean+"/" + dir) + shutil.rmtree(dir2clean+"/" + dir) + else: + print "clean file %s"%(dir2clean+"/" + dir) + os.remove(dir2clean+"/" + dir) print "done" def BlenderDefault(target): @@ -1548,7 +1558,7 @@ if user_options_dict['BUILD_BLENDER_PLAYER'] == 1 and user_options_dict['BUILD_G release_target = env.Alias("release", BlenderRelease('blender$PROGSUFFIX')) default_target = env.Alias("default", BlenderDefault('blender$PROGSUFFIX')) wininst_target = env.Alias("winist", BlenderNSIS('blender$PROGSUFFIX')) -distclean_target = env.Alias("distclean", DistClean(root_build_dir)) +distclean_target = env.Alias("clean", DoClean(root_build_dir)) Default("default")