mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
split tag instead of parsing it using a regex
nothing says that the version number must start with a number as seen in the gpg-pubkey packages in Fedora: gpg-pubkey-facb00b1-570a8081 gpg-pubkey-c3898297-5d25cdbd gpg-pubkey-d38b4796-570c8cd3 gpg-pubkey-cfc659b9-5b6eac67
This commit is contained in:
parent
ee7536aa5f
commit
fe5d4fddb9
1 changed files with 8 additions and 5 deletions
|
@ -810,11 +810,14 @@ def get_project_name(tag=None, scl=None):
|
|||
current working directory. Error out if neither is present.
|
||||
"""
|
||||
if tag is not None:
|
||||
p = re.compile('(.*?)-(\d[^-]*)(-[^-]*)?$')
|
||||
m = p.match(tag)
|
||||
if not m:
|
||||
error_out("Unable to determine project name in tag: %s" % tag)
|
||||
return m.group(1)
|
||||
try:
|
||||
(package, _version, _release) = tag.rsplit('-', 2)
|
||||
except ValueError:
|
||||
try:
|
||||
(package, _version) = tag.rsplit('-', 1)
|
||||
except ValueError:
|
||||
error_out("Unable to determine project name in tag: %s" % tag)
|
||||
return package
|
||||
else:
|
||||
file_path = find_spec_like_file()
|
||||
if not os.path.exists(file_path):
|
||||
|
|
Loading…
Add table
Reference in a new issue