autospec: Handle cases whereby "-final" is a suffix

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
Ikey Doherty
2016-01-11 21:33:46 +00:00
parent f8a97c8a9e
commit 1b411bf303
+7 -1
View File
@@ -129,11 +129,17 @@ def download_tarball(url_argument, name_argument, archives, target_dir):
name = "perl-" + name
if url_argument.find("github.com") > 0:
p = re.compile(r"https://github.com/.*/(.*?)/archive/v?(.*).tar")
p = re.compile(r"https://github.com/.*/(.*?)/archive/(.*)-final.tar")
m = p.search(url_argument)
if m:
name = m.group(1).strip()
version = m.group(2).strip()
else:
p = re.compile(r"https://github.com/.*/(.*?)/archive/v?(.*).tar")
m = p.search(url_argument)
if m:
name = m.group(1).strip()
version = m.group(2).strip()
if url_argument.find("bitbucket.org") > 0:
p = re.compile(r"https://bitbucket.org/.*/(.*?)/get/[a-zA-Z_-]*([0-9][0-9_.]*).tar")