diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-08-25 16:37:53 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-28 12:54:54 +0200 |
commit | 367ea85057368047a50ae98a3510e0113eadd744 (patch) | |
tree | 5aecfd3a2e44377e9d331ca77346666ca193006c /src/hydrilla/proxy/state_impl/repos.py | |
parent | c1f6a379b3a85303f487e1b366e96d9db90cd4e3 (diff) | |
download | haketilo-hydrilla-367ea85057368047a50ae98a3510e0113eadd744.tar.gz haketilo-hydrilla-367ea85057368047a50ae98a3510e0113eadd744.zip |
[proxy] make it possible to uninstall a package
This commit also brings some more refactoring under state_impl/.
Diffstat (limited to 'src/hydrilla/proxy/state_impl/repos.py')
-rw-r--r-- | src/hydrilla/proxy/state_impl/repos.py | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/hydrilla/proxy/state_impl/repos.py b/src/hydrilla/proxy/state_impl/repos.py index 838698c..8a3fe64 100644 --- a/src/hydrilla/proxy/state_impl/repos.py +++ b/src/hydrilla/proxy/state_impl/repos.py @@ -193,28 +193,8 @@ class ConcreteRepoRef(st.RepoRef): (self.id,) ) - # For mappings explicitly enabled by the user (+ all mappings they - # recursively depend on) let's make sure that their exact same - # versions will be enabled after the change. - cursor.execute( - ''' - SELECT - definition, repo, repo_iteration - FROM - item_versions_extra - WHERE - active = 'R'; - ''' - ) - - requirements = [] - - for definition, repo, iteration in cursor.fetchall(): - info = item_infos.MappingInfo.load(definition, repo, iteration) - req = sds.MappingVersionRequirement(info.identifier, info) - requirements.append(req) - - self.state.recompute_dependencies(requirements, prune_orphans=True) + self.state.prune_orphans() + self.state.recompute_dependencies() def update( self, @@ -255,7 +235,7 @@ class ConcreteRepoRef(st.RepoRef): except sqlite3.IntegrityError: raise st.RepoNameTaken() - self.state.recompute_dependencies() + self.state.rebuild_structures() def refresh(self) -> None: with self.state.cursor(transaction=True) as cursor: |