Blob Blame History Raw
From 11670a122dcdf906ce811204c911f1463fceb6de Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Wed, 24 Aug 2016 09:41:09 +0200
Subject: [PATCH 01/10] Optimize code for dnf-2.0

---
 dnfdaemon.spec                      | 2 +-
 python/dnfdaemon/server/__init__.py | 2 +-
 python/dnfdaemon/server/backend.py  | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dnfdaemon.spec b/dnfdaemon.spec
index 9ece728..1054e1b 100644
--- a/dnfdaemon.spec
+++ b/dnfdaemon.spec
@@ -1,5 +1,5 @@
 %global dnf_org org.baseurl.Dnf
-%global dnf_version 1.1.0
+%global dnf_version 2.0.0
 
 Name:           dnfdaemon
 Version:        0.3.16
diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 4700c50..d304f9f 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -253,7 +253,7 @@ def get_groups(self):
                 grp = self.base.comps.group_by_pattern(obj.name)
                 if grp:
                     # FIXME: no dnf API to get if group is installed
-                    p_grp = self.base.group_persistor.group(grp.id)
+                    p_grp = self.base._group_persistor.group(grp.id)
                     if p_grp:
                         installed = p_grp.installed
                     else:
diff --git a/python/dnfdaemon/server/backend.py b/python/dnfdaemon/server/backend.py
index ee5bbc6..706ac9b 100644
--- a/python/dnfdaemon/server/backend.py
+++ b/python/dnfdaemon/server/backend.py
@@ -61,7 +61,7 @@ def __init__(self, parent):
     def expire_cache(self):
         """Make the current cache expire"""
         for repo in self.repos.iter_enabled():
-            repo.md_expire_cache()
+            repo._md_expire_cache()
 
     def setup_base(self):
         """Setup dnf Sack and init packages helper"""
@@ -126,7 +126,7 @@ def _sig_check_pkg(self, po):
                     might help.
               2 = Fatal GPG verification error, give up.
         """
-        if po.from_cmdline:
+        if po._from_cmdline:
             check = self.conf.localpkg_gpgcheck
             hasgpgkey = 0
         else:
@@ -270,7 +270,7 @@ class Packages:
     def __init__(self, base):
         self._base = base
         self._sack = base.sack
-        self._inst_na = self._sack.query().installed().na_dict()
+        self._inst_na = self._sack.query().installed()._na_dict()
 
     def filter_packages(self, pkg_list, replace=True):
         """Filter a list of package objects and replace

From 2207e88fde6b5564bc5bd19fcd95b628aa86eba3 Mon Sep 17 00:00:00 2001
From: Tim Lauridsen <tla@rasmil.dk>
Date: Wed, 22 Mar 2017 11:37:53 +0100
Subject: [PATCH 02/10] Update README.md

---
 README.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 6f6eaa8..0ae6c4e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
+23-03-2017: dnf-daemon if no longer under active development
+============================================================
+
 dnf-daemon
 ===========
 

From dda40e59a95dae95dc38eb9032317601690ba4fc Mon Sep 17 00:00:00 2001
From: Angelo Naselli <anaselli@linux.it>
Date: Tue, 7 Feb 2017 23:48:32 +0100
Subject: [PATCH 03/10] Fixed GetRepo() call to work with DNF 2.0

---
 python/dnfdaemon/server/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index d304f9f..231aba3 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -303,7 +303,7 @@ def get_repo(self, repo_id):
         value = json.dumps(None)
         repo = self.base.repos.get(repo_id, None)  # get the repo object
         if repo:
-            repo_conf = dict([(c, getattr(repo, c)) for c in repo.iterkeys()])
+            repo_conf = dict([(c, getattr(repo, c)) for c in repo._option.keys()])
             value = json.dumps(repo_conf)
         return value
 

