Skip to content
Snippets Groups Projects
Commit 9dca5a4c authored by Kumar Shivendu's avatar Kumar Shivendu Committed by Phabricator Migration user
Browse files

nixguix: Handle downloads for urls with missing schema

Some of the URLs don't have a schema (ex: http) and it blocks the loader from downloading the corresponding repos.
This diff should fix the issue.

Related T3294
parent 63a8a61c
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import json
import logging
import re
from typing import Any, Dict, Iterator, List, Mapping, Optional, Tuple
from urllib.parse import urlparse
import attr
......@@ -48,11 +49,12 @@ class NixGuixPackageInfo(BasePackageInfo):
@classmethod
def from_metadata(cls, metadata: Dict[str, Any]) -> "NixGuixPackageInfo":
url = metadata["url"]
if not urlparse(url).scheme:
url = f"http://{url}"
return cls(
url=metadata["url"],
filename=None,
integrity=metadata["integrity"],
raw_info=metadata,
url=url, filename=None, integrity=metadata["integrity"], raw_info=metadata,
)
def extid(self) -> PartialExtID:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment