diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:32:32 +0000 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:32:32 +0000 |
commit | a4a6702758cf60ecb8742d78e576733dbbdbb9a0 (patch) | |
tree | b5f23eff4f9c7e87fe2b09cdbe1d1b38aa518929 /tools | |
parent | 888db3e6bb9076973d2f6a73e0c4f691caa89603 (diff) | |
download | vyos-cloud-init-a4a6702758cf60ecb8742d78e576733dbbdbb9a0.tar.gz vyos-cloud-init-a4a6702758cf60ecb8742d78e576733dbbdbb9a0.zip |
make bddeb work with python3 or python2
painful, and not perfect, but at this point the output builds
on a vivid system python2 (bddeb --python2) or python3.
* remove use of cheetah by bddeb in favor of builtin renderer
* add '--python2' flag to bddeb and knowledge of python 2 and python3
package names.
* read-dependencies can now read test-requirements also.
* differenciate from build-requirements and runtime requirements.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/read-dependencies | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/read-dependencies b/tools/read-dependencies index fee3efcf..6a6f3e12 100755 --- a/tools/read-dependencies +++ b/tools/read-dependencies @@ -1,6 +1,7 @@ #!/usr/bin/env python import os +import re import sys if 'CLOUD_INIT_TOP_D' in os.environ: @@ -14,10 +15,15 @@ for fname in ("setup.py", "requirements.txt"): "exist in cloud-init root directory." % fname) sys.exit(1) -with open(os.path.join(topd, "requirements.txt"), "r") as fp: +if len(sys.argv) > 1: + reqfile = sys.argv[1] +else: + reqfile = "requirements.txt" + +with open(os.path.join(topd, reqfile), "r") as fp: for line in fp: if not line.strip() or line.startswith("#"): continue - sys.stdout.write(line) + sys.stdout.write(re.split("[>=.<]*", line)[0].strip() + "\n") sys.exit(0) |