* fix: read package info in remove component
* implement componentwise package ops, just take a look at this beauty: nebula:pisi$ ./pisi-cli -B -Dtmp it system.base The following minimal list of packages will be installed in the respective order to satisfy dependencies: file Installing file, version 4.12, release 1, build 2 Extracting files Storing files.xml, Storing metadata.xml. Regenerating /etc/ld.so.cache... Updating environment... running /sbin/ldconfig -X -r /home/exa/code/projects/pisi/tmp Installed file nebula:pisi$ ./pisi-cli -B -Dtmp rm system.base The following minimal list of packages will be removed in the respective order to satisfy dependencies: file Removing package file Not removing non-file, non-link /home/exa/code/projects/pisi/tmp/usr/share/man/man5 Removed file
This commit is contained in:
@@ -99,7 +99,7 @@ Legend:
|
||||
+ query list of packages in a component
|
||||
+ index: update component database(s)
|
||||
+ bug fixing
|
||||
- install/remove components
|
||||
+ install/remove/upgrade components
|
||||
- safety switch: preserve system.base, install system.devel for build, etc.
|
||||
+ multiple package repository (eray)
|
||||
+ decide how to implement
|
||||
|
||||
+13
-4
@@ -174,13 +174,22 @@ def check_conflicts(order):
|
||||
#raise Error(_("Package %s conflicts installed package %s") % (x, pkg))
|
||||
raise Error(_("Conflicts remain"))
|
||||
|
||||
def expand_components(A):
|
||||
Ap = set()
|
||||
for x in A:
|
||||
if ctx.componentdb.has_component(x):
|
||||
Ap = Ap.union(ctx.componentdb.get_component(x).packages)
|
||||
else:
|
||||
Ap.append(x)
|
||||
return Ap
|
||||
|
||||
def install_pkg_names(A):
|
||||
"""This is the real thing. It installs packages from
|
||||
the repository, trying to perform a minimum number of
|
||||
installs"""
|
||||
|
||||
A_0 = A = set(A) # A was a list, remove duplicates
|
||||
|
||||
# A was a list, remove duplicates and expand components
|
||||
A_0 = A = expand_components(set(A))
|
||||
ctx.ui.debug('A = %s' % str(A))
|
||||
|
||||
if len(A)==0:
|
||||
@@ -245,7 +254,7 @@ def upgrade_pkg_names(A = []):
|
||||
A = ctx.installdb.list_installed()
|
||||
|
||||
# filter packages that are not upgradable
|
||||
A_0 = A = set(A)
|
||||
A_0 = A = expand_components(set(A))
|
||||
Ap = []
|
||||
for x in A:
|
||||
if x.endswith('.pisi'):
|
||||
@@ -369,7 +378,7 @@ def remove(A):
|
||||
"""remove set A of packages from system (A is a list of package names)"""
|
||||
|
||||
# filter packages that are not installed
|
||||
A_0 = A = set(A)
|
||||
A_0 = A = expand_components(set(A))
|
||||
Ap = []
|
||||
for x in A:
|
||||
if ctx.installdb.is_installed(x):
|
||||
|
||||
@@ -86,6 +86,7 @@ class PackageDB(object):
|
||||
|
||||
def remove_package(self, name):
|
||||
name = str(name)
|
||||
package_info = self.d[name]
|
||||
del self.d[name]
|
||||
#FIXME: what's happening to dr?
|
||||
ctx.componentdb.remove_package(package_info.partOf, package_info.name)
|
||||
|
||||
Reference in New Issue
Block a user