forked from platformio/platformio-core
Fix bug with parsing detached packages
This commit is contained in:
1 parent
4ec64f8980
commit
bb6fb3fdf8
2 files changed
+12
-2
No files matched your search
@@ -229,6 +229,8 @@ class PackageSpec(object): # pylint: disable=too-many-instance-attributes
|
||||
def _parse_requirements(self, raw):
|
||||
if "@" not in raw:
|
||||
return raw
|
||||
if raw.startswith("file://") and os.path.exists(raw[7:]):
|
||||
return raw
|
||||
tokens = raw.rsplit("@", 1)
|
||||
if any(s in tokens[1] for s in (":", "/")):
|
||||
return raw
|
||||
@@ -296,7 +298,10 @@ class PackageSpec(object): # pylint: disable=too-many-instance-attributes
|
||||
def _parse_name_from_url(url):
|
||||
if url.endswith("/"):
|
||||
url = url[:-1]
|
||||
for c in ("#", "?"):
|
||||
stop_chars = ["#", "?"]
|
||||
if url.startswith("file://"):
|
||||
stop_chars.append("@") # detached path
|
||||
for c in stop_chars:
|
||||
if c in url:
|
||||
url = url[: url.index(c)]
|
||||
|
||||
|
||||
Reference in new issue
Block a user