From d064ab0bffd429382ea4fafeb144784d403848bd Mon Sep 17 00:00:00 2001 From: Ɓukasz 'sil2100' Zemczak Date: Mon, 16 Jan 2017 10:10:41 +0100 Subject: Import patches-unapplied version 2.2.2-0ubuntu1 to ubuntu/zesty-proposed Imported using git-ubuntu import. Changelog parent: 63d399807de30a64456e672063e7c20babf7aadc New changelog entries: * New upstream release (LP: #1651128) - d/patches/fix-auto-update.patch, d/patches/lp1623570-adjust-walinuxagent-service-after-and-wants.patch: - Dropped as changes have been applied upstream - Refreshed debian/patches/disable_import_test.patch --- makepkg.py | 69 +++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 14 deletions(-) (limited to 'makepkg.py') diff --git a/makepkg.py b/makepkg.py index ca7ad20..9796ce3 100755 --- a/makepkg.py +++ b/makepkg.py @@ -7,10 +7,10 @@ import shutil import subprocess import sys -from azurelinuxagent.common.version import AGENT_NAME, AGENT_VERSION, AGENT_LONG_VERSION +from azurelinuxagent.common.version import AGENT_NAME, AGENT_VERSION, \ + AGENT_LONG_VERSION from azurelinuxagent.ga.update import AGENT_MANIFEST_FILE - MANIFEST = '''[{{ "name": "{0}", "version": 1.0, @@ -25,23 +25,57 @@ MANIFEST = '''[{{ }} }}]''' +PUBLISH_MANIFEST = ''' + + + Microsoft.OSTCLinuxAgent + {1} + {0} + + VmRole + + Microsoft Azure Guest Agent for Linux IaaS + true + https://github.com/Azure/WALinuxAgent/blob/2.1/LICENSE.txt + https://github.com/Azure/WALinuxAgent/blob/2.1/LICENSE.txt + https://github.com/Azure/WALinuxAgent + true + Microsoft + Linux + {2} + +''' + +PUBLISH_MANIFEST_FILE = 'manifest.xml' output_path = os.path.join(os.getcwd(), "eggs") target_path = os.path.join(output_path, AGENT_LONG_VERSION) bin_path = os.path.join(target_path, "bin") egg_path = os.path.join(bin_path, AGENT_LONG_VERSION + ".egg") manifest_path = os.path.join(target_path, AGENT_MANIFEST_FILE) +publish_manifest_path = os.path.join(target_path, PUBLISH_MANIFEST_FILE) pkg_name = os.path.join(output_path, AGENT_LONG_VERSION + ".zip") +family = 'Test' +if len(sys.argv) > 1: + family = sys.argv[1] + +region = 'South Central US' +if len(sys.argv) > 2: + cloud = sys.argv[2] + if cloud == 'BlackForest': + region = 'Germany Central' + def do(*args): try: subprocess.check_output(args, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: - print "ERROR: {0}".format(str(e)) - print "\t{0}".format(" ".join(args)) - print e.output + print("ERROR: {0}".format(str(e))) + print("\t{0}".format(" ".join(args))) + print(e.output) sys.exit(1) + if os.path.isdir(target_path): shutil.rmtree(target_path) elif os.path.isfile(target_path): @@ -49,27 +83,34 @@ elif os.path.isfile(target_path): if os.path.isfile(pkg_name): os.remove(pkg_name) os.makedirs(bin_path) -print "Created {0} directory".format(target_path) +print("Created {0} directory".format(target_path)) -args = ["python", "setup.py"] -args.append("bdist_egg") -args.append("--dist-dir={0}".format(bin_path)) +args = ["python", "setup.py", "bdist_egg", "--dist-dir={0}".format(bin_path)] -print "Creating egg {0}".format(egg_path) +print("Creating egg {0}".format(egg_path)) do(*args) -egg_name = os.path.join("bin", os.path.basename(glob.glob(os.path.join(bin_path, "*"))[0])) +egg_name = os.path.join("bin", os.path.basename( + glob.glob(os.path.join(bin_path, "*"))[0])) -print "Writing {0}".format(manifest_path) +print("Writing {0}".format(manifest_path)) with open(manifest_path, mode='w') as manifest: manifest.write(MANIFEST.format(AGENT_NAME, egg_name)) +print("Writing {0}".format(publish_manifest_path)) +with open(publish_manifest_path, mode='w') as publish_manifest: + publish_manifest.write(PUBLISH_MANIFEST.format(AGENT_VERSION, + family, + region)) + + cwd = os.getcwd() os.chdir(target_path) -print "Creating package {0}".format(pkg_name) +print("Creating package {0}".format(pkg_name)) do("zip", "-r", pkg_name, egg_name) do("zip", "-j", pkg_name, AGENT_MANIFEST_FILE) +do("zip", "-j", pkg_name, PUBLISH_MANIFEST_FILE) os.chdir(cwd) -print "Package {0} successfully created".format(pkg_name) +print("Package {0} successfully created".format(pkg_name)) sys.exit(0) -- cgit v1.2.3