From 085832aaa47475a865ff540e40fdc909d33814f4 Mon Sep 17 00:00:00 2001
From: Angelo Naselli <anaselli@linux.it>
Date: Mon, 20 Feb 2017 22:54:54 +0100
Subject: [PATCH 04/10] Fixed get_config() call to work with DNF 2.0

---
 python/dnfdaemon/server/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 231aba3..58d1b8f 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -286,7 +286,7 @@ def get_config(self, setting):
         """
         if setting == '*':  # Return all config
             cfg = self.base.conf
-            data = [(c, getattr(cfg, c)) for c in cfg.iterkeys()]
+            data = [(c, getattr(cfg, c)) for c in cfg._option.keys()]
             all_conf = dict(data)
             value = json.dumps(all_conf)
         elif hasattr(self.base.conf, setting):

From 34a4875f1ff12afed421ff5b0d072651d7bd124f Mon Sep 17 00:00:00 2001
From: Angelo Naselli <anaselli@linux.it>
Date: Sun, 19 Mar 2017 22:54:38 +0100
Subject: [PATCH 05/10] DNF 2.0 API change for installation of RPMs from
 URI/file path

In DNF 2.0, add_remote_rpm became add_remote_rpms using and
returning list of packages, so Install() needed to change accordingly
---
 python/dnfdaemon/server/__init__.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 58d1b8f..700983b 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -407,15 +407,20 @@ def group_remove(self, cmds):
     def install(self, cmds):
         """Install packages from pkg-specs."""
         value = 0
+        local_rpms = []
+        pkgs = []
         for cmd in cmds.split(' '):
             if cmd.endswith('.rpm'):  # install local .rpm
-                po = self.base.add_remote_rpm(cmd)
-                self.base.package_install(po)
+                local_rpms.append(cmd)
             else:
-                try:
-                    self.base.install(cmd)
-                except dnf.exceptions.MarkingError:
-                    pass
+                pkgs.append(cmd)
+        for pkg in self.base.add_remote_rpms(local_rpms):
+            self.base.package_install(pkg)
+        for pkg in pkgs:
+            try:
+                self.base.install(cmd)
+            except dnf.exceptions.MarkingError:
+                pass
         value = self.build_transaction()
         return value
 
@@ -495,7 +500,7 @@ def add_transaction(self, pkg_id, action):
             elif action == 'downgrade':
                 rc = self.base.package_downgrade(po)
             elif action == 'localinstall':
-                po = self.base.add_remote_rpm(pkg_id)
+                po = self.base.add_remote_rpms([pkg_id])
                 rc = self.base.package_install(po)
             else:
                 logger.error("unknown action : %s", action)

From 7a80869f6055098386c8d79ab18eb66d8ec9f6f1 Mon Sep 17 00:00:00 2001
From: Angelo Naselli <anaselli@linux.it>
Date: Mon, 20 Mar 2017 16:33:12 +0100
Subject: [PATCH 06/10] fixed install method if not for local rpm

---
 python/dnfdaemon/server/__init__.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 700983b..7636eda 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -408,19 +408,18 @@ def install(self, cmds):
         """Install packages from pkg-specs."""
         value = 0
         local_rpms = []
-        pkgs = []
         for cmd in cmds.split(' '):
             if cmd.endswith('.rpm'):  # install local .rpm
                 local_rpms.append(cmd)
             else:
-                pkgs.append(cmd)
+                try:
+                    self.base.install(cmd)
+                except dnf.exceptions.MarkingError:
+                    pass
+
         for pkg in self.base.add_remote_rpms(local_rpms):
             self.base.package_install(pkg)
-        for pkg in pkgs:
-            try:
-                self.base.install(cmd)
-            except dnf.exceptions.MarkingError:
-                pass
+
         value = self.build_transaction()
         return value
 

From e8a0d0431d4964d36e0a130f161445995e5af667 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Wed, 22 Mar 2017 09:51:01 -0400
Subject: [PATCH 07/10] dnf-daemon is under active development again

dnfdaemon development now is actively developed as part of
the manatools development.
---
 README.md | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/README.md b/README.md
index 0ae6c4e..6f6eaa8 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,3 @@
-23-03-2017: dnf-daemon if no longer under active development
-============================================================
-
 dnf-daemon
 ===========
 

From 1f8d65b1a90190f755cb144ae05775fe0384c45f Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Thu, 30 Mar 2017 09:01:54 -0400
Subject: [PATCH 08/10] Add new transaction callback identifiers from DNF 2.2.0

---
 python/dnfdaemon/server/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 7636eda..87b4bc4 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -108,7 +108,10 @@ def __init__(self, base):
                         dnf.callback.PKG_OBSOLETE: 'obsolete',
                         dnf.callback.PKG_REINSTALL: 'reinstall',
                         dnf.callback.PKG_UPGRADE: 'update',
-                        dnf.callback.PKG_VERIFY: 'verify'}
+                        dnf.callback.PKG_VERIFY: 'verify',
+                        dnf.callback.PKG_SCRIPTLET: 'scriptlet',
+                        dnf.callback.TRANS_PREPARATION: 'preptrans',
+                        dnf.callback.TRANS_POST: 'posttrans'}
 
         super(dnf.callback.TransactionProgress, self).__init__()
         self.base = base

From 0e35e3fe5e9c12b82f2e420e1c846722378fcce5 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Thu, 30 Mar 2017 09:02:55 -0400
Subject: [PATCH 09/10] spec: Bump to dnf 2.2.0 min, slight fixes to spec

---
 dnfdaemon.spec | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dnfdaemon.spec b/dnfdaemon.spec
index 1054e1b..a1404cd 100644
--- a/dnfdaemon.spec
+++ b/dnfdaemon.spec
@@ -1,5 +1,5 @@
 %global dnf_org org.baseurl.Dnf
-%global dnf_version 2.0.0
+%global dnf_version 2.2.0
 
 Name:           dnfdaemon
 Version:        0.3.16
@@ -51,20 +51,20 @@ Requires:       python3-gobject
 %description -n python3-%{name}
 Python 3 api for communicating with the dnf-daemon DBus service
 
-%package -n python-%{name}
+%package -n python2-%{name}
 Summary:        Python 2 api for communicating with the dnf-daemon DBus service
 Group:          Applications/System
 BuildRequires:  python2-devel
 Requires:       %{name} = %{version}-%{release}
 Requires:       pygobject3
+Provides:       python-%{name} = %{version}-%{release}
 
 %description -n python-%{name}
 Python 2 api for communicating with the dnf-daemon DBus service
 
+%post
 # apply the right selinux file context
 # http://fedoraproject.org/wiki/PackagingDrafts/SELinux#File_contexts
-
-%post
 semanage fcontext -a -t rpm_exec_t '%{_datadir}/%{name}/%{name}-system' 2>/dev/null || :
 restorecon -R %{_datadir}/%{name}/%{name}-system || :
 %systemd_post %{name}.service

From 82f4ac237aa2cf3f8ede0568a96e935c9416fe27 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Thu, 30 Mar 2017 09:07:22 -0400
Subject: [PATCH 10/10] Change Makefile to use manatools-dev branch

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 8321c05..143429a 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ BUMPED_MINOR=${shell VN=`cat ${APPNAME}.spec | grep Version| sed  's/${VER_REGEX
 NEW_VER=${shell cat ${APPNAME}.spec | grep Version| sed  's/\(^Version:\s*\)\([0-9]*\.[0-9]*\.\)\(.*\)/\2${BUMPED_MINOR}/'}
 NEW_REL=0.1.${GITDATE}
 DIST=${shell rpm --eval "%{dist}"}
-GIT_MASTER=develop
+GIT_MASTER=manatools-dev
 CURDIR = ${shell pwd}
 BUILDDIR= $(CURDIR)/build