diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-02-03 23:28:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-02-03 23:28:44 +0100 |
| commit | aca0aa741e53b3ca3e884be1cd863acbb12f1bb5 (patch) | |
| tree | 1fe427c1433abbb155b6fbb50e9ff763f56aaac2 | |
| parent | b84286970f6eb6ef879dd59f89b1826b3aa6bb46 (diff) | |
Add --environment-version, currently just for Windows targets.
| -rwxr-xr-x | cdist | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net> +# Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -514,9 +514,8 @@ class Target(object): class DockerTarget(Target): - def __init__(self, platform, directory, version): + def __init__(self, platform, directory): super(DockerTarget, self).__init__(platform, directory) - self.version = version self.mounts = [] self.privileged = False @@ -589,8 +588,9 @@ class WindowsTarget(DockerTarget): environment_prefix: path to Windows environment for the appropriate target (libraries and some tools) tool_path: path to 32- and 64-bit tools """ - def __init__(self, version, bits, directory=None): - super(WindowsTarget, self).__init__('windows', directory, version) + def __init__(self, windows_version, bits, directory, environment_version): + super(WindowsTarget, self).__init__('windows', directory) + self.version = windows_version self.bits = bits self.tool_path = '%s/usr/bin' % config.get('mxe_prefix') @@ -616,6 +616,8 @@ class WindowsTarget(DockerTarget): self.set('LDFLAGS', '"%s"' % link) self.image = 'windows' + if environment_version is not None: + self.image += '_%s' % environment_version @property def library_prefix(self): @@ -655,8 +657,9 @@ class LinuxTarget(DockerTarget): """ def __init__(self, distro, version, bits, directory=None): - super(LinuxTarget, self).__init__('linux', directory, version) + super(LinuxTarget, self).__init__('linux', directory) self.distro = distro + self.version = version self.bits = bits self.detail = None @@ -798,9 +801,9 @@ def target_factory(args): if s.startswith('windows-'): x = s.split('-') if len(x) == 2: - target = WindowsTarget(None, int(x[1]), args.work) + target = WindowsTarget(None, int(x[1]), args.work, args.environment_version) elif len(x) == 3: - target = WindowsTarget(x[1], int(x[2]), args.work) + target = WindowsTarget(x[1], int(x[2]), args.work, args.environment_version) else: raise Error("Bad Windows target name `%s'") elif s.startswith('ubuntu-') or s.startswith('debian-') or s.startswith('centos-') or s.startswith('fedora-') or s.startswith('mageia-'): @@ -1015,6 +1018,7 @@ def main(): parser.add_argument('-o', '--output', help='output directory', default='.') parser.add_argument('-q', '--quiet', help='be quiet', action='store_true') parser.add_argument('-t', '--target', help='target', action='append') + parser.add_argument('--environment-version', help='version of environment to use') parser.add_argument('-k', '--keep', help='keep working tree', action='store_true') parser.add_argument('--debug', help='build with debugging symbols where possible', action='store_true') parser.add_argument('-w', '--work', help='override default work directory') |
