From fd45b132b24ea3b941ce92a936e789864f272f51 Mon Sep 17 00:00:00 2001 From: Tim Lauridsen <timlau@fedoraproject.org> Date: Tue, 9 Jun 2015 13:47:08 +0200 Subject: [PATCH] Add support for getting all available updates, using 'update_all' filter. --- python/dnfdaemon/client/__init__.py | 2 +- python/dnfdaemon/server/__init__.py | 4 ++-- python/dnfdaemon/server/backend.py | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python/dnfdaemon/client/__init__.py b/python/dnfdaemon/client/__init__.py index 21c10b9..e3c07f2 100644 --- a/python/dnfdaemon/client/__init__.py +++ b/python/dnfdaemon/client/__init__.py @@ -104,7 +104,7 @@ import re import weakref import logging -CLIENT_API_VERSION = 1 +CLIENT_API_VERSION = 2 logger = logging.getLogger("dnfdaemon.client") diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py index 4f75220..15b61af 100644 --- a/python/dnfdaemon/server/__init__.py +++ b/python/dnfdaemon/server/__init__.py @@ -44,7 +44,7 @@ import logging import operator import sys -API_VERSION = 1 # API Version must be bumped at API changes +API_VERSION = 2 # API Version must be bumped at API changes MAINLOOP = GLib.MainLoop() # Fake attributes, there is simulating real package attribute @@ -339,7 +339,7 @@ class DnfDaemonBase(dbus.service.Object, DownloadCallback): """ value = [] if pkg_filter in ['installed', 'available', 'updates', 'obsoletes', - 'recent', 'extras']: + 'recent', 'extras', 'updates_all']: pkgs = getattr(self.base.packages, pkg_filter) value = [self._get_po_list(po, attrs) for po in pkgs] return json.dumps(value) diff --git a/python/dnfdaemon/server/backend.py b/python/dnfdaemon/server/backend.py index 47aa10d..dc224b3 100644 --- a/python/dnfdaemon/server/backend.py +++ b/python/dnfdaemon/server/backend.py @@ -164,6 +164,10 @@ class Packages: pkgs.append(po) return pkgs + @property + def updates_all(self): + return self.query.upgrades().latest().run() + @property def all(self): """Get all packages installed and available. -- GitLab