tarball: Use repo name only if more descriptive

For github URLs, only use the repo name as the package name if it's more
descriptive than what was extracted from the tarball name. Otherwise,
filter off prefix "release-" or a numeric suffix.

Signed-off-by: Brett T. Warden <brett.t.warden@intel.com>
This commit is contained in:
Brett T. Warden
2017-10-24 17:16:20 -07:00
committed by Matthew Johnson
parent 0eb744f788
commit 3db36c3093
+6 -1
View File
@@ -340,7 +340,12 @@ def name_and_version(name_arg, version_arg, filemanager):
m = re.search(pattern, url)
if m:
repo = m.group(2).strip()
name = repo
if repo not in name:
# Only take the repo name as the package name if it's more descriptive
name = repo
elif name != repo:
name = re.sub("release-", '', name)
name = re.sub("\d*$", '', name)
rawname = name
version = convert_version(m.group(3))
giturl = "https://github.com/" + m.group(1).strip() + "/" + repo + ".git"