summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-25 16:59:54 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-25 16:59:54 -0700
commite7878007a41fb965886adfa0abc95ebd548b3f80 (patch)
tree596cef30ec94dd462a6c0cc0cdc0a59b5e31fdc4 /setup.py
parentc36c782d3c3913611b86edeb7d371c54ced4b8bd (diff)
downloadvyos-cloud-init-e7878007a41fb965886adfa0abc95ebd548b3f80.tar.gz
vyos-cloud-init-e7878007a41fb965886adfa0abc95ebd548b3f80.zip
Use the standard utils now in tools for reading requires/dependencies/versions.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/setup.py b/setup.py
index 59548a41..fd67da46 100755
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,12 @@ import setuptools
import subprocess
+def tiny_p(cmd):
+ sp = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, stdin=None)
+ (out, err) = sp.communicate()
+ return (out, err)
+
def is_f(p):
return os.path.isfile(p)
@@ -36,21 +42,14 @@ def is_f(p):
def get_version():
cmd = ['tools/read-version']
- ver = subprocess.check_output(cmd)
+ (ver, _e) = tiny_p(cmd)
return ver.strip()
-def requires(fn='Requires'):
- requires = []
- with open(fn, 'r') as fh:
- lines = fh.read().splitlines()
- for line in lines:
- line = line.strip()
- if not line or line[0] == '#':
- continue
- else:
- requires.append(line)
- return requires
+def read_requires():
+ cmd = ['tools/read-dependencies']
+ (deps, _e) = tiny_p(cmd)
+ return deps.splitlines()
setuptools.setup(name='cloud-init',
@@ -68,14 +67,15 @@ setuptools.setup(name='cloud-init',
('/etc/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
('/etc/cloud/templates', glob('templates/*')),
# Only really need for upstart based systems
- ('/etc/init', glob('upstart/*.conf')),
+ #('/etc/init', glob('upstart/*.conf')),
('/usr/share/cloud-init', []),
('/usr/lib/cloud-init',
['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
('/usr/share/doc/cloud-init', filter(is_f, glob('doc/*'))),
('/usr/share/doc/cloud-init/examples', filter(is_f, glob('doc/examples/*'))),
('/usr/share/doc/cloud-init/examples/seed', filter(is_f, glob('doc/examples/seed/*'))),
- ('/etc/profile.d', ['tools/Z99-cloud-locale-test.sh']),
+ # ??
+ # ('/etc/profile.d', ['tools/Z99-cloud-locale-test.sh']),
],
- install_requires=requires(),
+ install_requires=read_requires(),
)