mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
TOOLS-198 add option to support packaging tools in tarball
This commit is contained in:
parent
ae333bc94a
commit
2c7d34a2fd
@ -304,6 +304,8 @@ add_option( "use-system-yaml", "use system version of yaml", 0, True )
|
||||
|
||||
add_option( "use-system-all" , "use all system libraries", 0 , True )
|
||||
|
||||
add_option( "use-new-tools" , "put new tools in the tarball", 0 , False )
|
||||
|
||||
add_option( "use-cpu-profiler",
|
||||
"Link against the google-perftools profiler library",
|
||||
0, False )
|
||||
|
@ -1022,6 +1022,7 @@ env.Library("alltools",
|
||||
"$BUILD_DIR/mongo/db/repl/replmocks"])
|
||||
|
||||
normalTools = [ "dump", "restore", "export", "import", "shim", "stat", "top", "oplog" ]
|
||||
rewrittenTools = [ "mongodump", "mongorestore", "mongoexport", "mongoimport", "mongostat", "mongotop", "bsondump", "mongofiles", "mongooplog" ]
|
||||
env.Alias( "tools", [ "#/${PROGPREFIX}mongo" + name + "${PROGSUFFIX}" for name in normalTools ] )
|
||||
for name in normalTools:
|
||||
env.Install( '#/', env.Program("mongo" + name,
|
||||
@ -1275,9 +1276,29 @@ def installBinary( e, name ):
|
||||
if nix:
|
||||
e.AddPostAction( inst, 'chmod 755 $TARGET' )
|
||||
|
||||
for t in ["mongo" + x for x in normalTools] + ["mongofiles", "bsondump", "mongoperf" ]:
|
||||
installBinary( env, t )
|
||||
env.Alias("tools", '#/' + add_exe(t))
|
||||
def installExternalBinary( e, name ):
|
||||
global distBinaries
|
||||
|
||||
name = env.File( "#/%s" % add_exe(name) )
|
||||
|
||||
distBinaries.append(name)
|
||||
inst = e.Install( "$INSTALL_DIR/bin", name )
|
||||
|
||||
if nix:
|
||||
e.AddPostAction( inst, 'chmod 755 $TARGET' )
|
||||
|
||||
if has_option("use-new-tools"):
|
||||
for t in rewrittenTools:
|
||||
installExternalBinary(env, "src/mongo-tools/" + t)
|
||||
|
||||
# old tools + tools not rewritten yet
|
||||
for t in ["mongoperf", "mongoshim"]:
|
||||
installBinary( env, t )
|
||||
env.Alias("tools", '#/' + add_exe(t))
|
||||
else:
|
||||
for t in ["mongo" + x for x in normalTools] + ["mongofiles", "bsondump", "mongoperf" ]:
|
||||
installBinary( env, t )
|
||||
env.Alias("tools", '#/' + add_exe(t))
|
||||
|
||||
env.Alias("tools", "#/" + add_exe("perftest"))
|
||||
env.Alias("tools", "#/" + add_exe("mongobridge"))
|
||||
@ -1331,6 +1352,8 @@ env.Command(
|
||||
module_banner_transforms + [
|
||||
'--transform ${str(Dir(BUILD_DIR))}/mongo/stripped=$SERVER_DIST_BASENAME/bin',
|
||||
'--transform ${str(Dir(BUILD_DIR))}/mongo=$SERVER_DIST_BASENAME/bin',
|
||||
'--transform ${str(Dir(BUILD_DIR))}/mongo/stripped/src/mongo-tools=$SERVER_DIST_BASENAME/bin',
|
||||
'--transform src/mongo-tools=$SERVER_DIST_BASENAME/bin',
|
||||
'${TEMPFILE(SOURCES[1:])}']))
|
||||
|
||||
#final alias
|
||||
|
Loading…
Reference in New Issue
Block a user