diff options
author | Dimitri John Ledkov <dimitri.ledkov@canonical.com> | 2014-07-23 15:47:16 +0100 |
---|---|---|
committer | Dimitri John Ledkov <dimitri.ledkov@canonical.com> | 2014-07-23 15:47:16 +0100 |
commit | a04baf85a8eea4eb02168429aa6bfaaeb2effb42 (patch) | |
tree | 1d9d8eb3396bc8c84322e69878d8f60cc063fd21 /setup.py | |
parent | e9f9c1e1cd47786b93491fd0f73467674c88828e (diff) | |
download | vyos-cloud-init-a04baf85a8eea4eb02168429aa6bfaaeb2effb42.tar.gz vyos-cloud-init-a04baf85a8eea4eb02168429aa6bfaaeb2effb42.zip |
Modernise packaging, and allow multiple init system installation (based on smoser pastebins).
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -86,7 +86,7 @@ class InitsysInstallData(install): user_options = install.user_options + [ # This will magically show up in member variable 'init_sys' ('init-system=', None, - ('init system to configure (%s) [default: None]') % + ('init system(s) to configure (%s) [default: None]') % (", ".join(INITSYS_TYPES)) ), ] @@ -97,13 +97,23 @@ class InitsysInstallData(install): def finalize_options(self): install.finalize_options(self) - if self.init_system and self.init_system not in INITSYS_TYPES: + + if self.init_systems and isinstance(self.init_systems, str): + self.init_systems = self.init_systems.split(",") + + if len(self.init_system) == 0: raise DistutilsArgError(("You must specify one of (%s) when" - " specifying a init system!") % (", ".join(INITSYS_TYPES))) + " specifying init system(s)!") % (", ".join(INITSYS_TYPES))) + + bad = [f for f in self.init_system if f not in INITSYS_TYPES] + if len(bad) != 0: + raise DistutilsArgError( + "Invalid --init-system: %s" % (','.join(bad))) elif self.init_system: - self.distribution.data_files.append( - (INITSYS_ROOTS[self.init_system], - INITSYS_FILES[self.init_system])) + for sys in self.init_systems: + print("adding %s: %s" % (sys, str(INITSYS_ROOTS[sys]))) + self.distribution.data_files.append( + (INITSYS_ROOTS[sys], INITSYS_FILES[sys])) # Force that command to reinitalize (with new file list) self.distribution.reinitialize_command('install_data', True) |