summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
diff options
context:
space:
mode:
authorRyan Bourgeois <bluedragonx@gmail.com>2015-06-22 14:05:34 -0700
committerSachi King <nakato@nakato.io>2015-11-13 13:05:27 +1100
commit31a0e97cbff495401ab7ded498b680e1f918153c (patch)
tree9ad39767c8a87872e159e3bf6271dc863697f663 /pbr/packaging.py
parentae184c0742e672ce41212315029d1e8a83d45fec (diff)
downloadpbr-31a0e97cbff495401ab7ded498b680e1f918153c.tar.gz
Support git://, git+ssh://, git+https:// without -e flag.
Closes-Bug: 1467683 Change-Id: I09163c8072ecbee5c1a24951511c75009511b6f8
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r--pbr/packaging.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index f920374..735d284 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -93,7 +93,7 @@ def parse_requirements(requirements_files=None, strip_markers=False):
# nova-1.2.3 becomes nova>=1.2.3
return re.sub(r'([\w.]+)-([\w.-]+)',
r'\1>=\2',
- match.group(1))
+ match.groups()[-1])
requirements = []
for line in get_reqs_from_files(requirements_files):
@@ -124,8 +124,9 @@ def parse_requirements(requirements_files=None, strip_markers=False):
# such as:
# http://github.com/openstack/nova/zipball/master#egg=nova
# http://github.com/openstack/nova/zipball/master#egg=nova-1.2.3
- elif re.match(r'\s*https?:', line):
- line = re.sub(r'\s*https?:.*#egg=(.*)$', egg_fragment, line)
+ elif re.match(r'\s*(https?|git(\+(https|ssh))?):', line):
+ line = re.sub(r'\s*(https?|git(\+(https|ssh))?):.*#egg=(.*)$',
+ egg_fragment, line)
# -f lines are for index locations, and don't get used here
elif re.match(r'\s*-f\s+', line):
line = None
@@ -160,7 +161,7 @@ def parse_dependency_links(requirements_files=None):
if re.match(r'\s*-[ef]\s+', line):
dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line))
# lines that are only urls can go in unmolested
- elif re.match(r'\s*https?:', line):
+ elif re.match(r'\s*(https?|git(\+(https|ssh))?):', line):
dependency_links.append(line)
return dependency_links