aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl/repos.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-24 10:47:33 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 12:54:53 +0200
commitd516b9decad07b940b3cd117fc4e353dd8bbe7d2 (patch)
tree2ab6f78e067d88a9dce1043e496b1d5af283464b /src/hydrilla/proxy/state_impl/repos.py
parent964bd44649aaf03c9afea06eadad0443032d8b77 (diff)
downloadhaketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.tar.gz
haketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.zip
make repo packages (mappings) load as uninstalled; make them installable through the web UI
Diffstat (limited to 'src/hydrilla/proxy/state_impl/repos.py')
-rw-r--r--src/hydrilla/proxy/state_impl/repos.py19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/hydrilla/proxy/state_impl/repos.py b/src/hydrilla/proxy/state_impl/repos.py
index 2670ae9..d4fbbce 100644
--- a/src/hydrilla/proxy/state_impl/repos.py
+++ b/src/hydrilla/proxy/state_impl/repos.py
@@ -145,16 +145,6 @@ def sync_remote_repo_definitions(repo_url: str, dest: Path) -> None:
item_path.write_bytes(item_response.content)
-@dc.dataclass(frozen=True)
-class RemoteFileResolver(_operations.FileResolver):
- repo_url: str
-
- def by_sha256(self, sha256: str) -> bytes:
- response = requests.get(urljoin(self.repo_url, f'file/sha256/{sha256}'))
- assert response.ok
- return response.content
-
-
def make_repo_display_info(
ref: st.RepoRef,
name: str,
@@ -290,11 +280,10 @@ class ConcreteRepoRef(st.RepoRef):
with tempfile.TemporaryDirectory() as tmpdir_str:
tmpdir = Path(tmpdir_str)
sync_remote_repo_definitions(repo_url, tmpdir)
- new_iteration_id = _operations.load_packages(
- cursor,
- tmpdir,
- int(self.id),
- RemoteFileResolver(repo_url)
+ new_iteration_id = _operations._load_packages_no_state_update(
+ cursor = cursor,
+ malcontent_path = tmpdir,
+ repo_id = int(self.id)
)
self.state.rebuild_structures()