~cloud-init-dev/cloud-init/trunk

« back to all changes in this revision

Viewing changes to tools/read-dependencies

  • Committer: Scott Moser
  • Date: 2016-08-10 15:06:15 UTC
  • Revision ID: smoser@ubuntu.com-20160810150615-ma2fv107w3suy1ma
README: Mention move of revision control to git.

cloud-init development has moved its revision control to git.
It is available at 
  https://code.launchpad.net/cloud-init

Clone with 
  git clone https://git.launchpad.net/cloud-init
or
  git clone git+ssh://git.launchpad.net/cloud-init

For more information see
  https://git.launchpad.net/cloud-init/tree/HACKING.rst

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
import os
4
 
import re
5
 
import sys
6
 
 
7
 
if 'CLOUD_INIT_TOP_D' in os.environ:
8
 
    topd = os.path.realpath(os.environ.get('CLOUD_INIT_TOP_D'))
9
 
else:
10
 
    topd = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
11
 
 
12
 
for fname in ("setup.py", "requirements.txt"):
13
 
    if not os.path.isfile(os.path.join(topd, fname)):
14
 
        sys.stderr.write("Unable to locate '%s' file that should "
15
 
                         "exist in cloud-init root directory." % fname)
16
 
        sys.exit(1)
17
 
 
18
 
if len(sys.argv) > 1:
19
 
   reqfile = sys.argv[1]
20
 
else:
21
 
   reqfile = "requirements.txt"
22
 
   
23
 
with open(os.path.join(topd, reqfile), "r") as fp:
24
 
    for line in fp:
25
 
        if not line.strip() or line.startswith("#"):
26
 
            continue
27
 
        sys.stdout.write(re.split("[>=.<]*", line)[0].strip() + "\n")
28
 
 
29
 
sys.exit(0)