mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
handle all cases of @ in srclibs
expands on fdroidserver!1422
This commit is contained in:
parent
599bd5a3a1
commit
15b983f48d
2 changed files with 27 additions and 13 deletions
|
|
@ -2059,15 +2059,15 @@ def parse_srclib_spec(spec):
|
|||
"(not a string): '{}'")
|
||||
.format(spec))
|
||||
|
||||
tokens = spec.split('@')
|
||||
if len(tokens) > 2:
|
||||
raise MetaDataException(_("could not parse srclib spec "
|
||||
"(too many '@' signs): '{}'")
|
||||
.format(spec))
|
||||
elif len(tokens) < 2:
|
||||
raise MetaDataException(_("could not parse srclib spec "
|
||||
"(no ref specified): '{}'")
|
||||
.format(spec))
|
||||
tokens = spec.split('@', 1)
|
||||
if not tokens[0]:
|
||||
raise MetaDataException(
|
||||
_("could not parse srclib spec (no name specified): '{}'").format(spec)
|
||||
)
|
||||
if len(tokens) < 2 or not tokens[1]:
|
||||
raise MetaDataException(
|
||||
_("could not parse srclib spec (no ref specified): '{}'").format(spec)
|
||||
)
|
||||
|
||||
name = tokens[0]
|
||||
ref = tokens[1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue