* fix: really remove repo in componentdb when removing a repo
* fix: look at system.base of repo (not installed) in safety switch when removing guys
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@ class ComponentDB(object):
|
|||||||
def destroy(self):
|
def destroy(self):
|
||||||
self.d.destroy()
|
self.d.destroy()
|
||||||
|
|
||||||
def has_component(self, name, repo = None, txn = None):
|
def has_component(self, name, repo = pisi.itembyrepodb.repos, txn = None):
|
||||||
#name = shelve.LockedDBShelf.encodekey(name)
|
#name = shelve.LockedDBShelf.encodekey(name)
|
||||||
name = str(name)
|
name = str(name)
|
||||||
return self.d.has_key(name, repo, txn)
|
return self.d.has_key(name, repo, txn)
|
||||||
|
|||||||
+5
-2
@@ -492,16 +492,19 @@ def plan_upgrade(A, ignore_build = False):
|
|||||||
def remove(A):
|
def remove(A):
|
||||||
"""remove set A of packages from system (A is a list of package names)"""
|
"""remove set A of packages from system (A is a list of package names)"""
|
||||||
|
|
||||||
|
A = [str(x) for x in A]
|
||||||
|
|
||||||
# filter packages that are not installed
|
# filter packages that are not installed
|
||||||
A_0 = A = expand_components(set(A))
|
A_0 = A = expand_components(set(A))
|
||||||
|
|
||||||
if not ctx.get_option('bypass_safety'):
|
if not ctx.get_option('bypass_safety'):
|
||||||
if ctx.componentdb.has_component('system.base'):
|
if ctx.componentdb.has_component('system.base'):
|
||||||
refused = A.intersection(set(ctx.componentdb.get_component('system.base').packages))
|
systembase = set(ctx.componentdb.get_union_comp('system.base').packages)
|
||||||
|
refused = A.intersection(systembase)
|
||||||
if refused:
|
if refused:
|
||||||
ctx.ui.warning(_('Safety switch: cannot remove the following packages in system.base: ') +
|
ctx.ui.warning(_('Safety switch: cannot remove the following packages in system.base: ') +
|
||||||
util.strlist(refused))
|
util.strlist(refused))
|
||||||
A = A - set(ctx.componentdb.get_component('system.base').packages)
|
A = A - systembase
|
||||||
else:
|
else:
|
||||||
ctx.ui.warning(_('Safety switch: the component system.base cannot be found'))
|
ctx.ui.warning(_('Safety switch: the component system.base cannot be found'))
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ class RepoDB(object):
|
|||||||
self.d.put("order", list, txn)
|
self.d.put("order", list, txn)
|
||||||
ctx.packagedb.remove_repo(name, txn=txn)
|
ctx.packagedb.remove_repo(name, txn=txn)
|
||||||
ctx.sourcedb.remove_repo(name, txn=txn)
|
ctx.sourcedb.remove_repo(name, txn=txn)
|
||||||
|
ctx.componentdb.remove_repo(name, txn=txn)
|
||||||
self.d.txn_proc(proc, txn)
|
self.d.txn_proc(proc, txn)
|
||||||
|
|
||||||
db = None
|
db = None
|
||||||
|
|||||||
Reference in New Issue
Block a user