]> git.ipfire.org Git - people/stevee/pakfire.git/blobdiff - python/pakfire/base.py
Implement distro-sync.
[people/stevee/pakfire.git] / python / pakfire / base.py
index 943a999d86f79f77f12cad26b9ffe646712faf0d..6b53a496c80c0bd720979358587b188ae8d16a4e 100644 (file)
@@ -344,7 +344,7 @@ class Pakfire(object):
 
                t.run(logger=logger)
 
-       def update(self, pkgs=None, check=False, excludes=None, interactive=True, logger=None, **kwargs):
+       def update(self, pkgs=None, check=False, excludes=None, interactive=True, logger=None, sync=False, **kwargs):
                """
                        check indicates, if the method should return after calculation
                        of the transaction.
@@ -370,6 +370,14 @@ class Pakfire(object):
                        exclude = self.pool.create_relation(exclude)
                        request.lock(exclude)
 
+               # Update or downgrade to the latest version of all packages
+               # in the enabled repositories.
+               if sync:
+                       kwargs.update({
+                               "allow_downgrade" : True,
+                               "allow_uninstall" : True,
+                       })
+
                solver = self.pool.solve(request, logger=logger, **kwargs)
 
                if not solver.status: