diff options
Diffstat (limited to 'ACE/bin/make_release.py')
-rwxr-xr-x | ACE/bin/make_release.py | 159 |
1 files changed, 64 insertions, 95 deletions
diff --git a/ACE/bin/make_release.py b/ACE/bin/make_release.py index 0df8863ad15..3962288d9a3 100755 --- a/ACE/bin/make_release.py +++ b/ACE/bin/make_release.py @@ -4,7 +4,7 @@ # @file make_release.py # @author William R. Otte <wotte@dre.vanderbilt.edu> # -# Packaging script for ACE/TAO/CIAO/DAnCE +# Packaging script for ACE/TAO from __future__ import with_statement from time import strftime @@ -40,7 +40,8 @@ This dict contains entries of the form COMPONENT_version COMPONENT_beta COMPONENT_minor -COMPONENT_major """ +COMPONENT_major +COMPONENT_code """ comp_versions = dict () old_comp_versions = dict () @@ -83,7 +84,7 @@ def parse_args (): parser.add_option ("--root", dest="repo_root", action="store", help="Specify an alternate repository root", - default="https://github.com/DOCGroup/ATCD.git") + default="https://github.com/DOCGroup/ACE_TAO.git") parser.add_option ("--mpc_root", dest="mpc_root", action="store", help="Specify an alternate MPC repository root", @@ -163,9 +164,9 @@ def commit (files): import shutil, os global comp_versions - version = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], - comp_versions["ACE_minor"], - comp_versions["ACE_beta"]) + version = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) vprint ("Committing the following files for " + version + " ".join (files)) if opts.take_action: @@ -181,10 +182,10 @@ def check_workspace (): """ Checks that the DOC and MPC repositories are up to date. """ global opts, doc_root try: - ex ("cd $DOC_ROOT/ATCD && git pull -p") - print "Successfully updated ACE/TAO/CIAO/DAnCE working copy" + ex ("cd $DOC_ROOT/ACE_TAO && git pull -p") + print "Successfully updated ACE/TAO working copy" except: - print "Unable to update ACE/TAO/CIAO/DAnCE workspace at " + doc_root + print "Unable to update ACE/TAO workspace at " + doc_root raise try: @@ -231,16 +232,22 @@ def update_version_files (component): ## Update component/component/Version.h version_header = """ // -*- C++ -*- -// This is file was automatically generated by \$ACE_ROOT/bin/make_release.py +// This is file was automatically generated by $ACE_ROOT/bin/make_release.py #define %s_MAJOR_VERSION %s #define %s_MINOR_VERSION %s +#define %s_MICRO_VERSION %s #define %s_BETA_VERSION %s #define %s_VERSION \"%s\" +#define %s_VERSION_CODE %s +#define %s_MAKE_VERSION_CODE(a,b,c) (((a) << 16) + ((b) << 8) + (c)) """ % (component, comp_versions[component + "_major"], component, comp_versions[component + "_minor"], component, comp_versions[component + "_beta"], - component, comp_versions[component + "_version"]) + component, comp_versions[component + "_beta"], + component, comp_versions[component + "_version"], + component, comp_versions[component + "_code"], + component) if opts.take_action: with open (component + '/' + component.lower () + "/Version.h", 'r+') as version_h: @@ -285,7 +292,7 @@ def update_spec_file (): global comp_versions, opts - with open (doc_root + "/ATCD/ACE/rpmbuild/ace-tao.spec", 'r+') as spec_file: + with open (doc_root + "/ACE_TAO/ACE/rpmbuild/ace-tao.spec", 'r+') as spec_file: new_spec = "" for line in spec_file.readlines (): if line.find ("define ACEVER ") is not -1: @@ -308,7 +315,7 @@ def update_spec_file (): print "New spec file:" print "".join (new_spec) - return [doc_root + "/ATCD/ACE/rpmbuild/ace-tao.spec"] + return [doc_root + "/ACE_TAO/ACE/rpmbuild/ace-tao.spec"] def update_debianbuild (): """ Updates ACE_ROOT/debian directory. @@ -332,7 +339,7 @@ def update_debianbuild (): mask = re.compile ("(libace|libkokyu|libtao)(.*)(\d+\.\d+\.\d+)(.*)") tao = re.compile ("tao", re.IGNORECASE) - for fname in glob.iglob(doc_root + '/ATCD/ACE/debian/*'): + for fname in glob.iglob(doc_root + '/ACE_TAO/ACE/debian/*'): print "Considering " + fname match = None @@ -365,7 +372,7 @@ def update_debianbuild (): else: return match.group (1) + match.group (2) + comp_versions["ACE_version"] + match.group (4) - with open (doc_root + "/ATCD/ACE/debian/debian.control", 'r+') as control_file: + with open (doc_root + "/ACE_TAO/ACE/debian/debian.control", 'r+') as control_file: new_ctrl = "" for line in control_file.readlines (): if re.search ("^(Package|Depends|Suggests):", line) is not None: @@ -384,7 +391,7 @@ def update_debianbuild (): print "New control file:" print "".join (new_ctrl) - files.append (doc_root + "/ATCD/ACE/debian/debian.control") + files.append (doc_root + "/ACE_TAO/ACE/debian/debian.control") # rewrite debian/dsc dsc_lines = """Format: 1.0 @@ -399,7 +406,7 @@ Files: """ % (comp_versions["ACE_version"], comp_versions["TAO_version"], comp_versions["ACE_version"]) if opts.take_action: - with open (doc_root + "/ATCD/ACE/debian/ace.dsc", 'r+') as dsc_file: + with open (doc_root + "/ACE_TAO/ACE/debian/ace.dsc", 'r+') as dsc_file: dsc_file.seek (0) dsc_file.truncate (0) dsc_file.writelines (dsc_lines) @@ -407,7 +414,7 @@ Files: print "New dsc file:\n" print dsc_lines - files.append (doc_root + "/ATCD/ACE/debian/ace.dsc") + files.append (doc_root + "/ACE_TAO/ACE/debian/ace.dsc") return files @@ -420,19 +427,13 @@ def get_and_update_versions (): try: get_comp_versions ("ACE") get_comp_versions ("TAO") - get_comp_versions ("CIAO") - get_comp_versions ("DAnCE") if opts.update: files = list () files += update_version_files ("ACE") files += update_version_files ("TAO") - files += update_version_files ("CIAO") - files += update_version_files ("DAnCE") files += create_changelog ("ACE") files += create_changelog ("TAO") - files += create_changelog ("CIAO") - files += create_changelog ("DAnCE") files += update_spec_file () files += update_debianbuild () @@ -450,12 +451,12 @@ def create_changelog (component): global old_comp_versions, comp_versions, opts - old_tag = "ACE+TAO+CIAO-%d_%d_%d" % (old_comp_versions["ACE_major"], - old_comp_versions["ACE_minor"], - old_comp_versions["ACE_beta"]) + old_tag = "ACE+TAO-%d_%d_%d" % (old_comp_versions["ACE_major"], + old_comp_versions["ACE_minor"], + old_comp_versions["ACE_beta"]) # Generate changelogs per component - ex ("cd $DOC_ROOT/ATCD && git log " + old_tag + "..HEAD " + component + " > " + component + "/ChangeLogs/" + component + "-" + comp_versions[component + "_version_"]) + ex ("cd $DOC_ROOT/ACE_TAO && git log " + old_tag + "..HEAD " + component + " > " + component + "/ChangeLogs/" + component + "-" + comp_versions[component + "_version_"]) return ["%s/ChangeLogs/%s-%s" % (component, component, comp_versions[component + "_version_"])] @@ -535,6 +536,11 @@ def get_comp_versions (component): str (comp_versions[component + "_minor"]) + '_' + \ str (comp_versions[component + "_beta"]) + comp_versions [component + "_code"] = \ + str((comp_versions[component + "_major"] << 16) + \ + (comp_versions[component + "_minor"] << 8) + \ + comp_versions[component + "_beta"]) + old_comp_versions [component + "_version"] = \ str (old_comp_versions[component + "_major"]) + '.' + \ str (old_comp_versions[component + "_minor"]) + '.' + \ @@ -564,10 +570,10 @@ def update_latest_tag (which, branch): # Remove tag locally vprint ("Removing tag %s" % (tagname)) - ex ("cd $DOC_ROOT/ATCD && git tag -d " + tagname) + ex ("cd $DOC_ROOT/ACE_TAO && git tag -d " + tagname) vprint ("Placing tag %s" % (tagname)) - ex ("cd $DOC_ROOT/ATCD && git tag -a " + tagname + " -m\"" + tagname + "\"") + ex ("cd $DOC_ROOT/ACE_TAO && git tag -a " + tagname + " -m\"" + tagname + "\"") def push_latest_tag (which, branch): @@ -577,23 +583,23 @@ def push_latest_tag (which, branch): if opts.push: # Remove tag in the remote orgin - ex ("cd $DOC_ROOT/ATCD && git push origin :refs/tags/" + tagname) + ex ("cd $DOC_ROOT/ACE_TAO && git push origin :refs/tags/" + tagname) vprint ("Pushing tag %s" % (tagname)) - ex ("cd $DOC_ROOT/ATCD && git push origin " + tagname) + ex ("cd $DOC_ROOT/ACE_TAO && git push origin " + tagname) def tag (): """ Tags the DOC and MPC repositories for the version and push that remote """ global comp_versions, opts - tagname = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], - comp_versions["ACE_minor"], - comp_versions["ACE_beta"]) + tagname = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) if opts.tag: if opts.take_action: - vprint ("Placing tag %s on ATCD" % (tagname)) - ex ("cd $DOC_ROOT/ATCD && git tag -a " + tagname + " -m\"" + tagname + "\"") + vprint ("Placing tag %s on ACE_TAO" % (tagname)) + ex ("cd $DOC_ROOT/ACE_TAO && git tag -a " + tagname + " -m\"" + tagname + "\"") vprint ("Placing tag %s on MPC" % (tagname)) ex ("cd $DOC_ROOT/MPC && git tag -a " + tagname + " -m\"" + tagname + "\"") @@ -609,7 +615,7 @@ def tag (): if comp_versions["ACE_beta"] == 1: update_latest_tag ("BFO", tagname) else: - vprint ("Placing tag %s on ATCD" % (tagname)) + vprint ("Placing tag %s on ACE_TAO" % (tagname)) vprint ("Placing tag %s on MPC" % (tagname)) print "Creating tags:\n" print "Placing tag " + tagname + "\n" @@ -618,17 +624,17 @@ def push (): """ Tags the DOC and MPC repositories for the version and push that remote """ global comp_versions, opts - tagname = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], - comp_versions["ACE_minor"], - comp_versions["ACE_beta"]) + tagname = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) if opts.push: if opts.take_action: - vprint ("Pushing ATCD master to origin") - ex ("cd $DOC_ROOT/ATCD && git push origin master") + vprint ("Pushing ACE_TAO master to origin") + ex ("cd $DOC_ROOT/ACE_TAO && git push origin master") - vprint ("Pushing tag %s on ATCD" % (tagname)) - ex ("cd $DOC_ROOT/ATCD && git push origin tag " + tagname) + vprint ("Pushing tag %s on ACE_TAO" % (tagname)) + ex ("cd $DOC_ROOT/ACE_TAO && git push origin tag " + tagname) vprint ("Pushing tag %s on MPC" % (tagname)) ex ("cd $DOC_ROOT/MPC && git push origin tag " + tagname) @@ -644,7 +650,7 @@ def push (): if comp_versions["ACE_beta"] == 1: push_latest_tag ("BFO", tagname) else: - vprint ("Pushing tag %s on ATCD" % (tagname)) + vprint ("Pushing tag %s on ACE_TAO" % (tagname)) vprint ("Pushing tag %s on MPC" % (tagname)) print "Pushing tags:\n" print "Pushing tag " + tagname + "\n" @@ -656,13 +662,13 @@ def export_wc (stage_dir): global doc_root, comp_versions - tag = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], - comp_versions["ACE_minor"], - comp_versions["ACE_beta"]) + tag = "ACE+TAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) # Clone the ACE repository with the needed tag print ("Retrieving ACE with tag " + tag) - ex ("git clone --depth 1 --branch " + tag + " " + opts.repo_root + " " + stage_dir + "/ATCD") + ex ("git clone --depth 1 --branch " + tag + " " + opts.repo_root + " " + stage_dir + "/ACE_TAO") # Clone the MPC repository with the needed tag print ("Retrieving MPC with tag " + tag) @@ -670,13 +676,9 @@ def export_wc (stage_dir): # Settting up stage_dir print ("Moving ACE") - ex ("mv " + stage_dir + "/ATCD/ACE " + stage_dir + "/ACE_wrappers") + ex ("mv " + stage_dir + "/ACE_TAO/ACE " + stage_dir + "/ACE_wrappers") print ("Moving TAO") - ex ("mv " + stage_dir + "/ATCD/TAO " + stage_dir + "/ACE_wrappers/TAO") - print ("Moving CIAO") - ex ("mv " + stage_dir + "/ATCD/CIAO " + stage_dir + "/ACE_wrappers/TAO/CIAO") - print ("Moving DAnCE") - ex ("mv " + stage_dir + "/ATCD/DAnCE " + stage_dir + "/ACE_wrappers/TAO/DAnCE") + ex ("mv " + stage_dir + "/ACE_TAO/TAO " + stage_dir + "/ACE_wrappers/TAO") print ("Moving MPC") ex ("mv " + stage_dir + "/MPC " + stage_dir + "/ACE_wrappers/MPC") @@ -835,7 +837,7 @@ def write_file_lists (comp, text, bin): outfile.close () def package (stage_dir, package_dir, decorator): - """ Packages ACE, ACE+TAO, and ACE+TAO+CIAO releases of current + """ Packages ACE, ACE+TAO releases of current staged tree, with decorator appended to the name of the archive. """ from os.path import join from os import remove @@ -871,7 +873,7 @@ def package (stage_dir, package_dir, decorator): # for TAO: text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO"), - "ACE_wrappers/TAO", ["CIAO", "DAnCE", ".gitignore"]) + "ACE_wrappers/TAO", [".gitignore"]) # write_file_lists ("fTAO" + decorator, text_files, bin_files) update_packages ("\n".join (text_files), @@ -881,35 +883,6 @@ def package (stage_dir, package_dir, decorator): move_packages ("ACE+TAO" + decorator, stage_dir, package_dir) - text_files = list () - bin_files = list () - - # for DAnCE: - text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO/DAnCE"), - "ACE_wrappers/TAO/DAnCE", [".gitignore"]) - -# write_file_lists ("fTAO" + decorator, text_files, bin_files) - update_packages ("\n".join (text_files), - "\n".join (bin_files), - stage_dir, - package_dir) - - move_packages ("ACE+TAO+DAnCE" + decorator, stage_dir, package_dir) - - text_files = list () - bin_files = list () - # for CIAO: - text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO/CIAO"), - "ACE_wrappers/TAO/CIAO", [".gitignore"]) - -# write_file_lists ("fCIAO" + decorator, text_files, bin_files) - update_packages ("\n".join (text_files), - "\n".join (bin_files), - stage_dir, - package_dir) - - move_packages ("ACE+TAO+CIAO" + decorator, stage_dir, package_dir) - def generate_workspaces (stage_dir): """ Generates workspaces in the given stage_dir """ print "Generating workspaces..." @@ -923,19 +896,17 @@ def generate_workspaces (stage_dir): os.putenv ("ACE_ROOT", os.path.join (stage_dir, "ACE_wrappers")) os.putenv ("MPC_ROOT", os.path.join (stage_dir, "ACE_wrappers", "MPC")) os.putenv ("TAO_ROOT", os.path.join (stage_dir, "ACE_wrappers", "TAO")) - os.putenv ("CIAO_ROOT", os.path.join (stage_dir, "ACE_wrappers", "TAO", "CIAO")) - os.putenv ("DANCE_ROOT", os.path.join (stage_dir, "ACE_wrappers", "TAO", "DAnCE")) + os.putenv ("CIAO_ROOT", "") + os.putenv ("DANCE_ROOT", "") os.putenv ("DDS_ROOT", "") # Create option strings mpc_command = os.path.join (stage_dir, "ACE_wrappers", "bin", "mwc.pl") - exclude_option = ' -exclude TAO/TAO_*.mwc,TAO/CIAO/CIAO_*.mwc ' + exclude_option = ' -exclude TAO/TAO_*.mwc ' workers_option = ' -workers ' + str(cpu_count) mpc_option = ' -recurse -hierarchy -relative ACE_ROOT=' + stage_dir + '/ACE_wrappers ' mpc_option += ' -relative TAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO ' - mpc_option += ' -relative CIAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO/CIAO ' - mpc_option += ' -relative DANCE_ROOT=' + stage_dir + '/ACE_wrappers/TAO/DAnCE ' - msvc_exclude_option = ' -exclude TAO/CIAO/CIAO_TAO_DAnCE_OpenDDS.mwc,TAO/CIAO/CIAO_TAO_OpenDDS.mwc,TAO/CIAO/CIAO_TAO_DAnCE_OpenDDS_shapes.mwc ' + msvc_exclude_option = ' ' vc12_option = ' -name_modifier *_vc12 ' vc14_option = ' -name_modifier *_vc14 ' @@ -966,8 +937,6 @@ def create_kit (): get_comp_versions ("ACE") get_comp_versions ("TAO") - get_comp_versions ("CIAO") - get_comp_versions ("DAnCE") print "Creating working directories...." stage_dir, package_dir = make_working_directories () |