Skip to content
Snippets Groups Projects
Commit 9e05a12c authored by Brian Carrier's avatar Brian Carrier
Browse files

Clarified branch

parent eb48ae6f
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2017 Basis Technology. # Copyright (c) 2017 Basis Technology.
# #
# This software is distributed under the Common Public License 1.0 # This software is distributed under the Common Public License 1.0
#
# Updates the TSK dependency repos (libewf, etc.), compiles them, and
# compiles various TSK platforms using the current branch
import codecs import codecs
import datetime import datetime
...@@ -21,11 +24,13 @@ ...@@ -21,11 +24,13 @@
# save the build log in the output directory # save the build log in the output directory
LOG_PATH = os.path.join(CURRENT_PATH, 'output', time.strftime("%Y.%m.%d-%H.%M.%S")) LOG_PATH = os.path.join(CURRENT_PATH, 'output', time.strftime("%Y.%m.%d-%H.%M.%S"))
MINIMAL = False MINIMAL = False
def pullAndBuildAllDependencies(branch):
def pullAndBuildAllDependencies(depBranch):
''' '''
Compile libewf, libvhdi, libvmdk. Compile libewf, libvhdi, libvmdk.
Args: Args:
branch: String, which branch to compile (currently only support master) depBranch: String, which branch to compile (currently only support master)
''' '''
# Passed is a global variable that gets set to false # Passed is a global variable that gets set to false
# When an error occurs # When an error occurs
...@@ -42,11 +47,11 @@ def pullAndBuildAllDependencies(branch): ...@@ -42,11 +47,11 @@ def pullAndBuildAllDependencies(branch):
checkPathExist(vmdkHome) checkPathExist(vmdkHome)
# git update libewf, libvhdi and libvmdk # git update libewf, libvhdi and libvmdk
if(passed): if(passed):
gitPull(ewfHome, "libewf_64bit", branch) gitPull(ewfHome, "libewf_64bit", depBranch)
if(passed): if(passed):
gitPull(vhdiHome, "libvhdi_64bit", branch) gitPull(vhdiHome, "libvhdi_64bit", depBranch)
if(passed): if(passed):
gitPull(vmdkHome, "libvmdk_64bit", branch) gitPull(vmdkHome, "libvmdk_64bit", depBranch)
if not MINIMAL: if not MINIMAL:
# build 32-bit of libewf, libvhdi, libvmdk and TSK # build 32-bit of libewf, libvhdi, libvmdk and TSK
...@@ -250,15 +255,14 @@ def usage(): ...@@ -250,15 +255,14 @@ def usage():
''' '''
Print out how to use this script. Print out how to use this script.
''' '''
print('Usage: python3 updataBuildlibs.py [[-h | --help, -b <branch> | --branch=<branch>, -m | --minimal]') print('Usage: python3 updateAndBuildLibs.py [[-h | --help, -b <branch> | --branch=<branch>, -m | --minimal]')
print('branch is which branch to build and is optional. Currently only works for master') print('branch: Branch for dependencies (master is default)')
print('-m,--minimal use this option for postgres build') print('-m,--minimal: Build 64-bit PostgreSQL only')
sys.stdout.flush() sys.stdout.flush()
sys.exit(1) sys.exit(1)
def main(): def main():
#by default we use master branch to update the source depBranch = 'master'
branch = 'master'
global MINIMAL global MINIMAL
try: try:
opts, args = getopt.getopt(sys.argv[1:],"mhb:",['help','minimal','branch=']) opts, args = getopt.getopt(sys.argv[1:],"mhb:",['help','minimal','branch='])
...@@ -271,18 +275,18 @@ def main(): ...@@ -271,18 +275,18 @@ def main():
if o in ("-m","--minimal"): if o in ("-m","--minimal"):
MINIMAL = True MINIMAL = True
elif o in ("-b","--branch"): elif o in ("-b","--branch"):
branch = a depBranch = a
elif o in ("-h","--help"): elif o in ("-h","--help"):
usage() usage()
system.exit(2) system.exit(2)
print('Updating source by %s branch.' % branch)
if not os.path.exists(LOG_PATH): if not os.path.exists(LOG_PATH):
os.makedirs(LOG_PATH) os.makedirs(LOG_PATH)
if not os.path.exists(MSBUILD_PATH): if not os.path.exists(MSBUILD_PATH):
print("MS_BUILD Does not exist") print("MS_BUILD Does not exist")
sys.stdout.flush() sys.stdout.flush()
pullAndBuildAllDependencies(branch)
pullAndBuildAllDependencies(depBranch)
buildTSKAll() buildTSKAll()
class OS: class OS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment