diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-08-24 10:47:33 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-28 12:54:53 +0200 |
commit | d516b9decad07b940b3cd117fc4e353dd8bbe7d2 (patch) | |
tree | 2ab6f78e067d88a9dce1043e496b1d5af283464b /src/hydrilla/proxy/state_impl/repos.py | |
parent | 964bd44649aaf03c9afea06eadad0443032d8b77 (diff) | |
download | haketilo-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.py | 19 |
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() |