From 95801dd79f3c530ed332ffe7c02043ecc2781f78 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Mon, 21 Feb 2011 22:15:49 +0000 Subject: Copy over 5.8 release script --- bin/make_release.py | 587 ++++++++++++++++++++++++++++------------------------ 1 file changed, 312 insertions(+), 275 deletions(-) diff --git a/bin/make_release.py b/bin/make_release.py index 4c39e610775..7670f65f56c 100755 --- a/bin/make_release.py +++ b/bin/make_release.py @@ -1,19 +1,14 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python # @file make_release.py # @author William R. Otte # # Packaging script for ACE/TAO/CIAO -from __future__ import with_statement +#from __future__ import with_statement from time import strftime import pysvn import re -import tempfile -import shutil -import subprocess -import shlex ################################################## #### Global variables @@ -38,6 +33,7 @@ mailid = None """ A dict containing version information used for the release. This dict contains entries of the form COMPONENT_version +COMPONENT_fix COMPONENT_beta COMPONENT_minor COMPONENT_major """ @@ -92,6 +88,8 @@ def parse_args (): help="Create a minor release.", default=None, const="minor") parser.add_option ("--beta", dest="release_type", action="store_const", help="Create a beta release.", default=None, const="beta") + parser.add_option ("--fix", dest="release_type", action="store_const", + help="Create a fix kit release.", default=None, const="fix") parser.add_option ("--tag", dest="action", action="store_const", @@ -99,6 +97,8 @@ def parse_args (): parser.add_option ("--update", dest="update", action="store_true", help="Update the version numbers, only used with --tag", default=False) + parser.add_option ("--ace", dest="ace_only", action="store_const", + help="Only do ACE, not TAO, CIAO", default=None, const="yes") parser.add_option ("--kit", dest="action", action="store_const", help="Create kits. DO NOT USE WITH --tag", default=None, const="kit") @@ -200,7 +200,7 @@ def check_workspace (): global opts, doc_root, svn_client # @@TODO: Replace with a svn library try: - rev = svn_client.update (doc_root) + rev = svn_client.update (doc_root + "ACE") print "Successfully updated ACE/TAO/CIAO working copy to revision " except: print "Unable to update ACE/TAO/CIAO workspace at " + doc_root @@ -208,7 +208,7 @@ def check_workspace (): try: rev = svn_client.update (doc_root + "/ACE/MPC") - print "Successfully updated MPC working copy to revision " + print "Successfully updated MPC working copy to revision " + str(rev) except: print "Unable to update the MPC workspace at " + doc_root + "/ACE/MPC" raise @@ -240,29 +240,46 @@ def update_version_files (component): retval = list () ## Update component/VERSION - with open (component + "/VERSION", "r+") as version_file: - new_version = re.sub (component + " version .*", - "%s version %s, released %s" % (component, - comp_versions[component + "_version"], - release_date), - version_file.read ()) - if opts.take_action: - version_file.seek (0) - version_file.truncate (0) - version_file.write (new_version) - else: - print "New version file for " + component - print new_version + version_file = open (component + "/VERSION", "r+") + new_version = re.sub (component + " version .*", + "%s version %s, released %s" % (component, + comp_versions[component + "_version"], + release_date), + version_file.read ()) + if opts.take_action: + version_file.seek (0) + version_file.truncate (0) + version_file.write (new_version) + else: + print "New version file for " + component + print new_version vprint ("Updating Version.h for " + component) - + version_file.close() retval += [component + "/VERSION"] ## Update component/component/Version.h - version_header = """ + if opts.release_type == "fix": + version_header = """ // -*- C++ -*- // $Id$ -// 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. + +#define %s_MAJOR_VERSION %s +#define %s_MINOR_VERSION %s +#define %s_BETA_VERSION %s +#define %s_FIX_VERSION \"%s\" +#define %s_VERSION \"%s\" +""" % (component, comp_versions[component + "_major"], + component, comp_versions[component + "_minor"], + component, comp_versions[component + "_beta"], + component, comp_versions[component + "_fix"], + component, comp_versions[component + "_version"]) + else: + version_header = """ +// -*- C++ -*- +// $Id$ +// This is file was automatically generated by \$ACE_ROOT/bin/make_release. #define %s_MAJOR_VERSION %s #define %s_MINOR_VERSION %s @@ -274,8 +291,9 @@ def update_version_files (component): component, comp_versions[component + "_version"]) if opts.take_action: - with open (component + '/' + component.lower () + "/Version.h", 'r+') as version_h: - version_h.write (version_header) + version_h = open (component + '/' + component.lower () + "/Version.h", 'r+') + version_h.write (version_header) + version_h.close() else: print "New Version.h for " + component print version_header @@ -287,61 +305,60 @@ def update_version_files (component): version_string = re.compile ("^\s*(\w+) +VERSION ?:") - with open (component + "/PROBLEM-REPORT-FORM", 'r+') as prf: - new_prf = "" - for line in prf.readlines (): - match = None - match = version_string.search (line) - if match is not None: - vprint ("Found PRF Version for " + match.group (1)) - line = re.sub ("(\d\.)+\d?", - comp_versions[match.group(1) + "_version"], - line) + prf = open (component + "/PROBLEM-REPORT-FORM", 'r+') + new_prf = "" + for line in prf.readlines (): + match = None + match = version_string.search (line) + if match is not None: + vprint ("Found PRF Version for " + match.group (1)) + line = re.sub ("(\d\.)+\d?[a-z]?", + comp_versions[match.group(1) + "_version"], + line) - new_prf += line + new_prf += line - if opts.take_action: - prf.seek (0) - prf.truncate (0) - prf.writelines (new_prf) - else: - print "New PRF for " + component - print "".join (new_prf) + if opts.take_action: + prf.seek (0) + prf.truncate (0) + prf.writelines (new_prf) + else: + print "New PRF for " + component + print "".join (new_prf) retval += [component + "/PROBLEM-REPORT-FORM"] + prf.close() return retval - def update_spec_file (): global comp_versions, opts - with open (doc_root + "/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: - line = "%define ACEVER " + comp_versions["ACE_version"] + "\n" - if line.find ("define TAOVER ") is not -1: - line = "%define TAOVER " + comp_versions["TAO_version"] + "\n" - if line.find ("define CIAOVER ") is not -1: - line = "%define CIAOVER " + comp_versions["CIAO_version"] + "\n" - if line.find ("define DANCEVER ") is not -1: - line = "%define DANCEVER " + comp_versions["DANCE_version"] + "\n" - if line.find ("define is_major_ver") is not -1: - if opts.release_type == "beta": - line = "%define is_major_ver 0\n" - else: - line = "%define is_major_ver 1\n" + spec_file = open (doc_root + "/ACE/rpmbuild/ace-tao.spec", 'r+') + new_spec = "" + for line in spec_file.readlines (): + if line.find ("define ACEVER ") is not -1: + line = "%define ACEVER " + comp_versions["ACE_version"] + "\n" + if line.find ("define TAOVER ") is not -1: + line = "%define TAOVER " + comp_versions["TAO_version"] + "\n" + if line.find ("define CIAOVER ") is not -1: + line = "%define CIAOVER " + comp_versions["CIAO_version"] + "\n" + if line.find ("define is_major_ver") is not -1: + if opts.release_type == "beta": + line = "%define is_major_ver 0\n" + else: + line = "%define is_major_ver 1\n" - new_spec += line + new_spec += line - if opts.take_action: - spec_file.seek (0) - spec_file.truncate (0) - spec_file.writelines (new_spec) - else: - print "New spec file:" - print "".join (new_spec) + if opts.take_action: + spec_file.seek (0) + spec_file.truncate (0) + spec_file.writelines (new_spec) + else: + print "New spec file:" + print "".join (new_spec) + close (spec_file) return [doc_root + "/ACE/rpmbuild/ace-tao.spec"] @@ -368,7 +385,6 @@ def update_debianbuild (): tao = re.compile ("tao", re.IGNORECASE) for fname in glob.iglob(doc_root + '/ACE/debian/*'): - print "Considering " + fname match = None fbase = basename (fname) @@ -383,9 +399,6 @@ def update_debianbuild (): fnewname = join (dirname (fname), match.group (1) + match.group (2) + comp_versions["ACE_version"] + match.group (4)) prev_ace_ver = match.group (3) - print prev_ace_ver -# print prev_tao_var - if fnewname is not None: if opts.take_action: svn_client.move (fname, fnewname) @@ -395,8 +408,6 @@ def update_debianbuild (): files.append (fname) files.append (fnewname) - print "Appending " + fname + " and " + fnewname - # update debianbuild/control def update_ver (match): if match.group (1) == 'libtao': @@ -404,49 +415,50 @@ def update_debianbuild (): else: return match.group (1) + match.group (2) + comp_versions["ACE_version"] + match.group (4) - with open (doc_root + "/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: - line = mask.sub (update_ver, line) - elif re.search ('^Replaces:', line) is not None: - print comp_versions["ACE_version"] - line = line.replace (prev_ace_ver, comp_versions["ACE_version"]) + control_file = open (doc_root + "/ACE/debian/control", 'r+') + new_ctrl = "" + for line in control_file.readlines (): + if re.search ("^(Package|Depends|Suggests):", line) is not None: + line = mask.sub (update_ver, line) + elif re.search ('^Replaces:', line) is not None: + line = line.replace (prev_ace_ver, comp_versions["ACE_version"]) - new_ctrl += line + new_ctrl += line - if opts.take_action: - control_file.seek (0) - control_file.truncate (0) - control_file.writelines (new_ctrl) - else: - print "New control file:" - print "".join (new_ctrl) + if opts.take_action: + control_file.seek (0) + control_file.truncate (0) + control_file.writelines (new_ctrl) + else: + print "New control file:" + print "".join (new_ctrl) + close (control_file) - files.append (doc_root + "/ACE/debian/debian.control") + files.append (doc_root + "/ACE/debian/control") # rewrite debian/dsc - dsc_lines = """Format: 1.0 -Source: ACE+TAO+CIAO-src-%s -Version: %s -Binary: ace -Maintainer: Johnny Willemsen -Architecture: any -Build-Depends: gcc, make, g++, debhelper (>= 5), libssl-dev (>= 0.9.7d), dpatch (>= 2.0.10), libxt-dev (>= 4.3.0), libfltk1.1-dev (>= 1.1.4), libqt4-dev (>= 4.4~rc1-4), tk-dev (>= 8.4.7), zlib1g-dev, docbook-to-man, bzip2, autoconf, automake, libtool, autotools-dev, doxygen, graphviz -Files: - 65b34001c9605f056713a7e146b052d1 46346654 ACE+TAO+CIAO-src-%s.tar.gz - -""" % (comp_versions["ACE_version"], comp_versions["TAO_version"], comp_versions["ACE_version"]) + dsc_lines = """# Format: 1.0 +# Source: ace +# Version: %s +# Binary: ace +# Maintainer: Johnny Willemsen +# Architecture: any +# Build-Depends: g++ +# Files: +# ACE+TAO+CIAO-src-%s.tar.bz2 +# +""" % (comp_versions["TAO_version"], comp_versions["ACE_version"]) if opts.take_action: - with open (doc_root + "/ACE/debian/ace.dsc", 'r+') as dsc_file: - dsc_file.seek (0) - dsc_file.truncate (0) - dsc_file.writelines (dsc_lines) + dsc_file = open (doc_root + "/ACE/debian/dsc", 'r+') + dsc_file.seek (0) + dsc_file.truncate (0) + dsc_file.writelines (dsc_lines) + close (dsc_file) else: print "New dsc file:\n" print dsc_lines - files.append (doc_root + "/ACE/debian/ace.dsc") + files.append (doc_root + "/ACE/debian/dsc") return files @@ -457,23 +469,21 @@ def get_and_update_versions (): try: get_comp_versions ("ACE") - get_comp_versions ("TAO") - get_comp_versions ("CIAO") - get_comp_versions ("DAnCE") + if opts.ace_only != "yes": + get_comp_versions ("TAO") + get_comp_versions ("CIAO") files = list () files += update_version_files ("ACE") - files += update_version_files ("TAO") - files += update_version_files ("CIAO") - files += update_version_files ("DAnCE") + if opts.ace_only != "yes": + files += update_version_files ("TAO") + files += update_version_files ("CIAO") files += create_changelog ("ACE") - files += create_changelog ("TAO") - files += create_changelog ("CIAO") - files += create_changelog ("DAnCE") - files += update_spec_file () - files += update_debianbuild () - - print "Committing " + str(files) + if opts.ace_only != "yes": + files += create_changelog ("TAO") + files += create_changelog ("CIAO") + files += update_spec_file () + files += update_debianbuild () commit (files) except: @@ -490,7 +500,7 @@ def create_changelog (component): # generate our changelog entry changelog_entry = """%s %s <%s> - * %s version %s released. +\t* %s version %s released. """ % (release_date, signature, mailid, component, @@ -498,65 +508,81 @@ def create_changelog (component): vprint ("Changelog Entry for " + component + "\n" + changelog_entry) - with open ("%s/ChangeLog" % (component), 'r+') as changelog: - changelog_entry += changelog.read () - - if opts.take_action: - changelog.seek (0) - changelog.truncate (0) - changelog.write (changelog_entry) + changelog = open ("%s/ChangeLog" % (component), 'r+') + changelog_entry += changelog.read () + if opts.take_action: + changelog.seek (0) + changelog.truncate (0) + changelog.write (changelog_entry) + changelog.close() return ["%s/ChangeLog" % (component)] def get_comp_versions (component): """ Extracts the current version number from the VERSION file and increments it appropriately for the release type requested.""" - vprint ("Detecting current version for" + component) + vprint ("Detecting current version for " + component) import re global comp_versions, opts + fix = re.compile ("version (\d+)\.(\d+)([a-z]{1})") beta = re.compile ("version (\d+)\.(\d+)\.(\d+)") minor = re.compile ("version (\d+)\.(\d+)[^\.]") major = re.compile ("version (\d+)[^\.]") - with open (component + "/VERSION") as version_file: - for line in version_file: - match = None + version_file = open (component + "/VERSION") + for line in version_file: + match = None - match = beta.search (line) - if match is not None: - vprint ("Detected beta version %s.%s.%s" % - (match.group (1), match.group (2), match.group (3))) + match = fix.search (line) + if match is not None: + vprint ("Detected fix version %s.%s%s" % + (match.group (1), match.group (2), match.group (3))) - comp_versions[component + "_major"] = int (match.group (1)) - comp_versions[component + "_minor"] = int (match.group (2)) - comp_versions[component + "_beta"] = int (match.group (3)) - break + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = int (match.group (2)) + comp_versions[component + "_fix"] = str (match.group (3)) + comp_versions[component + "_beta"] = 0 + break - match = minor.search (line) - if match is not None: - vprint ("Detected minor version %s.%s" % - (match.group (1), match.group (2))) + match = beta.search (line) + if match is not None: + vprint ("Detected beta version %s.%s.%s" % + (match.group (1), match.group (2), match.group (3))) - comp_versions[component + "_major"] = int (match.group (1)) - comp_versions[component + "_minor"] = int (match.group (2)) - comp_versions[component + "_beta"] = 0 - break + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = int (match.group (2)) + comp_versions[component + "_beta"] = int (match.group (3)) + comp_versions[component + "_fix"] = "" + break - match = major.search (line) - if match is not None: - vprint ("Detected major version " + match.group (1) + ".0") + match = minor.search (line) + if match is not None: + vprint ("Detected minor version %s.%s" % + (match.group (1), match.group (2))) - comp_versions[component + "_major"] = int (match.group (1)) - comp_versions[component + "_minor"] = 0 - comp_versions[component + "_beta"] = 0 - break + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = int (match.group (2)) + comp_versions[component + "_beta"] = 0 + comp_versions[component + "_fix"] = "" + break - print "FATAL ERROR: Unable to locate current version for " + component - raise Exception + match = major.search (line) + if match is not None: + vprint ("Detected major version " + match.group (1) + ".0") + + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = 0 + comp_versions[component + "_beta"] = 0 + comp_versions[component + "_fix"] = "" + break + + print "FATAL ERROR: Unable to locate current version for " + component + raise Exception + version_file.close() if opts.update: if opts.release_type == "major": @@ -568,16 +594,29 @@ def get_comp_versions (component): comp_versions[component + "_beta"] = 0 elif opts.release_type == "beta": comp_versions[component + "_beta"] += 1 - - #if opts.release_type == "beta": - comp_versions [component + "_version"] = \ - str (comp_versions[component + "_major"]) + '.' + \ - str (comp_versions[component + "_minor"]) + '.' + \ - str (comp_versions[component + "_beta"]) - # else: - # comp_versions [component + "_version"] = \ - # str (comp_versions[component + "_major"]) + '.' + \ - # str (comp_versions[component + "_minor"]) + elif opts.release_type == "fix": + if comp_versions[component + "_fix"] == "": + comp_versions[component + "_fix"] = "a" + else: + fixsequence = "abcdefghijklmnopqrstuvwxyz" + oldfix = comp_versions[component + "_fix"] + comp_versions[component + "_fix"] = \ + fixsequence[fixsequence.find(oldfix) + 1] + + if opts.release_type == "beta": + comp_versions [component + "_version"] = \ + str (comp_versions[component + "_major"]) + '.' + \ + str (comp_versions[component + "_minor"]) + '.' + \ + str (comp_versions[component + "_beta"]) + elif opts.release_type == "fix": + comp_versions [component + "_version"] = \ + str (comp_versions[component + "_major"]) + '.' + \ + str (comp_versions[component + "_minor"]) + \ + str (comp_versions[component + "_fix"]) + else: + comp_versions [component + "_version"] = \ + str (comp_versions[component + "_major"]) + '.' + \ + str (comp_versions[component + "_minor"]) def update_latest_tag (which, branch): @@ -587,46 +626,54 @@ def update_latest_tag (which, branch): propval = """ACE_wrappers %s/tags/%s/ACE ACE_wrappers/TAO %s/tags/%s/TAO ACE_wrappers/TAO/CIAO %s/tags/%s/CIAO -ACE_wrappers/TAO/DAnCE %s/tags/%s/DAnCE -""" % ((root_anon, branch) * 4) - tagname = "Latest_" + which - temp = tempfile.gettempdir () + "/" + tagname - svn_client.checkout (opts.repo_root + "/tags/" + tagname, temp, False) - svn_client.propset ("svn:externals", propval, temp) - svn_client.checkin (temp, "Updating for release " + branch) - shutil.rmtree (temp, True) +""" % (root_anon, branch, root_anon, branch, root_anon, branch) + svn_client.propset ("svn:externals", propval, + opts.repo_root + "/tags/Latest_" + which) def tag (): """ Tags the DOC and MPC repositories for the version """ global comp_versions, opts - branch = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], - comp_versions["ACE_minor"], - comp_versions["ACE_beta"]) - - if opts.take_action: - # Tag middleware - svn_client.copy (opts.repo_root + "/trunk", - opts.repo_root + "/tags/" + branch) - - # Tag MPC + # If making an ACE fix kit, only tag the ACE branch, not all of trunk. + if opts.release_type == "fix": + branch = "Riverace-ACE-%d_%d%s" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_fix"]) + # Tag ACE + svn_client.copy (opts.repo_root + "/branches/Riverace-6.0", + opts.repo_root + "/tags/" + branch) + # Tag MPC trunk - always take advantage of it. svn_client.copy (opts.mpc_root + "/trunk", - opts.mpc_root + "/tags/" + branch) - - # Update latest tag - if opts.release_type == "major": - update_latest_tag ("Major", branch) - elif opts.release_type == "minor": - update_latest_tag ("Minor", branch) - elif opts.release_type == "beta": - update_latest_tag ("Beta", branch) - update_latest_tag ("Micro", branch) - if comp_versions["ACE_beta"] == 1: - update_latest_tag ("BFO", branch) + opts.mpc_root + "/tags/" + branch) else: - print "Creating tags:\n" - print opts.repo_root + "/trunk -> " + opts.repo_root + "/tags/" + branch + "\n" - print opts.mpc_root + "/trunk -> " + opts.mpc_root + "/tags/" + branch + "\n" + branch = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) + if opts.take_action: + # Tag middleware + svn_client.copy (opts.repo_root + "/trunk", + opts.repo_root + "/tags/" + branch) + + # Tag MPC + svn_client.copy (opts.mpc_root + "/trunk", + opts.mpc_root + "/tags/" + branch) + + # Update latest tag + # mcorino@remedy.nl - subversion does not seem to support propset directly + # on URLs (except for some strange reason through propedit) + #if opts.release_type == "major": + #update_latest_tag ("Major", branch) + #elif opts.release_type == "minor": + #update_latest_tag ("Minor", branch) + #elif opts.release_type == "beta": + #update_latest_tag ("Beta", branch) + #update_latest_tag ("Micro", branch) + #if comp_versions["ACE_beta"] == 1: + #update_latest_tag ("BFO", branch) + else: + print "Creating tags:\n" + print opts.repo_root + "/trunk -> " + opts.repo_root + "/tags/" + branch + "\n" + print opts.mpc_root + "/trunk -> " + opts.mpc_root + "/tags/" + branch + "\n" ################################################## #### Packaging methods @@ -641,20 +688,17 @@ def export_wc (stage_dir): stage_dir + "/ACE_wrappers") print ("Exporting MPC") - svn_client.export (doc_root + "/ACE/MPC", + svn_client.export (doc_root + "/MPC", stage_dir + "/ACE_wrappers/MPC") - print ("Exporting TAO") - svn_client.export (doc_root + "/TAO", - stage_dir + "/ACE_wrappers/TAO") - - print ("Exporting CIAO") - svn_client.export (doc_root + "/CIAO", - stage_dir + "/ACE_wrappers/TAO/CIAO") + if opts.ace_only != "yes": + print ("Exporting TAO") + svn_client.export (doc_root + "/TAO", + stage_dir + "/ACE_wrappers/TAO") - print ("Exporting DAnCE") - svn_client.export (doc_root + "/DAnCE", - stage_dir + "/ACE_wrappers/TAO/DAnCE") + print ("Exporting CIAO") + svn_client.export (doc_root + "/CIAO", + stage_dir + "/ACE_wrappers/TAO/CIAO") def update_packages (text_files, bin_files, stage_dir, package_dir): @@ -675,8 +719,7 @@ def update_packages (text_files, bin_files, stage_dir, package_dir): # Zip binary files print "\tAdding binary files to zip...." - p = subprocess.Popen (shlex.split ("xargs zip " + zip_base_args + zip_file), stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) - instream, outstream = (p.stdin, p.stdout) + instream, outstream = os.popen2 ("xargs zip " + zip_base_args + zip_file) instream.write (bin_files) @@ -688,8 +731,7 @@ def update_packages (text_files, bin_files, stage_dir, package_dir): os.wait () print "\tAdding text files to zip....." - p = subprocess.Popen (shlex.split ("xargs zip " + zip_base_args + zip_text_args + zip_file), stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) - instream, outstream = (p.stdin, p.stdout) + instream, outstream = os.popen2 ("xargs zip " + zip_base_args + zip_text_args + zip_file) instream.write (text_files) @@ -702,16 +744,11 @@ def update_packages (text_files, bin_files, stage_dir, package_dir): # Tar files print "\tAdding to tar file...." - if (not os.path.exists (tar_file)): - open(tar_file, 'w').close () + instream, outstream = os.popen2 ("xargs tar " + tar_args + tar_file) - p = subprocess.Popen (shlex.split ("xargs tar " + tar_args + tar_file), stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) - instream, outstream = (p.stdin, p.stdout) instream.write (' ' + bin_files + ' ' + text_files) instream.close () - - print outstream.read () outstream.close () os.wait () @@ -834,7 +871,7 @@ def package (stage_dir, package_dir, decorator): pass # swallow any errors text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers"), - "ACE_wrappers", ["TAO"]) + "ACE_wrappers", ["TAO", "autom4te.cache"]) # write_file_lists ("fACE" + decorator, text_files, bin_files) update_packages ("\n".join (text_files), @@ -842,51 +879,39 @@ def package (stage_dir, package_dir, decorator): stage_dir, package_dir) + move_packages ("ACE" + decorator, stage_dir, package_dir) text_files = list () bin_files = list () - # for TAO: - text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO"), - "ACE_wrappers/TAO", ["CIAO", "DAnCE"]) + if opts.ace_only != "yes": -# write_file_lists ("fTAO" + decorator, text_files, bin_files) - update_packages ("\n".join (text_files), - "\n".join (bin_files), - stage_dir, - package_dir) + # for TAO: + text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO"), + "ACE_wrappers/TAO", ["CIAO", "autom4te.cache"]) - move_packages ("ACE+TAO" + decorator, stage_dir, package_dir) + # write_file_lists ("fTAO" + decorator, text_files, bin_files) + update_packages ("\n".join (text_files), + "\n".join (bin_files), + 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", []) - -# 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) + move_packages ("ACE+TAO" + 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", []) + 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", "") -# write_file_lists ("fCIAO" + decorator, text_files, bin_files) - update_packages ("\n".join (text_files), - "\n".join (bin_files), - stage_dir, - package_dir) + # 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) + move_packages ("ACE+TAO+CIAO" + decorator, stage_dir, package_dir) def generate_workspaces (stage_dir): """ Generates workspaces in the given stage_dir """ @@ -900,21 +925,30 @@ def generate_workspaces (stage_dir): # Set up our environment 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")) + if opts.ace_only != "yes": + 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", "CIAO", "DAnCE")) # 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 ' 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 ' + if opts.ace_only != "yes": + mpc_option += ' -relative TAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO ' + mpc_option += ' -relative CIAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO/CIAO ' + exclude_option = ' -exclude TAO/TAO_*.mwc,TAO/CIAO/CIAO_*.mwc ' + else: + exclude_option = ' ' + mpc_option += ' -relative DANCE_ROOT=' + stage_dir + '/ACE_wrappers/TAO/CIAO/DAnCE ' + + static_vc9_option = ' -static -name_modifier *_vc9_Static -apply_project -exclude TAO/CIAO ' + static_vc9_option += mpc_option + + static_vc10_option = ' -static -name_modifier *_Static -apply_project -exclude TAO/CIAO ' + static_vc10_option += mpc_option - vc10_option = ' -name_modifier *_vc10 ' vc9_option = ' -name_modifier *_vc9 ' - vc8_option = ' -name_modifier *_vc8 ' + vc10_option = ' ' redirect_option = str () if not opts.verbose: @@ -927,17 +961,20 @@ def generate_workspaces (stage_dir): print "\tGenerating GNUmakefiles...." ex (mpc_command + " -type gnuace " + exclude_option + mpc_option + redirect_option) + print "\tGenerating VC9 solutions..." + ex (mpc_command + " -type vc9 " + mpc_option + vc9_option + redirect_option) + print "\tGenerating VC10 solutions..." ex (mpc_command + " -type vc10 " + mpc_option + vc10_option + redirect_option) - print "\tGenerating VC9 solutions..." - ex (mpc_command + " -type vc9 " + mpc_option + vc9_option + redirect_option) + print "\tGenerating VC9 Static solutions" + ex (mpc_command + " -type vc9 " + static_vc9_option + redirect_option) - print "\tGenerating VC8 solutions..." - ex (mpc_command + " -type vc8 " + mpc_option + vc8_option + redirect_option) + print "\tGenerating VC10 Static solutions" + ex (mpc_command + " -type vc10 " + static_vc10_option + redirect_option) print "\tCorrecting permissions for all generated files..." - ex ("find ./ -name '*.vc[p,w]' -or -name '*.bmak' -or -name '*.vcproj' -or -name '*.sln' -or -name '*.vcxproj' -or -name '*.filters' -or -name 'GNUmake*' | xargs chmod 0644") + ex ("find ./ -name '*.vc[p,w]' -or -name '*.bmak' -or -name '*.vcproj' -or -name '*.sln' -or -name 'GNUmake*' | xargs chmod 0644") def create_kit (): """ Creates kits """ @@ -948,9 +985,9 @@ def create_kit (): print "Getting current version information...." get_comp_versions ("ACE") - get_comp_versions ("TAO") - get_comp_versions ("CIAO") - get_comp_versions ("DAnCE") + if opts.ace_only != "yes": + get_comp_versions ("TAO") + get_comp_versions ("CIAO") print "Creating working directories...." stage_dir, package_dir = make_working_directories () -- cgit v1.2.1