mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-26 01:56:56 +00:00
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:
committed by
Matthew Johnson
parent
0eb744f788
commit
3db36c3093
+6
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user