* [gentoo-commits] proj/gnome:master commit in: app-admin/packagekit-base/files/, app-admin/packagekit-base/
@ 2014-11-24 23:32 Gilles Dartiguelongue
0 siblings, 0 replies; 3+ messages in thread
From: Gilles Dartiguelongue @ 2014-11-24 23:32 UTC (permalink / raw
To: gentoo-commits
commit: 9b91db87d5503448f53567ad2e0e462307485d25
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 24 22:48:44 2014 +0000
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Mon Nov 24 23:31:46 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=9b91db87
app-admin/packagekit-base: 1.0.1 → 1.0.3
---
.../files/packagekit-base-1.0.3-configure.patch | 11 +++++++++++
...kagekit-base-1.0.1.ebuild => packagekit-base-1.0.3.ebuild} | 9 ++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch b/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch
new file mode 100644
index 0000000..0c5c833
--- /dev/null
+++ b/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch
@@ -0,0 +1,11 @@
+--- configure.ac.old 2014-11-25 00:04:23.689888170 +0100
++++ configure.ac 2014-11-25 00:03:08.041580672 +0100
+@@ -464,7 +464,7 @@
+ fi
+
+ have_python_backend="no"
+-if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o $enable_portage = xyes; then
++if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o x$enable_portage = xyes; then
+ have_python_backend="yes"
+ fi
+ if test x$enable_apt = xyes; then
diff --git a/app-admin/packagekit-base/packagekit-base-1.0.1.ebuild b/app-admin/packagekit-base/packagekit-base-1.0.3.ebuild
similarity index 92%
rename from app-admin/packagekit-base/packagekit-base-1.0.1.ebuild
rename to app-admin/packagekit-base/packagekit-base-1.0.3.ebuild
index 07aa28f..ed33317 100644
--- a/app-admin/packagekit-base/packagekit-base-1.0.1.ebuild
+++ b/app-admin/packagekit-base/packagekit-base-1.0.3.ebuild
@@ -8,7 +8,7 @@ EAPI="5"
# Future note: use --enable-python3
PYTHON_COMPAT=( python2_7 )
-inherit bash-completion-r1 eutils multilib nsplugins python-single-r1 systemd
+inherit autotools bash-completion-r1 eutils multilib nsplugins python-single-r1 systemd
MY_PN="PackageKit"
MY_P=${MY_PN}-${PV}
@@ -60,6 +60,13 @@ S="${WORKDIR}/${MY_P}"
RESTRICT="test"
+src_prepare() {
+ # Fix python backend detection
+ epatch "${FILESDIR}"/${PN}-1.0.3-configure.patch
+
+ eautoreconf
+}
+
src_configure() {
econf \
--disable-gstreamer-plugin \
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/gnome:master commit in: app-admin/packagekit-base/files/, app-admin/packagekit-base/
@ 2015-05-03 17:11 Gilles Dartiguelongue
0 siblings, 0 replies; 3+ messages in thread
From: Gilles Dartiguelongue @ 2015-05-03 17:11 UTC (permalink / raw
To: gentoo-commits
commit: 9d68c72164dd906c24e81a683353760e71671d9b
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun May 3 17:05:30 2015 +0000
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun May 3 17:10:33 2015 +0000
URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=9d68c721
app-admin/packagekit-base: 1.0.3 → 1.0.6
Make portage backend less broken.
.../0001-Fix-typo-python-backend-detection.patch | 25 +
.../0002-Sort-imports-according-to-PEP8.patch | 72 ++
.../files/0003-Update-layman-API-usage-to-2.patch | 104 +++
.../files/0004-Use-python-idioms.patch | 191 +++++
.../0005-Enhance-get_repo_list-function.patch | 56 ++
...-_get_cpv_slotted-with-collections-module.patch | 41 ++
.../files/0007-Simplify-_get_metadata.patch | 42 ++
.../files/0008-Remove-useless-instruction.patch | 24 +
.../packagekit-base/files/0009-Cosmetics.patch | 800 +++++++++++++++++++++
...010-Add-helper-to-change-portage-settings.patch | 73 ++
...1-Remove-compatibility-with-older-portage.patch | 77 ++
...PI-and-KEYWORDS-before-calling-setcpv-met.patch | 36 +
.../files/packagekit-base-1.0.3-configure.patch | 11 -
...e-1.0.3.ebuild => packagekit-base-1.0.6.ebuild} | 40 +-
14 files changed, 1563 insertions(+), 29 deletions(-)
diff --git a/app-admin/packagekit-base/files/0001-Fix-typo-python-backend-detection.patch b/app-admin/packagekit-base/files/0001-Fix-typo-python-backend-detection.patch
new file mode 100644
index 0000000..5786d87
--- /dev/null
+++ b/app-admin/packagekit-base/files/0001-Fix-typo-python-backend-detection.patch
@@ -0,0 +1,25 @@
+From ff0e2a1fe4f32def11b74e9eb7ffa7989e3061d8 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 18:37:24 +0200
+Subject: [PATCH 01/12] Fix typo python backend detection
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 655507f..844c454 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -454,7 +454,7 @@ if test x$enable_hif = xyes; then
+ fi
+
+ have_python_backend="no"
+-if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o $enable_portage = xyes; then
++if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o x$enable_portage = xyes; then
+ have_python_backend="yes"
+ fi
+ AM_CONDITIONAL(HAVE_PYTHON_BACKEND, test x$have_python_backend = xyes)
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0002-Sort-imports-according-to-PEP8.patch b/app-admin/packagekit-base/files/0002-Sort-imports-according-to-PEP8.patch
new file mode 100644
index 0000000..abb8720
--- /dev/null
+++ b/app-admin/packagekit-base/files/0002-Sort-imports-according-to-PEP8.patch
@@ -0,0 +1,72 @@
+From 6d62155472c3ae1f85a756518e9014425354511d Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 12:08:43 +0200
+Subject: [PATCH 02/12] Sort imports according to PEP8
+
+---
+ backends/portage/portageBackend.py | 39 ++++++++++++++++++--------------------
+ 1 file changed, 18 insertions(+), 21 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 82bf6cd..f403986 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -22,37 +22,34 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ import os
++import re
++import signal
++import sys
+ import traceback
++from itertools import izip
+
+-
++# layman imports
++import layman.config
++import layman.db
+ # packagekit imports
++from packagekit.backend import (
++ PackageKitBaseBackend,
++ get_package_id,
++ split_package_id,
++)
+ from packagekit.enums import *
+-
+-from packagekit.backend import PackageKitBaseBackend, \
+- get_package_id, split_package_id
+-from packagekit.progress import *
+ from packagekit.package import PackagekitPackage
+-
++from packagekit.progress import *
+ # portage imports
+-import portage
+-import portage.versions
+-import portage.dep
++import _emerge.AtomArg
+ import _emerge.actions
+-import _emerge.stdout_spinner
+ import _emerge.create_depgraph_params
+-import _emerge.AtomArg
++import _emerge.stdout_spinner
++import portage
++import portage.dep
++import portage.versions
+ from portage.exception import InvalidAtom
+
+-# layman imports
+-import layman.db
+-import layman.config
+-
+-# misc imports
+-import sys
+-import signal
+-import re
+-from itertools import izip
+-
+ # NOTES:
+ #
+ # Package IDs description:
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0003-Update-layman-API-usage-to-2.patch b/app-admin/packagekit-base/files/0003-Update-layman-API-usage-to-2.patch
new file mode 100644
index 0000000..afd94a2
--- /dev/null
+++ b/app-admin/packagekit-base/files/0003-Update-layman-API-usage-to-2.patch
@@ -0,0 +1,104 @@
+From b41a8c225d5fc593a10f54e10eba829c58d410d6 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 12:48:13 +0200
+Subject: [PATCH 03/12] Update layman API usage to >=2
+
+---
+ backends/portage/portageBackend.py | 44 ++++++++++++++------------------------
+ 1 file changed, 16 insertions(+), 28 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index f403986..7ad23ec 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -28,9 +28,10 @@ import sys
+ import traceback
+ from itertools import izip
+
+-# layman imports
++# layman imports (>=2)
+ import layman.config
+ import layman.db
++import layman.remotedb
+ # packagekit imports
+ from packagekit.backend import (
+ PackageKitBaseBackend,
+@@ -1050,17 +1051,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ self.allow_cancel(True)
+ self.percentage(None)
+
+- # get installed and available dbs
+- if hasattr(layman.config, "Config"):
+- installed_layman_db = layman.db.DB(layman.config.Config())
+- else:
+- installed_layman_db = layman.db.DB(layman.config.BareConfig())
+-
+- if hasattr(layman.config, "Config"):
+- available_layman_db = layman.db.RemoteDB(layman.config.Config())
+- else:
+- available_layman_db = layman.db.RemoteDB(layman.config.BareConfig())
+-
++ conf = layman.config.BareConfig()
++ conf.set_option('quiet', True)
++ installed_layman_db = layman.db.DB(conf)
++ available_layman_db = layman.remotedb.RemoteDB(conf)
+
+ # 'gentoo' is a dummy repo
+ self.repo_detail('gentoo', 'Gentoo Portage tree', True)
+@@ -1386,15 +1380,9 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ myopts = {'--quiet': True}
+
+- # get installed and available dbs
+- if hasattr(layman.config, "Config"):
+- layman_opts = {"quiet": True}
+- installed_layman_db = layman.db.DB(layman.config.Config())
+- else:
+- layman_opts = {}
+- conf = layman.config.BareConfig()
+- conf.set_option("quiet", True)
+- installed_layman_db = layman.db.DB(conf)
++ conf = layman.config.BareConfig()
++ conf.set_option('quiet', True)
++ installed_layman_db = layman.db.DB(conf)
+
+ if force:
+ timestamp_path = os.path.join(
+@@ -1404,8 +1392,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ try:
+ self._block_output()
+- for o in installed_layman_db.overlays.keys():
+- installed_layman_db.sync(o, **layman_opts)
++ for overlay in installed_layman_db.overlays.keys():
++ installed_layman_db.sync(overlay)
+ _emerge.actions.action_sync(self.pvar.settings, self.pvar.trees,
+ self.pvar.mtimedb, myopts, "")
+ except:
+@@ -1541,9 +1529,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ "gentoo repository can't be disabled")
+ return
+
+- # get installed and available dbs
+- installed_layman_db = layman.db.DB(layman.config.Config())
+- available_layman_db = layman.db.RemoteDB(layman.config.Config())
++ conf = layman.config.BareConfig()
++ conf.set_option('quiet', True)
++ installed_layman_db = layman.db.DB(conf)
++ available_layman_db = layman.remotedb.RemoteDB(conf)
+
+ # check now for repoid so we don't have to do it after
+ if not repoid in available_layman_db.overlays.keys():
+@@ -1567,8 +1556,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ try:
+ # TODO: clean the trick to prevent outputs from layman
+ self._block_output()
+- installed_layman_db.add(available_layman_db.select(repoid),
+- quiet=True)
++ installed_layman_db.add(available_layman_db.select(repoid))
+ self._unblock_output()
+ except Exception, e:
+ self._unblock_output()
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0004-Use-python-idioms.patch b/app-admin/packagekit-base/files/0004-Use-python-idioms.patch
new file mode 100644
index 0000000..dc9c982
--- /dev/null
+++ b/app-admin/packagekit-base/files/0004-Use-python-idioms.patch
@@ -0,0 +1,191 @@
+From e8520218790e939ee69891e1031ba7c9934959a1 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 12:49:15 +0200
+Subject: [PATCH 04/12] Use python idioms
+
+---
+ backends/portage/portageBackend.py | 80 ++++++++++++--------------------------
+ 1 file changed, 25 insertions(+), 55 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 7ad23ec..f37542e 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -191,10 +191,10 @@ class PortageBridge():
+ self.settings.backup_changes("ACCEPT_PROPERTIES")
+
+ # do not log with mod_echo (cleanly prevent some outputs)
+- def filter_echo(x): return x != 'echo'
+- elogs = self.settings["PORTAGE_ELOG_SYSTEM"].split()
+- elogs = filter(filter_echo, elogs)
+- self.settings["PORTAGE_ELOG_SYSTEM"] = ' '.join(elogs)
++ self.settings["PORTAGE_ELOG_SYSTEM"] = ' '.join([
++ elog for elog in self.settings["PORTAGE_ELOG_SYSTEM"].split()
++ if elog != 'echo'
++ ])
+ self.settings.backup_changes("PORTAGE_ELOG_SYSTEM")
+
+ # finally, regenerate settings and lock them again
+@@ -237,9 +237,7 @@ class PackageKitPortageMixin(object):
+ return TRANSACTION_FLAG_ONLY_DOWNLOAD in transaction_flags
+
+ def _is_repo_enabled(self, layman_db, repo_name):
+- if repo_name in layman_db.overlays.keys():
+- return True
+- return False
++ return repo_name in layman_db.overlays.keys()
+
+ def _get_search_list(self, keys_list):
+ '''
+@@ -334,18 +332,10 @@ class PackageKitPortageMixin(object):
+ return InternalPackageSet
+
+ def _is_installed(self, cpv):
+- if self.pvar.vardb.cpv_exists(cpv):
+- return True
+- return False
++ return self.pvar.vardb.cpv_exists(cpv)
+
+ def _is_cpv_valid(self, cpv):
+- if self._is_installed(cpv):
+- # actually if is_installed return True that means cpv is in db
+- return True
+- elif self.pvar.portdb.cpv_exists(cpv):
+- return True
+-
+- return False
++ return any([self._is_installed(cpv), self.pvar.portdb.cpv_exists(cpv)])
+
+ def _get_real_license_str(self, cpv, metadata):
+ # use conditionals info (w/ USE) in LICENSE and remove ||
+@@ -354,9 +344,7 @@ class PackageKitPortageMixin(object):
+ portage.dep.paren_reduce(metadata["LICENSE"]),
+ uselist=ebuild_settings.get("USE", "").split())))
+ license.discard('||')
+- license = ' '.join(license)
+-
+- return license
++ return ' '.join(license)
+
+ def _signal_config_update(self):
+ result = list(portage.util.find_updated_config_files(
+@@ -472,10 +460,7 @@ class PackageKitPortageMixin(object):
+ vartree=self.pvar.vardb)
+
+ contents = db.getcontents()
+- if not contents:
+- return []
+-
+- return db.getcontents().keys()
++ return contents.keys() if contents else []
+
+ def _cmp_cpv(self, cpv1, cpv2):
+ '''
+@@ -535,10 +520,7 @@ class PackageKitPortageMixin(object):
+ size = 0
+ if self._is_installed(cpv):
+ size = self._get_metadata(cpv, ["SIZE"])[0]
+- if size == '':
+- size = 0
+- else:
+- size = int(size)
++ size = int(size) if size else 0
+ else:
+ self
+ metadata = self._get_metadata(cpv, ["IUSE", "SLOT"], in_dict=True)
+@@ -553,8 +535,7 @@ class PackageKitPortageMixin(object):
+
+ fetch_file = self.pvar.portdb.getfetchsizes(package[2],
+ package.use.enabled)
+- for f in fetch_file:
+- size += fetch_file[f]
++ size = sum(fetch_file)
+
+ return size
+
+@@ -670,14 +651,12 @@ class PackageKitPortageMixin(object):
+ if FILTER_INSTALLED in filters:
+ cpv_list = self.pvar.vardb.match(cp)
+ elif FILTER_NOT_INSTALLED in filters:
+- for cpv in self.pvar.portdb.match(cp):
+- if not self._is_installed(cpv):
+- cpv_list.append(cpv)
++ cpv_list = [cpv for cpv in self.pvar.portdb.match(cp)
++ if not self._is_installed(cpv)]
+ else:
+ cpv_list = self.pvar.vardb.match(cp)
+- for cpv in self.pvar.portdb.match(cp):
+- if cpv not in cpv_list:
+- cpv_list.append(cpv)
++ cpv_list.extend(self.pvar.portdb.match(cp))
++ cpv_list = set(cpv_list)
+
+ # free filter
+ cpv_list = self._filter_free(cpv_list, filters)
+@@ -714,22 +693,18 @@ class PackageKitPortageMixin(object):
+ pkg_keywords, repo, slot = self._get_metadata(cpv,
+ ["KEYWORDS", "repository", "SLOT"])
+
+- pkg_keywords = pkg_keywords.split()
+- sys_keywords = self.pvar.settings["ACCEPT_KEYWORDS"].split()
+- keywords = []
+-
+- for x in sys_keywords:
+- if x in pkg_keywords:
+- keywords.append(x)
++ # filter accepted keywords
++ keywords = list(set(pkg_keywords.split()).intersection(
++ set(self.pvar.settings["ACCEPT_KEYWORDS"].split())
++ ))
+
+ # if no keywords, check in package.keywords
+ if not keywords:
+ key_dict = self.pvar.settings.pkeywordsdict.get(
+ portage.dep.dep_getkey(cpv))
+ if key_dict:
+- for _, keys in key_dict.iteritems():
+- for x in keys:
+- keywords.append(x)
++ for keys in key_dict.values():
++ keyword.extend(keys)
+
+ if not keywords:
+ keywords.append("no keywords")
+@@ -942,9 +917,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ # now we can change cpv_list to a real cpv list
+ tmp_list = cpv_list[:]
+- cpv_list = []
+- for x in tmp_list:
+- cpv_list.append(x[2])
++ cpv_list = [x[2] for x in tmp_list]
+ del tmp_list
+
+ # free filter
+@@ -1100,12 +1073,9 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ cpv_input.append(cpv)
+
+- packages_list = self._get_required_packages(cpv_input, recursive)
+-
+ # now we can populate cpv_list
+- cpv_list = []
+- for p in packages_list:
+- cpv_list.append(p.cpv)
++ packages_list = self._get_required_packages(cpv_input, recursive)
++ cpv_list = [package.cpv for package in packages_list]
+ del packages_list
+
+ # free filter
+@@ -1535,7 +1505,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ available_layman_db = layman.remotedb.RemoteDB(conf)
+
+ # check now for repoid so we don't have to do it after
+- if not repoid in available_layman_db.overlays.keys():
++ if repoid not in available_layman_db.overlays.keys():
+ self.error(ERROR_REPO_NOT_FOUND,
+ "Repository %s was not found" % repoid)
+ return
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0005-Enhance-get_repo_list-function.patch b/app-admin/packagekit-base/files/0005-Enhance-get_repo_list-function.patch
new file mode 100644
index 0000000..4f093e2
--- /dev/null
+++ b/app-admin/packagekit-base/files/0005-Enhance-get_repo_list-function.patch
@@ -0,0 +1,56 @@
+From 97afdc42a3cd50de94d824fab06b8c4a13a20c29 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 12:58:40 +0200
+Subject: [PATCH 05/12] Enhance get_repo_list function
+
+Adds a PEP257 docstring and use layman API to provide a description to
+repositories.
+---
+ backends/portage/portageBackend.py | 24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index f37542e..ddeca0d 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -1016,10 +1016,14 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ self.percentage(100)
+
+ def get_repo_list(self, filters):
+- # NOTES:
+- # use layman API
+- # returns only official and supported repositories
+- # and creates a dummy repo for portage tree
++ """ Get list of repository.
++
++ Get the list of repository tagged as official and supported by current
++ setup of layman.
++
++ Adds a dummy entry for gentoo-x86 official tree even though it appears
++ in layman's listing nowadays.
++ """
+ self.status(STATUS_INFO)
+ self.allow_cancel(True)
+ self.percentage(None)
+@@ -1033,11 +1037,13 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ self.repo_detail('gentoo', 'Gentoo Portage tree', True)
+
+ if FILTER_NOT_DEVELOPMENT not in filters:
+- for o in available_layman_db.overlays.keys():
+- if available_layman_db.overlays[o].is_official() \
+- and available_layman_db.overlays[o].is_supported():
+- self.repo_detail(o, o,
+- self._is_repo_enabled(installed_layman_db, o))
++ for repo_name, overlay in available_layman_db.overlays.items():
++ if overlay.is_official() and overlay.is_supported():
++ self.repo_detail(
++ repo_name,
++ overlay.name,
++ self._is_repo_enabled(installed_layman_db, repo_name)
++ )
+
+ def required_by(self, filters, pkgs, recursive):
+ # TODO: manage non-installed package
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0006-Simplify-_get_cpv_slotted-with-collections-module.patch b/app-admin/packagekit-base/files/0006-Simplify-_get_cpv_slotted-with-collections-module.patch
new file mode 100644
index 0000000..6f47b1d
--- /dev/null
+++ b/app-admin/packagekit-base/files/0006-Simplify-_get_cpv_slotted-with-collections-module.patch
@@ -0,0 +1,41 @@
+From d581bea1699a8d9982e91a5de2b8dd315b6c2c54 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 13:05:27 +0200
+Subject: [PATCH 06/12] Simplify _get_cpv_slotted with collections module
+
+---
+ backends/portage/portageBackend.py | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index ddeca0d..773256a 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -26,6 +26,7 @@ import re
+ import signal
+ import sys
+ import traceback
++from collections import defaultdict
+ from itertools import izip
+
+ # layman imports (>=2)
+@@ -540,14 +541,11 @@ class PackageKitPortageMixin(object):
+ return size
+
+ def _get_cpv_slotted(self, cpv_list):
+- cpv_dict = {}
++ cpv_dict = defaultdict(list)
+
+ for cpv in cpv_list:
+ slot = self._get_metadata(cpv, ["SLOT"])[0]
+- if slot not in cpv_dict:
+- cpv_dict[slot] = [cpv]
+- else:
+- cpv_dict[slot].append(cpv)
++ cpv_dict[slot].append(cpv)
+
+ return cpv_dict
+
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0007-Simplify-_get_metadata.patch b/app-admin/packagekit-base/files/0007-Simplify-_get_metadata.patch
new file mode 100644
index 0000000..ed158fe
--- /dev/null
+++ b/app-admin/packagekit-base/files/0007-Simplify-_get_metadata.patch
@@ -0,0 +1,42 @@
+From fa38519e8b0785199a1181e5cc7287190a29fc44 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 17:54:15 +0200
+Subject: [PATCH 07/12] Simplify _get_metadata
+
+---
+ backends/portage/portageBackend.py | 16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 773256a..fc2d45a 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -497,19 +497,15 @@ class PackageKitPortageMixin(object):
+ If in_dict is True, metadata is returned in a dict object.
+ If add_cache_keys is True, cached keys are added to keys in parameter.
+ '''
+- if self._is_installed(cpv):
+- aux_get = self.pvar.vardb.aux_get
+- if add_cache_keys:
+- keys.extend(list(self.pvar.vardb._aux_cache_keys))
+- else:
+- aux_get = self.pvar.portdb.aux_get
+- if add_cache_keys:
+- keys.extend(list(self.pvar.portdb._aux_cache_keys))
++ db = self.pvar.vardb if self._is_installed(cpv) else self.pvar.portdb
++
++ if add_cache_keys:
++ keys.extend(list(db._aux_cache_keys))
+
+ if in_dict:
+- return dict(izip(keys, aux_get(cpv, keys)))
++ return dict(izip(keys, db.aux_get(cpv, keys)))
+ else:
+- return aux_get(cpv, keys)
++ return db.aux_get(cpv, keys)
+
+ def _get_size(self, cpv):
+ '''
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0008-Remove-useless-instruction.patch b/app-admin/packagekit-base/files/0008-Remove-useless-instruction.patch
new file mode 100644
index 0000000..e568727
--- /dev/null
+++ b/app-admin/packagekit-base/files/0008-Remove-useless-instruction.patch
@@ -0,0 +1,24 @@
+From 775b16156373b08a7bdd50c446d740051db93a8d Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 14:27:08 +0200
+Subject: [PATCH 08/12] Remove useless instruction
+
+---
+ backends/portage/portageBackend.py | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index fc2d45a..4ca4fb5 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -519,7 +519,6 @@ class PackageKitPortageMixin(object):
+ size = self._get_metadata(cpv, ["SIZE"])[0]
+ size = int(size) if size else 0
+ else:
+- self
+ metadata = self._get_metadata(cpv, ["IUSE", "SLOT"], in_dict=True)
+
+ package = _emerge.Package.Package(
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0009-Cosmetics.patch b/app-admin/packagekit-base/files/0009-Cosmetics.patch
new file mode 100644
index 0000000..e3bf255
--- /dev/null
+++ b/app-admin/packagekit-base/files/0009-Cosmetics.patch
@@ -0,0 +1,800 @@
+From 53ff394fdadfccc90f24d35f3c6333d853825a74 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 14:26:20 +0200
+Subject: [PATCH 09/12] Cosmetics
+
+---
+ backends/portage/portageBackend.py | 348 ++++++++++++++++++++-----------------
+ 1 file changed, 191 insertions(+), 157 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 4ca4fb5..9775466 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -84,8 +84,8 @@ class PortagePackageGroups(dict):
+ 'name': "Office",
+ 'description': "Applications used in office environments",
+ 'categories': ['app-office', 'app-pda', 'app-mobilephone',
+- 'app-cdr', 'app-antivirus', 'app-laptop', 'mail-',
+- ],
++ 'app-cdr', 'app-antivirus', 'app-laptop',
++ 'mail-'],
+ },
+ 'development': {
+ 'name': "Development",
+@@ -104,56 +104,47 @@ class PortagePackageGroups(dict):
+ },
+ 'gnome': {
+ 'name': "GNOME Desktop",
+- 'description': \
+- "Applications and libraries for the GNOME Desktop",
++ 'description': "Applications and libraries for the GNOME Desktop",
+ 'categories': ['gnome-'],
+ },
+ 'kde': {
+ 'name': "KDE Desktop",
+- 'description': \
+- "Applications and libraries for the KDE Desktop",
++ 'description': "Applications and libraries for the KDE Desktop",
+ 'categories': ['kde-'],
+ },
+ 'xfce': {
+ 'name': "XFCE Desktop",
+- 'description': \
+- "Applications and libraries for the XFCE Desktop",
++ 'description': "Applications and libraries for the XFCE Desktop",
+ 'categories': ['xfce-'],
+ },
+ 'lxde': {
+ 'name': "LXDE Desktop",
+- 'description': \
+- "Applications and libraries for the LXDE Desktop",
++ 'description': "Applications and libraries for the LXDE Desktop",
+ 'categories': ['lxde-'],
+ },
+ 'multimedia': {
+ 'name': "Multimedia",
+- 'description': \
+- "Applications and libraries for Multimedia",
++ 'description': "Applications and libraries for Multimedia",
+ 'categories': ['media-'],
+ },
+ 'networking': {
+ 'name': "Networking",
+- 'description': \
+- "Applications and libraries for Networking",
++ 'description': "Applications and libraries for Networking",
+ 'categories': ['net-', 'www-'],
+ },
+ 'science': {
+ 'name': "Science",
+- 'description': \
+- "Scientific applications and libraries",
++ 'description': "Scientific applications and libraries",
+ 'categories': ['sci-'],
+ },
+ 'security': {
+ 'name': "Security",
+- 'description': \
+- "Security orientend applications",
++ 'description': "Security orientend applications",
+ 'categories': ['app-antivirus', 'net-analyzer', 'net-firewall'],
+ },
+ 'x11': {
+ 'name': "X11",
+- 'description': \
+- "Applications and libraries for X11",
++ 'description': "Applications and libraries for X11",
+ 'categories': ['x11-'],
+ },
+ }
+@@ -179,7 +170,7 @@ class PortageBridge():
+
+ def update(self):
+ self.settings, self.trees, self.mtimedb = \
+- _emerge.actions.load_emerge_config()
++ _emerge.actions.load_emerge_config()
+ self.vardb = self.trees[self.settings['ROOT']]['vartree'].dbapi
+ self.portdb = self.trees[self.settings['ROOT']]['porttree'].dbapi
+ self.root_config = self.trees[self.settings['ROOT']]['root_config']
+@@ -299,8 +290,8 @@ class PackageKitPortageMixin(object):
+ Return PackageKit group belonging to given Portage package.
+ """
+ category = portage.versions.catsplit(cp)[0]
+- group_data = [key for key, data in self._get_portage_groups().items() \
+- if category in data['categories']]
++ group_data = [key for key, data in self._get_portage_groups().items()
++ if category in data['categories']]
+ try:
+ generic_group_name = group_data.pop(0)
+ except IndexError:
+@@ -341,9 +332,12 @@ class PackageKitPortageMixin(object):
+ def _get_real_license_str(self, cpv, metadata):
+ # use conditionals info (w/ USE) in LICENSE and remove ||
+ ebuild_settings = self._get_ebuild_settings(cpv, metadata)
+- license = set(portage.flatten(portage.dep.use_reduce(
+- portage.dep.paren_reduce(metadata["LICENSE"]),
+- uselist=ebuild_settings.get("USE", "").split())))
++ license = set(portage.flatten(
++ portage.dep.use_reduce(
++ portage.dep.paren_reduce(metadata["LICENSE"]),
++ uselist=ebuild_settings.get("USE", "").split()
++ )
++ ))
+ license.discard('||')
+ return ' '.join(license)
+
+@@ -353,10 +347,12 @@ class PackageKitPortageMixin(object):
+ self.pvar.settings.get('CONFIG_PROTECT', '').split()))
+
+ if result:
+- message = "Some configuration files need updating."
+- message += ";You should use Gentoo's tools to update them (dispatch-conf)"
+- message += ";If you can't do that, ask your system administrator."
+- self.message(MESSAGE_CONFIG_FILES_CHANGED, message)
++ self.message(
++ MESSAGE_CONFIG_FILES_CHANGED,
++ "Some configuration files need updating."
++ ";You should use Gentoo's tools to update them (dispatch-conf)"
++ ";If you can't do that, ask your system administrator."
++ )
+
+ def _get_restricted_fetch_files(self, cpv, metadata):
+ '''
+@@ -374,28 +370,32 @@ class PackageKitPortageMixin(object):
+ ebuild_settings = self._get_ebuild_settings(cpv, metadata)
+
+ files = self.pvar.portdb.getFetchMap(cpv,
+- ebuild_settings['USE'].split())
++ ebuild_settings['USE'].split())
+
+ for f in files:
+ file_path = os.path.join(ebuild_settings["DISTDIR"], f)
+ if not os.access(file_path, os.F_OK):
+ missing_files.append([file_path, files[f]])
+
+- if len(missing_files) > 0:
+- return missing_files
+-
+- return None
++ return missing_files if missing_files else None
+
+ def _check_fetch_restrict(self, packages_list):
+- for p in packages_list:
+- if 'fetch' in p.metadata['RESTRICT']:
+- files = self._get_restricted_fetch_files(p.cpv, p.metadata)
+- if files:
+- message = "Package %s can't download some files." % p.cpv
+- message += ";Please, download manually the followonig file(s):"
+- for x in files:
+- message += ";- %s then copy it to %s" % (' '.join(x[1]), x[0])
+- self.error(ERROR_RESTRICTED_DOWNLOAD, message)
++ for pkg in packages_list:
++ if 'fetch' not in pkg.metadata['RESTRICT']:
++ continue
++
++ files = self._get_restricted_fetch_files(pkg.cpv, pkg.metadata)
++ if files:
++ message = (
++ "Package {0} can't download some files."
++ ";Please, download manually the following file(s): "
++ ).format(pkg.cpv)
++ message += ''.join([
++ ";- {0} then copy it to {1}"
++ .format(' '.join(file_info[1]), file_info[0])
++ for file_info in files
++ ])
++ self.error(ERROR_RESTRICTED_DOWNLOAD, message)
+
+ def _elog_listener(self, settings, key, logentries, fulltext):
+ '''
+@@ -440,12 +440,12 @@ class PackageKitPortageMixin(object):
+ # EAPI-2 compliant (at least)
+ # 'other' phase is ignored except this one, every phase should be there
+ if self._error_phase in ("setup", "unpack", "prepare", "configure",
+- "nofetch", "config", "info"):
++ "nofetch", "config", "info"):
+ error_type = ERROR_PACKAGE_FAILED_TO_CONFIGURE
+ elif self._error_phase in ("compile", "test"):
+ error_type = ERROR_PACKAGE_FAILED_TO_BUILD
+ elif self._error_phase in ("install", "preinst", "postinst",
+- "package"):
++ "package"):
+ error_type = ERROR_PACKAGE_FAILED_TO_INSTALL
+ elif self._error_phase in ("prerm", "postrm"):
+ error_type = ERROR_PACKAGE_FAILED_TO_REMOVE
+@@ -457,8 +457,8 @@ class PackageKitPortageMixin(object):
+ def _get_file_list(self, cpv):
+ cat, pv = portage.versions.catsplit(cpv)
+ db = portage.dblink(cat, pv, self.pvar.settings['ROOT'],
+- self.pvar.settings, treetype="vartree",
+- vartree=self.pvar.vardb)
++ self.pvar.settings, treetype="vartree",
++ vartree=self.pvar.vardb)
+
+ contents = db.getcontents()
+ return contents.keys() if contents else []
+@@ -470,7 +470,7 @@ class PackageKitPortageMixin(object):
+ returns -1 if cpv1 < cpv2
+ '''
+ return portage.versions.pkgcmp(portage.versions.pkgsplit(cpv1),
+- portage.versions.pkgsplit(cpv2))
++ portage.versions.pkgsplit(cpv2))
+
+ def _get_newest_cpv(self, cpv_list, installed):
+ newer = ""
+@@ -491,7 +491,7 @@ class PackageKitPortageMixin(object):
+
+ return newer
+
+- def _get_metadata(self, cpv, keys, in_dict = False, add_cache_keys = False):
++ def _get_metadata(self, cpv, keys, in_dict=False, add_cache_keys=False):
+ '''
+ This function returns required metadata.
+ If in_dict is True, metadata is returned in a dict object.
+@@ -522,15 +522,15 @@ class PackageKitPortageMixin(object):
+ metadata = self._get_metadata(cpv, ["IUSE", "SLOT"], in_dict=True)
+
+ package = _emerge.Package.Package(
+- type_name="ebuild",
+- built=False,
+- installed=False,
+- root_config=self.pvar.root_config,
+- cpv=cpv,
+- metadata=metadata)
+-
++ type_name="ebuild",
++ built=False,
++ installed=False,
++ root_config=self.pvar.root_config,
++ cpv=cpv,
++ metadata=metadata
++ )
+ fetch_file = self.pvar.portdb.getfetchsizes(package[2],
+- package.use.enabled)
++ package.use.enabled)
+ size = sum(fetch_file)
+
+ return size
+@@ -668,10 +668,11 @@ class PackageKitPortageMixin(object):
+
+ if len(ret) < 4:
+ self.error(ERROR_PACKAGE_ID_INVALID,
+- "The package id %s does not contain 4 fields" % pkgid)
++ "The package id %s does not contain 4 fields" % pkgid)
+ if '/' not in ret[0]:
+ self.error(ERROR_PACKAGE_ID_INVALID,
+- "The first field of the package id must contain a category")
++ "The first field of the package id must contain"
++ " a category")
+
+ # remove slot info from version field
+ version = ret[1].split(':')[0]
+@@ -683,8 +684,9 @@ class PackageKitPortageMixin(object):
+ Transform the cpv (portage) to a package id (packagekit)
+ '''
+ package, version, rev = portage.versions.pkgsplit(cpv)
+- pkg_keywords, repo, slot = self._get_metadata(cpv,
+- ["KEYWORDS", "repository", "SLOT"])
++ pkg_keywords, repo, slot = self._get_metadata(
++ cpv, ["KEYWORDS", "repository", "SLOT"]
++ )
+
+ # filter accepted keywords
+ keywords = list(set(pkg_keywords.split()).intersection(
+@@ -694,7 +696,8 @@ class PackageKitPortageMixin(object):
+ # if no keywords, check in package.keywords
+ if not keywords:
+ key_dict = self.pvar.settings.pkeywordsdict.get(
+- portage.dep.dep_getkey(cpv))
++ portage.dep.dep_getkey(cpv)
++ )
+ if key_dict:
+ for keys in key_dict.values():
+ keyword.extend(keys)
+@@ -702,7 +705,7 @@ class PackageKitPortageMixin(object):
+ if not keywords:
+ keywords.append("no keywords")
+ self.message(MESSAGE_UNKNOWN,
+- "No keywords have been found for %s" % cpv)
++ "No keywords have been found for %s" % cpv)
+
+ # don't want to see -r0
+ if rev != "r0":
+@@ -728,19 +731,23 @@ class PackageKitPortageMixin(object):
+ myopts["--selective"] = True
+ myopts["--deep"] = True
+
+- myparams = _emerge.create_depgraph_params.create_depgraph_params(
+- myopts, "remove")
++ myparams = _emerge.create_depgraph_params \
++ .create_depgraph_params(myopts, "remove")
+ depgraph = _emerge.depgraph.depgraph(self.pvar.settings,
+- self.pvar.trees, myopts, myparams, None)
++ self.pvar.trees, myopts,
++ myparams, None)
+
+ # TODO: atm, using FILTER_INSTALLED because it's quicker
+ # and we don't want to manage non-installed packages
+ for cp in self._get_all_cp([FILTER_INSTALLED]):
+ for cpv in self._get_all_cpv(cp, [FILTER_INSTALLED]):
+ depgraph._dynamic_config._dep_stack.append(
+- _emerge.Dependency.Dependency(
+- atom=portage.dep.Atom('=' + cpv),
+- root=self.pvar.settings["ROOT"], parent=None))
++ _emerge.Dependency.Dependency(
++ atom=portage.dep.Atom('=' + cpv),
++ root=self.pvar.settings["ROOT"],
++ parent=None
++ )
++ )
+
+ if not depgraph._complete_graph():
+ self.error(ERROR_INTERNAL_ERROR, "Error when generating depgraph")
+@@ -851,23 +858,24 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ cpv = self._id_to_cpv(pkg)
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+ cpv_input.append('=' + cpv)
+
+ myopts = {}
+ myopts["--selective"] = True
+ myopts["--deep"] = True
+- myparams = _emerge.create_depgraph_params.create_depgraph_params(
+- myopts, "")
++ myparams = _emerge.create_depgraph_params \
++ .create_depgraph_params(myopts, "")
+
+- depgraph = _emerge.depgraph.depgraph(
+- self.pvar.settings, self.pvar.trees, myopts, myparams, None)
++ depgraph = _emerge.depgraph.depgraph(self.pvar.settings,
++ self.pvar.trees, myopts,
++ myparams, None)
+ retval, fav = depgraph.select_files(cpv_input)
+
+ if not retval:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+- "Wasn't able to get dependency graph")
++ "Wasn't able to get dependency graph")
+ return
+
+ def _add_children_to_list(cpv_list, node):
+@@ -937,18 +945,23 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+
+- metadata = self._get_metadata(cpv,
+- ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE", "SLOT"],
+- in_dict=True)
+- license = self._get_real_license_str(cpv, metadata)
++ metadata = self._get_metadata(
++ cpv, ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE", "SLOT"],
++ in_dict=True
++ )
+
+- self.details(self._cpv_to_id(cpv), '', license,
++ self.details(
++ self._cpv_to_id(cpv),
++ '',
++ self._get_real_license_str(cpv, metadata),
+ self._get_pk_group(cpv),
+- metadata["DESCRIPTION"], metadata["HOMEPAGE"],
+- self._get_size(cpv))
++ metadata["DESCRIPTION"],
++ metadata["HOMEPAGE"],
++ self._get_size(cpv)
++ )
+
+ pkg_processed += 100.0
+ self.percentage(int(pkg_processed/nb_pkg))
+@@ -968,19 +981,16 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+
+ if not self._is_installed(cpv):
+ self.error(ERROR_CANNOT_GET_FILELIST,
+- "get-files is only available for installed packages")
++ "get-files is only available for installed"
++ " packages")
+ continue
+
+- files = self._get_file_list(cpv)
+- files = sorted(files)
+- files = ";".join(files)
+-
+- self.files(pkg, files)
++ self.files(pkg, ';'.join(sorted(self._get_file_list(cpv))))
+
+ pkg_processed += 100.0
+ self.percentage(int(pkg_processed/nb_pkg))
+@@ -1055,7 +1065,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if FILTER_NOT_INSTALLED in filters:
+ self.error(ERROR_CANNOT_GET_REQUIRES,
+- "required-by returns only installed packages at the moment")
++ "required-by returns only installed packages"
++ " at the moment")
+ return
+
+ for pkg in pkgs:
+@@ -1063,11 +1074,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+ if not self._is_installed(cpv):
+ self.error(ERROR_CANNOT_GET_REQUIRES,
+- "required-by is only available for installed packages at the moment")
++ "required-by is only available for installed"
++ " packages at the moment")
+ continue
+
+ cpv_input.append(cpv)
+@@ -1105,7 +1117,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ cpv = self._id_to_cpv(pkg)
+
+ if not self.pvar.portdb.cpv_exists(cpv):
+- self.message(MESSAGE_COULD_NOT_FIND_PACKAGE, "could not find %s" % pkg)
++ self.message(MESSAGE_COULD_NOT_FIND_PACKAGE,
++ "could not find %s" % pkg)
+
+ for cpv in self.pvar.vardb.match(portage.versions.pkgsplit(cpv)[0]):
+ updates.append(cpv)
+@@ -1117,9 +1130,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ issued = ""
+ updated = ""
+
+- self.update_detail(pkg, updates, obsoletes, vendor_url, bugzilla_url,
+- cve_url, "none", "No update text", "No ChangeLog",
+- UPDATE_STATE_STABLE, issued, updated)
++ self.update_detail(
++ pkg, updates, obsoletes, vendor_url, bugzilla_url, cve_url,
++ "none", "No update text", "No ChangeLog", UPDATE_STATE_STABLE,
++ issued, updated
++ )
+
+ def get_updates(self, filters):
+ # NOTES:
+@@ -1150,7 +1165,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # get system and world packages
+ for s in ["system", "world"]:
+ sets = self._get_internal_package_set_class()(
+- initial_atoms=self.pvar.root_config.setconfig.getSetAtoms(s))
++ initial_atoms=self.pvar.root_config.setconfig.getSetAtoms(s)
++ )
+ for atom in sets:
+ update_candidates.append(atom.cp)
+
+@@ -1214,8 +1230,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ cpv_downgra[cp] = dict_down
+
+ # get security updates
+- for atom in self._get_internal_package_set_class()(
+- initial_atoms=self.pvar.root_config.setconfig.getSetAtoms("security")):
++ for atom in self._get_internal_package_set_class(
++ initial_atoms=self.pvar.root_config.setconfig
++ .getSetAtoms("security")
++ ):
+ # send update message and remove atom from cpv_updates
+ if atom.cp in cpv_updates:
+ slot = self._get_metadata(atom.cpv, ["SLOT"])[0]
+@@ -1269,12 +1287,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+
+ if self._is_installed(cpv):
+ self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
+- "Package %s is already installed" % pkg)
++ "Package %s is already installed" % pkg)
+ continue
+
+ cpv_list.append('=' + cpv)
+@@ -1283,7 +1301,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # but better to show it after important errors
+ if only_trusted:
+ self.error(ERROR_MISSING_GPG_SIGNATURE,
+- "Portage backend does not support GPG signature")
++ "Portage backend does not support GPG signature")
+ return
+
+ # creating installation depgraph
+@@ -1292,17 +1310,18 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ myopts['--fetchonly'] = True
+
+ favorites = []
+- myparams = _emerge.create_depgraph_params.create_depgraph_params(
+- myopts, "")
++ myparams = _emerge.create_depgraph_params \
++ .create_depgraph_params(myopts, "")
+
+ self.status(STATUS_DEP_RESOLVE)
+
+ depgraph = _emerge.depgraph.depgraph(self.pvar.settings,
+- self.pvar.trees, myopts, myparams, None)
++ self.pvar.trees, myopts,
++ myparams, None)
+ retval, favorites = depgraph.select_files(cpv_list)
+ if not retval:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+- "Wasn't able to get dependency graph")
++ "Wasn't able to get dependency graph")
+ return
+
+ # check fetch restrict, can stop the function via error signal
+@@ -1319,9 +1338,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ try:
+ self._block_output()
+ # compiling/installing
+- mergetask = _emerge.Scheduler.Scheduler(self.pvar.settings,
+- self.pvar.trees, self.pvar.mtimedb, myopts, None,
+- depgraph.altlist(), favorites, depgraph.schedulerGraph())
++ mergetask = _emerge.Scheduler.Scheduler(
++ self.pvar.settings, self.pvar.trees, self.pvar.mtimedb,
++ myopts, None, depgraph.altlist(), favorites,
++ depgraph.schedulerGraph()
++ )
+ rval = mergetask.merge()
+ finally:
+ self._unblock_output()
+@@ -1354,8 +1375,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ installed_layman_db = layman.db.DB(conf)
+
+ if force:
+- timestamp_path = os.path.join(
+- self.pvar.settings["PORTDIR"], "metadata", "timestamp.chk")
++ timestamp_path = os.path.join(self.pvar.settings["PORTDIR"],
++ "metadata", "timestamp.chk")
+ if os.access(timestamp_path, os.F_OK):
+ os.remove(timestamp_path)
+
+@@ -1364,7 +1385,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ for overlay in installed_layman_db.overlays.keys():
+ installed_layman_db.sync(overlay)
+ _emerge.actions.action_sync(self.pvar.settings, self.pvar.trees,
+- self.pvar.mtimedb, myopts, "")
++ self.pvar.mtimedb, myopts, "")
+ except:
+ self.error(ERROR_INTERNAL_ERROR, traceback.format_exc())
+ finally:
+@@ -1397,18 +1418,22 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_PACKAGE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+
+ if not self._is_installed(cpv):
+ self.error(ERROR_PACKAGE_NOT_INSTALLED,
+- "Package %s is not installed" % pkg)
++ "Package %s is not installed" % pkg)
+ continue
+
+ # stop removal if a package is in the system set
+ if portage.versions.pkgsplit(cpv)[0] in system_packages:
+- self.error(ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
+- "Package %s is a system package. If you really want to remove it, please use portage" % pkg)
++ self.error(
++ ERROR_CANNOT_REMOVE_SYSTEM_PACKAGE,
++ "Package %s is a system package. "
++ "If you really want to remove it, please use portage" %
++ pkg
++ )
+ continue
+
+ cpv_list.append(cpv)
+@@ -1416,41 +1441,45 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # backend do not implement autoremove
+ if autoremove:
+ self.message(MESSAGE_AUTOREMOVE_IGNORED,
+- "Portage backend do not implement autoremove option")
++ "Portage backend do not implement autoremove option")
+
+ # get packages needing candidates for removal
+- required_packages = self._get_required_packages(cpv_list, recursive=True)
++ required_packages = self._get_required_packages(cpv_list,
++ recursive=True)
+
+ # if there are required packages, allowdep must be on
+ if required_packages and not allowdep:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+- "Could not perform remove operation has packages are needed by other packages")
++ "Could not perform remove operation has packages "
++ "are needed by other packages")
+ return
+
+ # first, we add required packages
+ for p in required_packages:
+ package = _emerge.Package.Package(
+- type_name=p.type_name,
+- built=p.built,
+- installed=p.installed,
+- root_config=p.root_config,
+- cpv=p.cpv,
+- metadata=p.metadata,
+- operation='uninstall')
++ type_name=p.type_name,
++ built=p.built,
++ installed=p.installed,
++ root_config=p.root_config,
++ cpv=p.cpv,
++ metadata=p.metadata,
++ operation='uninstall'
++ )
+ packages.append(package)
+
+ # and now, packages we want really to remove
+ for cpv in cpv_list:
+ metadata = self._get_metadata(cpv, [],
+- in_dict=True, add_cache_keys=True)
++ in_dict=True, add_cache_keys=True)
+ package = _emerge.Package.Package(
+- type_name="ebuild",
+- built=True,
+- installed=True,
+- root_config=self.pvar.root_config,
+- cpv=cpv,
+- metadata=metadata,
+- operation="uninstall")
++ type_name="ebuild",
++ built=True,
++ installed=True,
++ root_config=self.pvar.root_config,
++ cpv=cpv,
++ metadata=metadata,
++ operation="uninstall"
++ )
+ packages.append(package)
+
+ if simulate:
+@@ -1467,9 +1496,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # now, we can remove
+ try:
+ self._block_output()
+- mergetask = _emerge.Scheduler.Scheduler(self.pvar.settings,
+- self.pvar.trees, self.pvar.mtimedb, mergelist=packages,
+- myopts={}, spinner=None, favorites=favorites, digraph=None)
++ mergetask = _emerge.Scheduler.Scheduler(
++ self.pvar.settings, self.pvar.trees, self.pvar.mtimedb,
++ mergelist=packages, myopts={}, spinner=None,
++ favorites=favorites, digraph=None
++ )
+ rval = mergetask.merge()
+ finally:
+ self._unblock_output()
+@@ -1495,7 +1526,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ if repoid == 'gentoo':
+ if not enable:
+ self.error(ERROR_CANNOT_DISABLE_REPOSITORY,
+- "gentoo repository can't be disabled")
++ "gentoo repository can't be disabled")
+ return
+
+ conf = layman.config.BareConfig()
+@@ -1506,7 +1537,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # check now for repoid so we don't have to do it after
+ if repoid not in available_layman_db.overlays.keys():
+ self.error(ERROR_REPO_NOT_FOUND,
+- "Repository %s was not found" % repoid)
++ "Repository %s was not found" % repoid)
+ return
+
+ # disabling (removing) a db
+@@ -1516,7 +1547,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ installed_layman_db.delete(installed_layman_db.select(repoid))
+ except Exception, e:
+ self.error(ERROR_INTERNAL_ERROR,
+- "Failed to disable repository "+repoid+" : "+str(e))
++ "Failed to disable repository "+repoid+" : "+str(e))
+ return
+
+ # enabling (adding) a db
+@@ -1530,7 +1561,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ except Exception, e:
+ self._unblock_output()
+ self.error(ERROR_INTERNAL_ERROR,
+- "Failed to enable repository "+repoid+" : "+str(e))
++ "Failed to enable repository "+repoid+" : "+str(e))
+ return
+
+ def resolve(self, filters, pkgs):
+@@ -1581,10 +1612,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # and newest filter could be alterated
+ for cpv in self._get_all_cpv(cp, filters, filter_newest=False):
+ match = True
+- metadata = self._get_metadata(cpv,
+- ["DESCRIPTION", "HOMEPAGE", "IUSE",
+- "LICENSE", "repository", "SLOT"],
+- in_dict=True)
++ metadata = self._get_metadata(
++ cpv, ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE",
++ "repository", "SLOT"], in_dict=True
++ )
+ # update LICENSE to correspond to system settings
+ metadata["LICENSE"] = self._get_real_license_str(cpv, metadata)
+ for s in search_list:
+@@ -1621,7 +1652,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if FILTER_NOT_INSTALLED in filters:
+ self.error(ERROR_CANNOT_GET_FILELIST,
+- "search-file isn't available with ~installed filter")
++ "search-file isn't available with ~installed filter")
+ return
+
+ cpv_list = self.pvar.vardb.cpv_all()
+@@ -1759,7 +1790,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+
+ if not self._is_cpv_valid(cpv):
+ self.error(ERROR_UPDATE_NOT_FOUND,
+- "Package %s was not found" % pkg)
++ "Package %s was not found" % pkg)
+ continue
+
+ cpv_list.append('=' + cpv)
+@@ -1768,7 +1799,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ # but better to show it after important errors
+ if only_trusted:
+ self.error(ERROR_MISSING_GPG_SIGNATURE,
+- "Portage backend does not support GPG signature")
++ "Portage backend does not support GPG signature")
+ return
+
+ # creating update depgraph
+@@ -1776,17 +1807,18 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ if only_download:
+ myopts['--fetchonly'] = True
+ favorites = []
+- myparams = _emerge.create_depgraph_params.create_depgraph_params(
+- myopts, "")
++ myparams = _emerge.create_depgraph_params \
++ .create_depgraph_params(myopts, "")
+
+ self.status(STATUS_DEP_RESOLVE)
+
+ depgraph = _emerge.depgraph.depgraph(self.pvar.settings,
+- self.pvar.trees, myopts, myparams, None)
++ self.pvar.trees, myopts,
++ myparams, None)
+ retval, favorites = depgraph.select_files(cpv_list)
+ if not retval:
+ self.error(ERROR_DEP_RESOLUTION_FAILED,
+- "Wasn't able to get dependency graph")
++ "Wasn't able to get dependency graph")
+ return
+
+ # check fetch restrict, can stop the function via error signal
+@@ -1803,9 +1835,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ try:
+ self._block_output()
+ # compiling/installing
+- mergetask = _emerge.Scheduler.Scheduler(self.pvar.settings,
+- self.pvar.trees, self.pvar.mtimedb, myopts, None,
+- depgraph.altlist(), favorites, depgraph.schedulerGraph())
++ mergetask = _emerge.Scheduler.Scheduler(
++ self.pvar.settings, self.pvar.trees, self.pvar.mtimedb,
++ myopts, None, depgraph.altlist(), favorites,
++ depgraph.schedulerGraph()
++ )
+ rval = mergetask.merge()
+ finally:
+ self._unblock_output()
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0010-Add-helper-to-change-portage-settings.patch b/app-admin/packagekit-base/files/0010-Add-helper-to-change-portage-settings.patch
new file mode 100644
index 0000000..af81129
--- /dev/null
+++ b/app-admin/packagekit-base/files/0010-Add-helper-to-change-portage-settings.patch
@@ -0,0 +1,73 @@
+From ecd21674a814926e31ad70613f927c73f19c3d3d Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 15:32:53 +0200
+Subject: [PATCH 10/12] Add helper to change portage settings
+
+---
+ backends/portage/portageBackend.py | 39 +++++++++++++++++---------------------
+ 1 file changed, 17 insertions(+), 22 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 9775466..1a6d855 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -175,21 +175,24 @@ class PortageBridge():
+ self.portdb = self.trees[self.settings['ROOT']]['porttree'].dbapi
+ self.root_config = self.trees[self.settings['ROOT']]['root_config']
+
+- # doing all the changes to settings
++ self.apply_settings({
++ # we don't want interactive ebuilds
++ 'ACCEPT_PROPERTIES': '-interactive',
++ # do not log with mod_echo (cleanly prevent some outputs)
++ 'PORTAGE_ELOG_SYSTEM': ' '.join([
++ elog for elog in self.settings["PORTAGE_ELOG_SYSTEM"].split()
++ if elog != 'echo'
++ ]),
++ })
++
++ def apply_settings(self, mapping):
++ """Set portage settings."""
+ self.settings.unlock()
+
+- # we don't want interactive ebuilds
+- self.settings["ACCEPT_PROPERTIES"] = "-interactive"
+- self.settings.backup_changes("ACCEPT_PROPERTIES")
++ for key, value in mapping.items():
++ self.settings[key] = value
++ self.settings.backup_changes(key)
+
+- # do not log with mod_echo (cleanly prevent some outputs)
+- self.settings["PORTAGE_ELOG_SYSTEM"] = ' '.join([
+- elog for elog in self.settings["PORTAGE_ELOG_SYSTEM"].split()
+- if elog != 'echo'
+- ])
+- self.settings.backup_changes("PORTAGE_ELOG_SYSTEM")
+-
+- # finally, regenerate settings and lock them again
+ self.settings.regenerate()
+ self.settings.lock()
+
+@@ -560,17 +563,9 @@ class PackageKitPortageMixin(object):
+ licenses = "* -" + free_licenses
+ backup_license = self.pvar.settings["ACCEPT_LICENSE"]
+
+- self.pvar.settings.unlock()
+- self.pvar.settings["ACCEPT_LICENSE"] = licenses
+- self.pvar.settings.backup_changes("ACCEPT_LICENSE")
+- self.pvar.settings.regenerate()
+-
++ self.pvar.apply_settings({'ACCEPT_LICENSE': licences})
+ cpv_list = filter(_has_validLicense, cpv_list)
+-
+- self.pvar.settings["ACCEPT_LICENSE"] = backup_license
+- self.pvar.settings.backup_changes("ACCEPT_LICENSE")
+- self.pvar.settings.regenerate()
+- self.pvar.settings.lock()
++ self.pvar.apply_settings({'ACCEPT_LICENSE': backup_licence})
+
+ return cpv_list
+
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0011-Remove-compatibility-with-older-portage.patch b/app-admin/packagekit-base/files/0011-Remove-compatibility-with-older-portage.patch
new file mode 100644
index 0000000..222f9bf
--- /dev/null
+++ b/app-admin/packagekit-base/files/0011-Remove-compatibility-with-older-portage.patch
@@ -0,0 +1,77 @@
+From 6b8db81b43eaba3e331725227252f9d363d1b695 Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 15:39:07 +0200
+Subject: [PATCH 11/12] Remove compatibility with older portage
+
+---
+ backends/portage/portageBackend.py | 26 ++++++++------------------
+ 1 file changed, 8 insertions(+), 18 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 1a6d855..9ce2b79 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -50,6 +50,7 @@ import _emerge.stdout_spinner
+ import portage
+ import portage.dep
+ import portage.versions
++from portage._sets.base import InternalPackageSet
+ from portage.exception import InvalidAtom
+
+ # NOTES:
+@@ -319,13 +320,6 @@ class PackageKitPortageMixin(object):
+ settings.setcpv(cpv, mydb=metadata)
+ return settings
+
+- def _get_internal_package_set_class(self):
+- try:
+- from portage._sets.base import InternalPackageSet
+- except ImportError:
+- from portage.sets.base import InternalPackageSet
+- return InternalPackageSet
+-
+ def _is_installed(self, cpv):
+ return self.pvar.vardb.cpv_exists(cpv)
+
+@@ -1158,10 +1152,9 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ cpv_downgra = {}
+
+ # get system and world packages
+- for s in ["system", "world"]:
+- sets = self._get_internal_package_set_class()(
+- initial_atoms=self.pvar.root_config.setconfig.getSetAtoms(s)
+- )
++ for pkg_set in ["system", "world"]:
++ sets = InternalPackageSet(initial_atoms=self.pvar.root_config
++ .setconfig.getSetAtoms(pkg_set))
+ for atom in sets:
+ update_candidates.append(atom.cp)
+
+@@ -1225,10 +1218,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ cpv_downgra[cp] = dict_down
+
+ # get security updates
+- for atom in self._get_internal_package_set_class(
+- initial_atoms=self.pvar.root_config.setconfig
+- .getSetAtoms("security")
+- ):
++ for atom in InternalPackageSet(initial_atoms=self.pvar.root_config
++ .setconfig.getSetAtoms("security")):
+ # send update message and remove atom from cpv_updates
+ if atom.cp in cpv_updates:
+ slot = self._get_metadata(atom.cpv, ["SLOT"])[0]
+@@ -1402,9 +1393,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ system_packages = []
+
+ # get system packages
+- sets = self._get_internal_package_set_class()(
+- initial_atoms=self.pvar.root_config.setconfig.getSetAtoms("system"))
+- for atom in sets:
++ for atom in InternalPackageSet(initial_atoms=self.pvar.root_config
++ .setconfig.getSetAtoms("system")):
+ system_packages.append(atom.cp)
+
+ # create cpv_list
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/0012-Retrieve-EAPI-and-KEYWORDS-before-calling-setcpv-met.patch b/app-admin/packagekit-base/files/0012-Retrieve-EAPI-and-KEYWORDS-before-calling-setcpv-met.patch
new file mode 100644
index 0000000..08c7626
--- /dev/null
+++ b/app-admin/packagekit-base/files/0012-Retrieve-EAPI-and-KEYWORDS-before-calling-setcpv-met.patch
@@ -0,0 +1,36 @@
+From c08ca43ca45d55471f014dee93592b5448950aea Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Sun, 3 May 2015 17:54:59 +0200
+Subject: [PATCH 12/12] Retrieve EAPI and KEYWORDS before calling setcpv method
+
+---
+ backends/portage/portageBackend.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
+index 9ce2b79..79b8449 100755
+--- a/backends/portage/portageBackend.py
++++ b/backends/portage/portageBackend.py
+@@ -938,7 +938,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ continue
+
+ metadata = self._get_metadata(
+- cpv, ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE", "SLOT"],
++ cpv, ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE", "SLOT",
++ "EAPI", "KEYWORDS"],
+ in_dict=True
+ )
+
+@@ -1599,7 +1600,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
+ match = True
+ metadata = self._get_metadata(
+ cpv, ["DESCRIPTION", "HOMEPAGE", "IUSE", "LICENSE",
+- "repository", "SLOT"], in_dict=True
++ "repository", "SLOT", "EAPI", "KEYWORDS"],
++ in_dict=True
+ )
+ # update LICENSE to correspond to system settings
+ metadata["LICENSE"] = self._get_real_license_str(cpv, metadata)
+--
+2.3.6
+
diff --git a/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch b/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch
deleted file mode 100644
index 0c5c833..0000000
--- a/app-admin/packagekit-base/files/packagekit-base-1.0.3-configure.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.ac.old 2014-11-25 00:04:23.689888170 +0100
-+++ configure.ac 2014-11-25 00:03:08.041580672 +0100
-@@ -464,7 +464,7 @@
- fi
-
- have_python_backend="no"
--if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o $enable_portage = xyes; then
-+if test x$enable_entropy = xyes -o x$enable_pisi = xyes -o x$enable_portage = xyes; then
- have_python_backend="yes"
- fi
- if test x$enable_apt = xyes; then
diff --git a/app-admin/packagekit-base/packagekit-base-1.0.3.ebuild b/app-admin/packagekit-base/packagekit-base-1.0.6.ebuild
similarity index 83%
rename from app-admin/packagekit-base/packagekit-base-1.0.3.ebuild
rename to app-admin/packagekit-base/packagekit-base-1.0.6.ebuild
index ed33317..db5032c 100644
--- a/app-admin/packagekit-base/packagekit-base-1.0.3.ebuild
+++ b/app-admin/packagekit-base/packagekit-base-1.0.6.ebuild
@@ -18,13 +18,21 @@ HOMEPAGE="http://www.packagekit.org/"
SRC_URI="http://www.freedesktop.org/software/${MY_PN}/releases/${MY_P}.tar.xz"
LICENSE="GPL-2"
-SLOT="0"
+SLOT="0/18"
KEYWORDS="~alpha ~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
-IUSE="bash-completion connman cron command-not-found +introspection networkmanager nsplugin entropy systemd test"
+IUSE="connman cron command-not-found +introspection networkmanager nsplugin entropy systemd test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+# While not strictly needed, consolekit is the alternative to systemd-login
+# to get current session's user.
CDEPEND="
- bash-completion? ( >=app-shells/bash-completion-2.0 )
+ >=app-shells/bash-completion-2
+ dev-db/sqlite:3
+ >=dev-libs/dbus-glib-0.74
+ >=dev-libs/glib-2.32.0:2[${PYTHON_USEDEP}]
+ >=sys-auth/polkit-0.98
+ >=sys-apps/dbus-1.3.0
+ ${PYTHON_DEPS}
connman? ( net-misc/connman )
introspection? ( >=dev-libs/gobject-introspection-0.9.9[${PYTHON_USEDEP}] )
networkmanager? ( >=net-misc/networkmanager-0.6.4 )
@@ -34,26 +42,21 @@ CDEPEND="
>=x11-libs/gtk+-2.14.0:2
x11-libs/pango
)
- dev-db/sqlite:3
- >=dev-libs/dbus-glib-0.74
- >=dev-libs/glib-2.32.0:2[${PYTHON_USEDEP}]
- >=sys-auth/polkit-0.98
- >=sys-apps/dbus-1.3.0
- ${PYTHON_DEPS}
+ systemd? ( >=sys-apps/systemd-204 )
"
DEPEND="${CDEPEND}
- dev-util/gtk-doc-am
- nsplugin? ( >=net-misc/npapi-sdk-0.27 )
- systemd? ( >=sys-apps/systemd-204 )
dev-libs/libxslt[${PYTHON_USEDEP}]
+ >=dev-util/gtk-doc-am-1.11
>=dev-util/intltool-0.35.0
- virtual/pkgconfig
sys-devel/gettext
+ virtual/pkgconfig
+ nsplugin? ( >=net-misc/npapi-sdk-0.27 )
"
RDEPEND="${CDEPEND}
- entropy? ( >=sys-apps/entropy-234[${PYTHON_USEDEP}] )
- >=app-portage/layman-1.2.3[${PYTHON_USEDEP}]
+ >=app-portage/layman-2[${PYTHON_USEDEP}]
>=sys-apps/portage-2.2[${PYTHON_USEDEP}]
+ entropy? ( >=sys-apps/entropy-234[${PYTHON_USEDEP}] )
+ !systemd? ( sys-auth/consolekit )
"
S="${WORKDIR}/${MY_P}"
@@ -62,7 +65,8 @@ RESTRICT="test"
src_prepare() {
# Fix python backend detection
- epatch "${FILESDIR}"/${PN}-1.0.3-configure.patch
+ # Make portage backend work with newer layman/portage
+ epatch "${FILESDIR}"/*
eautoreconf
}
@@ -74,11 +78,11 @@ src_configure() {
--disable-gtk-module \
--disable-schemas-compile \
--disable-static \
+ --enable-bash-completion \
--enable-man-pages \
--enable-nls \
--enable-portage \
--localstatedir=/var \
- $(use_enable bash-completion) \
$(use_enable command-not-found) \
$(use_enable connman) \
$(use_enable cron) \
@@ -87,9 +91,9 @@ src_configure() {
$(use_enable networkmanager) \
$(use_enable nsplugin browser-plugin) \
$(use_enable systemd) \
- $(use_enable test local) \
$(use_enable test daemon-tests) \
$(systemd_with_unitdir)
+ #$(use_enable test local)
}
src_install() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/gnome:master commit in: app-admin/packagekit-base/files/, app-admin/packagekit-base/
@ 2015-12-13 17:51 Gilles Dartiguelongue
0 siblings, 0 replies; 3+ messages in thread
From: Gilles Dartiguelongue @ 2015-12-13 17:51 UTC (permalink / raw
To: gentoo-commits
commit: 51e4f526c064f5d16629a17efe5c973017cc724c
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 13 17:49:32 2015 +0000
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 17:49:32 2015 +0000
URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=51e4f526
app-admin/packagekit-base: 1.0.10 → 1.0.11
...-exception-handling-to-be-python2.7-compa.patch | 44 ----
...2-portage-do-not-redefine-builtin-license.patch | 34 ---
.../files/0003-portage-drop-unused-imports.patch | 25 --
...0004-portage-initialize-licenses-variable.patch | 26 ---
...-fix-a-typo-in-restoring-license-settings.patch | 30 ---
...-PackageKitProgress-to-ease-progress-step.patch | 260 ---------------------
...ython-make-PackagekitProgress-an-Iterable.patch | 56 -----
...steps-on-PackagekitProgress-instanciation.patch | 49 ----
...age-use-PackagekitProgress-as-an-iterable.patch | 222 ------------------
.../files/0011-portage-fix-a-typo.patch | 25 --
...2-portage-fix-step-percentage-computation.patch | 25 --
...not-refetch-package-listing-for-no-reason.patch | 32 ---
...1.0.10.ebuild => packagekit-base-1.0.11.ebuild} | 8 +-
13 files changed, 2 insertions(+), 834 deletions(-)
diff --git a/app-admin/packagekit-base/files/0001-portage-fix-exception-handling-to-be-python2.7-compa.patch b/app-admin/packagekit-base/files/0001-portage-fix-exception-handling-to-be-python2.7-compa.patch
deleted file mode 100644
index b834f2b..0000000
--- a/app-admin/packagekit-base/files/0001-portage-fix-exception-handling-to-be-python2.7-compa.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 56a54a7bbf3b28546619a4d2b458ea50c3f5c3e9 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 13:32:23 +0200
-Subject: [PATCH 1/9] portage: fix exception handling to be python2.7+
- compatible
-
----
- backends/portage/portageBackend.py | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index dc72bd9..d4726b6 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -1542,9 +1542,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- if not enable and self._is_repo_enabled(installed_layman_db, repoid):
- try:
- installed_layman_db.delete(installed_layman_db.select(repoid))
-- except Exception, e:
-+ except Exception as exc:
- self.error(ERROR_INTERNAL_ERROR,
-- "Failed to disable repository " + repoid + " : " + str(e))
-+ "Failed to disable repository %s: %s" %
-+ (repoid, str(exc)))
- return
-
- # enabling (adding) a db
-@@ -1555,10 +1556,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self._block_output()
- installed_layman_db.add(available_layman_db.select(repoid))
- self._unblock_output()
-- except Exception, e:
-+ except Exception as exc:
- self._unblock_output()
- self.error(ERROR_INTERNAL_ERROR,
-- "Failed to enable repository " + repoid + " : " + str(e))
-+ "Failed to enable repository %s: %s" %
-+ (repoid, str(exc)))
- return
-
- def resolve(self, filters, pkgs):
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0002-portage-do-not-redefine-builtin-license.patch b/app-admin/packagekit-base/files/0002-portage-do-not-redefine-builtin-license.patch
deleted file mode 100644
index 8ef1e9a..0000000
--- a/app-admin/packagekit-base/files/0002-portage-do-not-redefine-builtin-license.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 232519b102571933f034cee72979ecf834af4b46 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 14:14:03 +0200
-Subject: [PATCH 2/9] portage: do not redefine builtin license
-
----
- backends/portage/portageBackend.py | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index d4726b6..f40ca92 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -334,14 +334,14 @@ class PackageKitPortageMixin(object):
- def _get_real_license_str(self, cpv, metadata):
- # use conditionals info (w/ USE) in LICENSE and remove ||
- ebuild_settings = self._get_ebuild_settings(cpv, metadata)
-- license = set(portage.flatten(
-+ license_ = set(portage.flatten(
- portage.dep.use_reduce(
- portage.dep.paren_reduce(metadata["LICENSE"]),
- uselist=ebuild_settings.get("USE", "").split()
- )
- ))
-- license.discard('||')
-- return ' '.join(license)
-+ license_.discard('||')
-+ return ' '.join(license_)
-
- def _signal_config_update(self):
- result = list(portage.util.find_updated_config_files(
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0003-portage-drop-unused-imports.patch b/app-admin/packagekit-base/files/0003-portage-drop-unused-imports.patch
deleted file mode 100644
index 2b99528..0000000
--- a/app-admin/packagekit-base/files/0003-portage-drop-unused-imports.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6b2592232d9ed2713df874d3bb770f68ef701841 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 14:14:45 +0200
-Subject: [PATCH 3/9] portage: drop unused imports
-
----
- backends/portage/portageBackend.py | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index f40ca92..4301c14 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -40,8 +40,6 @@ from packagekit.backend import (
- split_package_id,
- )
- from packagekit.enums import *
--from packagekit.package import PackagekitPackage
--from packagekit.progress import *
- # portage imports
- import _emerge.AtomArg
- import _emerge.actions
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0004-portage-initialize-licenses-variable.patch b/app-admin/packagekit-base/files/0004-portage-initialize-licenses-variable.patch
deleted file mode 100644
index 5c31b26..0000000
--- a/app-admin/packagekit-base/files/0004-portage-initialize-licenses-variable.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 438fd88070860f858d09758daf5ff379a4d788a5 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 14:33:48 +0200
-Subject: [PATCH 4/9] portage: initialize licenses variable
-
-It should not be possible for licenses to be undefined but cleans up
-static analysis warnings.
----
- backends/portage/portageBackend.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index 4301c14..f36695a 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -554,6 +554,7 @@ class PackageKitPortageMixin(object):
- return not self.pvar.settings._getMissingLicenses(cpv, metadata)
-
- if FILTER_FREE in filters or FILTER_NOT_FREE in filters:
-+ licenses = ""
- free_licenses = "@FSF-APPROVED"
- if FILTER_FREE in filters:
- licenses = "-* " + free_licenses
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0005-portage-fix-a-typo-in-restoring-license-settings.patch b/app-admin/packagekit-base/files/0005-portage-fix-a-typo-in-restoring-license-settings.patch
deleted file mode 100644
index 885c90f..0000000
--- a/app-admin/packagekit-base/files/0005-portage-fix-a-typo-in-restoring-license-settings.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From d42390d7c78e622a8051d47f86a422a1861d7eef Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 14:35:40 +0200
-Subject: [PATCH 5/9] portage: fix a typo in restoring license settings
-
----
- backends/portage/portageBackend.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index f36695a..9b572e9 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -560,11 +560,11 @@ class PackageKitPortageMixin(object):
- licenses = "-* " + free_licenses
- elif FILTER_NOT_FREE in filters:
- licenses = "* -" + free_licenses
-- backup_license = self.pvar.settings["ACCEPT_LICENSE"]
-+ backup_licenses = self.pvar.settings["ACCEPT_LICENSE"]
-
- self.pvar.apply_settings({'ACCEPT_LICENSE': licences})
- cpv_list = filter(_has_validLicense, cpv_list)
-- self.pvar.apply_settings({'ACCEPT_LICENSE': backup_licence})
-+ self.pvar.apply_settings({'ACCEPT_LICENSE': backup_licenses})
-
- return cpv_list
-
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0006-portage-use-PackageKitProgress-to-ease-progress-step.patch b/app-admin/packagekit-base/files/0006-portage-use-PackageKitProgress-to-ease-progress-step.patch
deleted file mode 100644
index 8d6a51c..0000000
--- a/app-admin/packagekit-base/files/0006-portage-use-PackageKitProgress-to-ease-progress-step.patch
+++ /dev/null
@@ -1,260 +0,0 @@
-From 3c002cb530493664f94405c408b27203c7355cad Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 15:09:50 +0200
-Subject: [PATCH 6/9] portage: use PackageKitProgress to ease progress steps
- manipulations
-
----
- backends/portage/portageBackend.py | 91 +++++++++++++++++++++-----------------
- 1 file changed, 51 insertions(+), 40 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index 9b572e9..5cb64f6 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -40,6 +40,7 @@ from packagekit.backend import (
- split_package_id,
- )
- from packagekit.enums import *
-+from packagekit.progress import PackagekitProgress
- # portage imports
- import _emerge.AtomArg
- import _emerge.actions
-@@ -68,6 +69,11 @@ from portage.exception import InvalidAtom
- # Map Gentoo categories to the PackageKit group name space
-
-
-+def compute_equal_steps(iterable):
-+ return [idx * (100.0 / len(iterable)) / 100.0
-+ for idx, _ in enumerate(iterable, start=1)]
-+
-+
- class PortagePackageGroups(dict):
-
- """
-@@ -932,10 +938,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- def get_details(self, pkgs):
- self.status(STATUS_INFO)
- self.allow_cancel(True)
-- self.percentage(0)
-
-- nb_pkg = float(len(pkgs))
-- pkg_processed = 0.0
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(pkgs))
-+ self.percentage(progress.percent)
-
- for pkg in pkgs:
- cpv = self._id_to_cpv(pkg)
-@@ -961,18 +967,18 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self._get_size(cpv)
- )
-
-- pkg_processed += 100.0
-- self.percentage(int(pkg_processed / nb_pkg))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
- def get_files(self, pkgs):
- self.status(STATUS_INFO)
- self.allow_cancel(True)
-- self.percentage(0)
-
-- nb_pkg = float(len(pkgs))
-- pkg_processed = 0.0
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(pkgs))
-+ self.percentage(progress.percent)
-
- for pkg in pkgs:
- cpv = self._id_to_cpv(pkg)
-@@ -990,19 +996,20 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
-
- self.files(pkg, ';'.join(sorted(self._get_file_list(cpv))))
-
-- pkg_processed += 100.0
-- self.percentage(int(pkg_processed / nb_pkg))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
- def get_packages(self, filters):
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- cp_list = self._get_all_cp(filters)
-- nb_cp = float(len(cp_list))
-- cp_processed = 0.0
-+
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cp_list))
-+ self.percentage(progress.percent)
-
- for cp in self._get_all_cp(filters):
- for cpv in self._get_all_cpv(cp, filters):
-@@ -1011,8 +1018,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- except InvalidAtom:
- continue
-
-- cp_processed += 100.0
-- self.percentage(int(cp_processed / nb_cp))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
-@@ -1565,11 +1572,11 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- def resolve(self, filters, pkgs):
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- cp_list = self._get_all_cp(filters)
-- nb_cp = float(len(cp_list))
-- cp_processed = 0.0
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cp_list))
-+ self.percentage(progress.percent)
-
- reg_expr = []
- for pkg in pkgs:
-@@ -1584,8 +1591,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- cp_processed += 100.0
-- self.percentage(int(cp_processed / nb_cp))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
-@@ -1593,13 +1600,14 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- # NOTES: very bad performance
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- cp_list = self._get_all_cp(filters)
-- nb_cp = float(len(cp_list))
-- cp_processed = 0.0
- search_list = self._get_search_list(keys)
-
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cp_list))
-+ self.percentage(progress.percent)
-+
- for cp in cp_list:
- # unfortunatelly, everything is related to cpv, not cp
- # can't filter cp
-@@ -1635,8 +1643,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in cpv_list:
- self._package(cpv)
-
-- cp_processed += 100.0
-- self.percentage(int(cp_processed / nb_cp))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
-@@ -1647,7 +1655,6 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- # - newest: as only installed, by himself
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- if FILTER_NOT_INSTALLED in filters:
- self.error(ERROR_CANNOT_GET_FILELIST,
-@@ -1655,10 +1662,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- return
-
- cpv_list = self.pvar.vardb.cpv_all()
-- nb_cpv = 0.0
-- cpv_processed = 0.0
- is_full_path = True
-
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cpv_list))
-+ self.percentage(progress.percent)
-+
- count = 0
- values_len = len(values)
- for key in values:
-@@ -1679,8 +1688,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self._package(cpv)
- break
-
-- count += 1
-- self.percentage(float(count) / values_len)
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
-@@ -1688,11 +1697,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- # TODO: filter unknown groups before searching ? (optimization)
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- cp_list = self._get_all_cp(filters)
-- nb_cp = float(len(cp_list))
-- cp_processed = 0.0
-+
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cp_list))
-+ self.percentage(progress.percent)
-
- for cp in cp_list:
- for group in groups:
-@@ -1700,8 +1710,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- cp_processed += 100.0
-- self.percentage(int(cp_processed / nb_cp))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
-@@ -1711,7 +1721,6 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- # keys contain more than one category name, no results can be found
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-- self.percentage(0)
-
- categories = []
- for k in keys_list[:]:
-@@ -1736,8 +1745,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- search_list.append(re.compile(k, re.IGNORECASE))
-
- cp_list = self._get_all_cp(filters)
-- nb_cp = float(len(cp_list))
-- cp_processed = 0.0
-+
-+ progress = PackagekitProgress()
-+ progress.set_steps(compute_equal_steps(cp_list))
-+ self.percentage(progress.percent)
-
- for cp in cp_list:
- if category_filter:
-@@ -1757,8 +1768,8 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- cp_processed += 100.0
-- self.percentage(int(cp_processed / nb_cp))
-+ progress.step()
-+ self.percentage(progress.percent)
-
- self.percentage(100)
-
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0007-python-make-PackagekitProgress-an-Iterable.patch b/app-admin/packagekit-base/files/0007-python-make-PackagekitProgress-an-Iterable.patch
deleted file mode 100644
index ca78c62..0000000
--- a/app-admin/packagekit-base/files/0007-python-make-PackagekitProgress-an-Iterable.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From eb52dc157c5dbda9630b448dab06fb05cdf1060c Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 15:26:05 +0200
-Subject: [PATCH 7/9] python: make PackagekitProgress an Iterable
-
----
- lib/python/packagekit/progress.py | 17 ++++++++++++++++-
- 1 file changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/lib/python/packagekit/progress.py b/lib/python/packagekit/progress.py
-index 7a5d363..d0c0c26 100644
---- a/lib/python/packagekit/progress.py
-+++ b/lib/python/packagekit/progress.py
-@@ -17,7 +17,13 @@
- # Copyright (C) 2008
- # Richard Hughes <richard@hughsie.com>
-
--class PackagekitProgress:
-+try:
-+ from collections import Iterable
-+except ImportError:
-+ from collections.abc import Iterable
-+
-+
-+class PackagekitProgress(Iterable):
- '''
- Progress class there controls the total progress of a transaction
- the transaction is divided in n milestones. the class contains
-@@ -42,6 +48,7 @@ class PackagekitProgress:
- #TODO: Add support for elapsed/remaining time
-
- def __init__(self):
-+ super(PackagekitProgress, self).__init__()
- self.percent = 0
- self.steps = []
- self.current_step = 0
-@@ -68,8 +75,16 @@ class PackagekitProgress:
- self.current_step += 1
- self.percent = self.steps[self.current_step]
- else:
-+ self.current_step = len(self.steps)
- self.percent = 100
-
-+ def __iter__(self):
-+ while self.current_step < len(self.steps):
-+ yield self.percent
-+ self.step()
-+
-+ raise StopIteration
-+
- def _update_percent(self):
- '''
- Increment percentage based on current step
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0008-python-set-steps-on-PackagekitProgress-instanciation.patch b/app-admin/packagekit-base/files/0008-python-set-steps-on-PackagekitProgress-instanciation.patch
deleted file mode 100644
index b15df47..0000000
--- a/app-admin/packagekit-base/files/0008-python-set-steps-on-PackagekitProgress-instanciation.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 3c046f4586605f51a55c82f81861adcf5e408488 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 16:10:32 +0200
-Subject: [PATCH 8/9] python: set steps on PackagekitProgress instanciation
-
----
- lib/python/packagekit/progress.py | 18 ++++++++----------
- 1 file changed, 8 insertions(+), 10 deletions(-)
-
-diff --git a/lib/python/packagekit/progress.py b/lib/python/packagekit/progress.py
-index d0c0c26..b5c7e52 100644
---- a/lib/python/packagekit/progress.py
-+++ b/lib/python/packagekit/progress.py
-@@ -34,24 +34,22 @@ class PackagekitProgress(Iterable):
- from packagekit import PackagekitProgress
-
- steps = [10, 30, 50, 70] # Milestones in %
-- progress = PackagekitProgress()
-- progress.set_steps(steps)
-- for milestone in range(len(steps)):
-+ progress = PackagekitProgress(steps)
-+ for milestone in progress:
- # do the action is this step
- for i in range(100):
- # do some action
-- print "progress : %s " % progress.percent
-- progress.step() # step to next milestone
--
-+ print "progress : %s " % milestone
- '''
-
- #TODO: Add support for elapsed/remaining time
-
-- def __init__(self):
-+ def __init__(self, steps=None):
- super(PackagekitProgress, self).__init__()
-- self.percent = 0
-- self.steps = []
-- self.current_step = 0
-+ if not steps:
-+ self.reset()
-+ else:
-+ self.set_steps(steps)
-
- def set_steps(self, steps):
- '''
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0009-portage-use-PackagekitProgress-as-an-iterable.patch b/app-admin/packagekit-base/files/0009-portage-use-PackagekitProgress-as-an-iterable.patch
deleted file mode 100644
index 435bb09..0000000
--- a/app-admin/packagekit-base/files/0009-portage-use-PackagekitProgress-as-an-iterable.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-From 5a3b0b213c53aca26f91f0a3eae65518f1376235 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Sun, 6 Sep 2015 16:10:06 +0200
-Subject: [PATCH 9/9] portage: use PackagekitProgress as an iterable
-
----
- backends/portage/portageBackend.py | 73 +++++++++++++++-----------------------
- 1 file changed, 29 insertions(+), 44 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index 5cb64f6..de1c490 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -27,7 +27,10 @@ import signal
- import sys
- import traceback
- from collections import defaultdict
--from itertools import izip
-+try:
-+ from itertools import izip
-+except ImportError:
-+ izip = zip
-
- # layman imports (>=2)
- import layman.config
-@@ -939,11 +942,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self.status(STATUS_INFO)
- self.allow_cancel(True)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(pkgs))
-+ progress = PackagekitProgress(compute_equal_steps(pkgs))
- self.percentage(progress.percent)
-
-- for pkg in pkgs:
-+ for percentage, pkg in izip(progress, pkgs):
- cpv = self._id_to_cpv(pkg)
-
- if not self._is_cpv_valid(cpv):
-@@ -967,8 +969,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self._get_size(cpv)
- )
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -976,11 +977,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self.status(STATUS_INFO)
- self.allow_cancel(True)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(pkgs))
-+ progress = PackagekitProgress(compute_equal_steps(pkgs))
- self.percentage(progress.percent)
-
-- for pkg in pkgs:
-+ for percentage, pkg in izip(progress, pkgs):
- cpv = self._id_to_cpv(pkg)
-
- if not self._is_cpv_valid(cpv):
-@@ -996,8 +996,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
-
- self.files(pkg, ';'.join(sorted(self._get_file_list(cpv))))
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1007,19 +1006,17 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
-
- cp_list = self._get_all_cp(filters)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cp_list))
-+ progress = PackagekitProgress(compute_equal_steps(cp_list))
- self.percentage(progress.percent)
-
-- for cp in self._get_all_cp(filters):
-+ for percentage, cp in izip(progress, self._get_all_cp(filters)):
- for cpv in self._get_all_cpv(cp, filters):
- try:
- self._package(cpv)
- except InvalidAtom:
- continue
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1574,8 +1571,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self.allow_cancel(True)
-
- cp_list = self._get_all_cp(filters)
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cp_list))
-+ progress = PackagekitProgress(compute_equal_steps(cp_list))
- self.percentage(progress.percent)
-
- reg_expr = []
-@@ -1586,13 +1582,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- # specifications says "be case sensitive"
- s = re.compile(reg_expr)
-
-- for cp in cp_list:
-+ for percentage, cp in izip(progress, cp_list):
- if s.match(cp):
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1604,11 +1599,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- cp_list = self._get_all_cp(filters)
- search_list = self._get_search_list(keys)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cp_list))
-+ progress = PackagekitProgress(compute_equal_steps(cp_list))
- self.percentage(progress.percent)
-
-- for cp in cp_list:
-+ for percentage, cp in izip(progress, cp_list):
- # unfortunatelly, everything is related to cpv, not cp
- # can't filter cp
- cpv_list = []
-@@ -1643,8 +1637,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in cpv_list:
- self._package(cpv)
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1664,13 +1657,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- cpv_list = self.pvar.vardb.cpv_all()
- is_full_path = True
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cpv_list))
-- self.percentage(progress.percent)
-+ progress = PackagekitProgress(compute_equal_steps(values))
-+ self.percentage(progress.percentage)
-
-- count = 0
-- values_len = len(values)
-- for key in values:
-+ for percentage, key in izip(progress, values):
-
- if key[0] != "/":
- is_full_path = False
-@@ -1688,8 +1678,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- self._package(cpv)
- break
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1700,18 +1689,16 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
-
- cp_list = self._get_all_cp(filters)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cp_list))
-+ progress = PackagekitProgress(compute_equal_steps(cp_list))
- self.percentage(progress.percent)
-
-- for cp in cp_list:
-+ for percentage, cp in izip(progress, cp_list):
- for group in groups:
- if self._get_pk_group(cp) == group:
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
-@@ -1746,11 +1733,10 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
-
- cp_list = self._get_all_cp(filters)
-
-- progress = PackagekitProgress()
-- progress.set_steps(compute_equal_steps(cp_list))
-+ progress = PackagekitProgress(compute_equal_steps(cp_list))
- self.percentage(progress.percent)
-
-- for cp in cp_list:
-+ for percentage, cp in izip(progress, cp_list):
- if category_filter:
- cat, pkg_name = portage.versions.catsplit(cp)
- if cat != category_filter:
-@@ -1768,8 +1754,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- for cpv in self._get_all_cpv(cp, filters):
- self._package(cpv)
-
-- progress.step()
-- self.percentage(progress.percent)
-+ self.percentage(percentage)
-
- self.percentage(100)
-
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0011-portage-fix-a-typo.patch b/app-admin/packagekit-base/files/0011-portage-fix-a-typo.patch
deleted file mode 100644
index 6b41d7c..0000000
--- a/app-admin/packagekit-base/files/0011-portage-fix-a-typo.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 782b68eb1b381fe9bda602da7d0b951827d489a1 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Fri, 27 Nov 2015 11:36:40 +0100
-Subject: [PATCH 1/3] portage: fix a typo
-
----
- backends/portage/portageBackend.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index de1c490..004c18b 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -1658,7 +1658,7 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- is_full_path = True
-
- progress = PackagekitProgress(compute_equal_steps(values))
-- self.percentage(progress.percentage)
-+ self.percentage(progress.percent)
-
- for percentage, key in izip(progress, values):
-
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0012-portage-fix-step-percentage-computation.patch b/app-admin/packagekit-base/files/0012-portage-fix-step-percentage-computation.patch
deleted file mode 100644
index 301b56d..0000000
--- a/app-admin/packagekit-base/files/0012-portage-fix-step-percentage-computation.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From b76a5ee07912e0a739a5ba39aef6d96e85e58a98 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Fri, 27 Nov 2015 13:00:38 +0100
-Subject: [PATCH 2/3] portage: fix step percentage computation
-
----
- backends/portage/portageBackend.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index 004c18b..12918b9 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -73,7 +73,7 @@ from portage.exception import InvalidAtom
-
-
- def compute_equal_steps(iterable):
-- return [idx * (100.0 / len(iterable)) / 100.0
-+ return [idx * (100.0 / len(iterable))
- for idx, _ in enumerate(iterable, start=1)]
-
-
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/files/0013-portage-do-not-refetch-package-listing-for-no-reason.patch b/app-admin/packagekit-base/files/0013-portage-do-not-refetch-package-listing-for-no-reason.patch
deleted file mode 100644
index 0e46401..0000000
--- a/app-admin/packagekit-base/files/0013-portage-do-not-refetch-package-listing-for-no-reason.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 284dd27dc9f73415f49e7502de7ed0bddedcb8c0 Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue <eva@gentoo.org>
-Date: Fri, 27 Nov 2015 13:01:37 +0100
-Subject: [PATCH 3/3] portage: do not refetch package listing for no reason
-
----
- backends/portage/portageBackend.py | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
-index 12918b9..505feec 100755
---- a/backends/portage/portageBackend.py
-+++ b/backends/portage/portageBackend.py
-@@ -1003,13 +1003,12 @@ class PackageKitPortageBackend(PackageKitPortageMixin, PackageKitBaseBackend):
- def get_packages(self, filters):
- self.status(STATUS_QUERY)
- self.allow_cancel(True)
-+ self.percentage(0)
-
- cp_list = self._get_all_cp(filters)
--
- progress = PackagekitProgress(compute_equal_steps(cp_list))
-- self.percentage(progress.percent)
-
-- for percentage, cp in izip(progress, self._get_all_cp(filters)):
-+ for percentage, cp in izip(progress, cp_list):
- for cpv in self._get_all_cpv(cp, filters):
- try:
- self._package(cpv)
---
-2.6.3
-
diff --git a/app-admin/packagekit-base/packagekit-base-1.0.10.ebuild b/app-admin/packagekit-base/packagekit-base-1.0.11.ebuild
similarity index 91%
rename from app-admin/packagekit-base/packagekit-base-1.0.10.ebuild
rename to app-admin/packagekit-base/packagekit-base-1.0.11.ebuild
index 844e6b6..ebe534f 100644
--- a/app-admin/packagekit-base/packagekit-base-1.0.10.ebuild
+++ b/app-admin/packagekit-base/packagekit-base-1.0.11.ebuild
@@ -9,7 +9,7 @@ EAPI="5"
PYTHON_COMPAT=( python2_7 )
VALA_USE_DEPEND="vapigen"
-inherit bash-completion-r1 eutils multilib nsplugins python-single-r1 systemd vala
+inherit bash-completion-r1 multilib nsplugins python-single-r1 systemd vala
MY_PN="PackageKit"
MY_P=${MY_PN}-${PV}
@@ -69,9 +69,6 @@ S="${WORKDIR}/${MY_P}"
RESTRICT="test"
src_prepare() {
- # Upstreamed portage backend patches
- epatch "${FILESDIR}"/*
-
use vala && vala_src_prepare
}
@@ -107,8 +104,7 @@ src_install() {
einstalldocs
- #dodoc AUTHORS MAINTAINERS NEWS README || die "dodoc failed"
- #dodoc ChangeLog || die "dodoc failed"
+ dodoc AUTHORS ChangeLog MAINTAINERS NEWS README
if use nsplugin; then
dodir "/usr/$(get_libdir)/${PLUGINS_DIR}"
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-13 17:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13 17:51 [gentoo-commits] proj/gnome:master commit in: app-admin/packagekit-base/files/, app-admin/packagekit-base/ Gilles Dartiguelongue
-- strict thread matches above, loose matches on Subject: below --
2015-05-03 17:11 Gilles Dartiguelongue
2014-11-24 23:32 Gilles Dartiguelongue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox