diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-17 10:21:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-17 10:21:40 +0100 |
| commit | 32fcfd575dde16a65f548990ae9ee59ab6a65052 (patch) | |
| tree | d1be46436e94ebd500e1907d319a9a99ade90fca | |
| parent | 1ebbbb0654cc84eb0bba7e0a88934139750f59ec (diff) | |
Add windows versioning support.
| -rwxr-xr-x | cdist | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -374,8 +374,9 @@ class Target(object): # class WindowsTarget(Target): - def __init__(self, bits, directory=None): + def __init__(self, version, bits, directory=None): super(WindowsTarget, self).__init__('windows', directory) + self.version = version self.bits = bits self.windows_prefix = '%s/%d' % (config.get('windows_environment_prefix'), self.bits) @@ -538,7 +539,13 @@ class SourceTarget(Target): def target_factory(s, debug, work): target = None if s.startswith('windows-'): - target = WindowsTarget(int(s.split('-')[1]), work) + x = s.split('-') + if len(x) == 2: + target = WindowsTarget(None, int(x[1]), work) + elif len(x) == 3: + target = WindowsTarget(x[1], int(x[2]), work) + else: + raise Error("Bad Windows target name `%s'") elif s.startswith('ubuntu-') or s.startswith('debian-') or s.startswith('centos-'): p = s.split('-') if len(p) != 3: |
