Use the standard utils now in tools for reading requires/dependencies/versions.
This commit is contained in:
parent
6a2ffea82b
commit
c829485aeb
30
setup.py
30
setup.py
@ -29,6 +29,12 @@ import setuptools
|
|||||||
|
|
||||||
import subprocess
|
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):
|
def is_f(p):
|
||||||
return os.path.isfile(p)
|
return os.path.isfile(p)
|
||||||
@ -36,21 +42,14 @@ def is_f(p):
|
|||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
cmd = ['tools/read-version']
|
cmd = ['tools/read-version']
|
||||||
ver = subprocess.check_output(cmd)
|
(ver, _e) = tiny_p(cmd)
|
||||||
return ver.strip()
|
return ver.strip()
|
||||||
|
|
||||||
|
|
||||||
def requires(fn='Requires'):
|
def read_requires():
|
||||||
requires = []
|
cmd = ['tools/read-dependencies']
|
||||||
with open(fn, 'r') as fh:
|
(deps, _e) = tiny_p(cmd)
|
||||||
lines = fh.read().splitlines()
|
return deps.splitlines()
|
||||||
for line in lines:
|
|
||||||
line = line.strip()
|
|
||||||
if not line or line[0] == '#':
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
requires.append(line)
|
|
||||||
return requires
|
|
||||||
|
|
||||||
|
|
||||||
setuptools.setup(name='cloud-init',
|
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/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
|
||||||
('/etc/cloud/templates', glob('templates/*')),
|
('/etc/cloud/templates', glob('templates/*')),
|
||||||
# Only really need for upstart based systems
|
# Only really need for upstart based systems
|
||||||
('/etc/init', glob('upstart/*.conf')),
|
#('/etc/init', glob('upstart/*.conf')),
|
||||||
('/usr/share/cloud-init', []),
|
('/usr/share/cloud-init', []),
|
||||||
('/usr/lib/cloud-init',
|
('/usr/lib/cloud-init',
|
||||||
['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
|
['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
|
||||||
('/usr/share/doc/cloud-init', filter(is_f, glob('doc/*'))),
|
('/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', filter(is_f, glob('doc/examples/*'))),
|
||||||
('/usr/share/doc/cloud-init/examples/seed', filter(is_f, glob('doc/examples/seed/*'))),
|
('/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(),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user