0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

Fix scons dist_clean

This commit is contained in:
Andy Schwerin 2012-01-20 23:03:12 -08:00
parent 2479794acd
commit e885029b8f
2 changed files with 15 additions and 15 deletions

View File

@ -1206,3 +1206,18 @@ Export("darwin windows solaris linux nix")
env.SConscript( 'src/SConscript', variant_dir=variantDir, duplicate=False )
env.SConscript( 'SConscript.smoke' )
def clean_old_dist_builds(env, target, source):
prefix = "mongodb-%s-%s" % (platform, processor)
filenames = sorted(os.listdir("."))
filenames = [x for x in filenames if x.startswith(prefix)]
to_keep = [x for x in filenames if x.endswith(".tgz") or x.endswith(".zip")][-2:]
for filename in [x for x in filenames if x not in to_keep]:
print "removing %s" % filename
try:
shutil.rmtree(filename)
except:
os.remove(filename)
env.Alias("dist_clean", [], [clean_old_dist_builds])
env.AlwaysBuild("dist_clean")

View File

@ -527,21 +527,6 @@ env.Alias( "install", "$INSTALL_DIR" )
# aliases
env.Alias( "mongoclient", '#/%s' % ( has_option( "sharedclient" ) and sharedClientLibName or clientLibName ) )
def clean_old_dist_builds(env, target, source):
prefix = "mongodb-%s-%s" % (platform, processor)
filenames = sorted(os.listdir("."))
filenames = [x for x in filenames if x.startswith(prefix)]
to_keep = [x for x in filenames if x.endswith(".tgz") or x.endswith(".zip")][-2:]
for filename in [x for x in filenames if x not in to_keep]:
print "removing %s" % filename
try:
shutil.rmtree(filename)
except:
os.remove(filename)
env.Alias("dist_clean", [], [clean_old_dist_builds])
env.AlwaysBuild("dist_clean")
# client dist
def build_and_test_client(env, target, source):
from subprocess import call