Accepting request 155143 from home:tittiatcoke:branches:GNOME:Factory
- add one more patch from git (bnc#735864): + 0013-zypp-remap-PK-provides-into-rpm-provides-as-the-zif-.patch OBS-URL: https://build.opensuse.org/request/show/155143 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/PackageKit?expand=0&rev=181
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 11 18:37:26 UTC 2013 - coolo@suse.com
|
||||
|
||||
- add one more patch from git (bnc#735864):
|
||||
+ 0013-zypp-remap-PK-provides-into-rpm-provides-as-the-zif-.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 27 07:38:52 UTC 2013 - coolo@suse.com
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ Patch11: 0010-zypp-ignore-system-resolvables-during-install-too.patch
|
||||
Patch12: 0011-zypp-Fix-compile-with-__attribute__-gnu_printf.patch
|
||||
# PATCH-FIX-UPSTREAM 0012-zypp-less-debug-in-progress-functions.patch coolo@suse.de -- less debug
|
||||
Patch13: 0012-zypp-less-debug-in-progress-functions.patch
|
||||
# PATCH-FIX-UPSTREAM 0013-zypp-remap-PK-provides-into-rpm-provides-as-the-zif-.patch coolo@suse.de -- search in ppds
|
||||
Patch14: 0013-zypp-remap-PK-provides-into-rpm-provides-as-the-zif-.patch
|
||||
# To update this package, please git-format-patch the tag of the
|
||||
# tarball version (eg: PACKAGEKIT_0_6_19) vs the distro tag (eg: openSUSE_Factory)
|
||||
# in https://github.com/openSUSE/PackageKit and keep the patches
|
||||
@@ -285,6 +287,7 @@ This package provides the upstream default configuration for PackageKit.
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
translation-update-upstream
|
||||
|
||||
%build
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
From cc89ed2698fd21245d955e722fdd2509f857b355 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Kulow <coolo@suse.de>
|
||||
Date: Mon, 11 Feb 2013 19:07:53 +0100
|
||||
Subject: [PATCH] zypp: remap PK provides into rpm provides as the zif backend
|
||||
does
|
||||
|
||||
---
|
||||
backends/zypp/pk-backend-zypp.cpp | 97 ++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 85 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
|
||||
index f492a1c..6df4067 100644
|
||||
--- a/backends/zypp/pk-backend-zypp.cpp
|
||||
+++ b/backends/zypp/pk-backend-zypp.cpp
|
||||
@@ -3314,6 +3314,73 @@ pk_backend_repo_set_data (PkBackend *backend, PkBackendJob *job, const gchar *re
|
||||
pk_backend_job_thread_create (job, backend_repo_set_data_thread, NULL, NULL);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * pk_backend_what_provides_decompose: maps enums to provides
|
||||
+ */
|
||||
+static gchar **
|
||||
+pk_backend_what_provides_decompose (PkBackendJob *job,
|
||||
+ PkProvidesEnum provides,
|
||||
+ gchar **values)
|
||||
+{
|
||||
+ guint i;
|
||||
+ guint len;
|
||||
+ gchar **search = NULL;
|
||||
+ GPtrArray *array = NULL;
|
||||
+
|
||||
+ /* iter on each provide string, and wrap it with the fedora prefix - unless different to openSUSE */
|
||||
+ len = g_strv_length (values);
|
||||
+ array = g_ptr_array_new_with_free_func (g_free);
|
||||
+ for (i=0; i<len; i++) {
|
||||
+ MIL << provides << " " << values[i] << endl;
|
||||
+ /* compatibility with previous versions of GPK */
|
||||
+ if (g_str_has_prefix (values[i], "gstreamer0.10(") ||
|
||||
+ g_str_has_prefix (values[i], "gstreamer1(")) {
|
||||
+ g_ptr_array_add (array, g_strdup (values[i]));
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_CODEC) {
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("gstreamer0.10(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("gstreamer1(%s)", values[i]));
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_FONT) {
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("font(%s)", values[i]));
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_MIMETYPE) {
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("mimehandler(%s)", values[i]));
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_POSTSCRIPT_DRIVER) {
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("postscriptdriver(%s)", values[i]));
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_PLASMA_SERVICE) {
|
||||
+ /* We need to allow the Plasma version to be specified. */
|
||||
+ if (g_str_has_prefix (values[i], "plasma")) {
|
||||
+ g_ptr_array_add (array, g_strdup (values[i]));
|
||||
+ } else {
|
||||
+ /* For compatibility, we default to plasma4. */
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("plasma4(%s)", values[i]));
|
||||
+ }
|
||||
+ } else if (provides == PK_PROVIDES_ENUM_ANY) {
|
||||
+ /* We need to allow the Plasma version to be specified. */
|
||||
+ if (g_str_has_prefix (values[i], "plasma")) {
|
||||
+ g_ptr_array_add (array, g_strdup (values[i]));
|
||||
+ } else {
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("gstreamer0.10(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("gstreamer1(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("font(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("mimehandler(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("postscriptdriver(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("plasma4(%s)", values[i]));
|
||||
+ g_ptr_array_add (array, g_strdup_printf ("plasma5(%s)", values[i]));
|
||||
+ }
|
||||
+ } else {
|
||||
+ pk_backend_job_error_code (job,
|
||||
+ PK_ERROR_ENUM_PROVIDE_TYPE_NOT_SUPPORTED,
|
||||
+ "provide type %s not supported",
|
||||
+ pk_provides_enum_to_string (provides));
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ search = pk_ptr_array_to_strv (array);
|
||||
+ for (i = 0; search[i] != NULL; i++)
|
||||
+ g_debug ("Querying provide '%s'", search[i]);
|
||||
+out:
|
||||
+ return search;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
backend_what_provides_thread (PkBackendJob *job, GVariant *params, gpointer user_data)
|
||||
{
|
||||
@@ -3336,10 +3403,9 @@ backend_what_provides_thread (PkBackendJob *job, GVariant *params, gpointer user
|
||||
}
|
||||
pk_backend_job_set_status (job, PK_STATUS_ENUM_QUERY);
|
||||
|
||||
- const gchar *search = values[0]; //Fixme - support possible multi1ple search values (logical OR)
|
||||
ResPool pool = zypp_build_pool (zypp, true);
|
||||
|
||||
- if((provides == PK_PROVIDES_ENUM_HARDWARE_DRIVER) || g_ascii_strcasecmp("drivers_for_attached_hardware", search) == 0) {
|
||||
+ if((provides == PK_PROVIDES_ENUM_HARDWARE_DRIVER) || g_ascii_strcasecmp("drivers_for_attached_hardware", values[0]) == 0) {
|
||||
// solver run
|
||||
Resolver solver(pool);
|
||||
solver.setIgnoreAlreadyRecommended (TRUE);
|
||||
@@ -3375,18 +3441,25 @@ backend_what_provides_thread (PkBackendJob *job, GVariant *params, gpointer user
|
||||
}
|
||||
solver.setIgnoreAlreadyRecommended (FALSE);
|
||||
} else {
|
||||
- Capability cap (search);
|
||||
- sat::WhatProvides prov (cap);
|
||||
-
|
||||
- for (sat::WhatProvides::const_iterator it = prov.begin (); it != prov.end (); ++it) {
|
||||
- if (zypp_filter_solvable (_filters, *it))
|
||||
- continue;
|
||||
-
|
||||
- PkInfoEnum info = it->isSystem () ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
|
||||
- zypp_backend_package (job, info, *it, make<ResObject>(*it)->summary().c_str ());
|
||||
+ gchar **search = pk_backend_what_provides_decompose (job,
|
||||
+ provides,
|
||||
+ values);
|
||||
+
|
||||
+ guint len = g_strv_length (search);
|
||||
+ for (guint i=0; i<len; i++) {
|
||||
+ MIL << search[i] << endl;
|
||||
+ Capability cap (search[i]);
|
||||
+ sat::WhatProvides prov (cap);
|
||||
+
|
||||
+ for (sat::WhatProvides::const_iterator it = prov.begin (); it != prov.end (); ++it) {
|
||||
+ if (zypp_filter_solvable (_filters, *it))
|
||||
+ continue;
|
||||
+
|
||||
+ PkInfoEnum info = it->isSystem () ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
|
||||
+ zypp_backend_package (job, info, *it, make<ResObject>(*it)->summary().c_str ());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
-
|
||||
pk_backend_job_finished (job);
|
||||
}
|
||||
|
||||
--
|
||||
1.8.1.1
|
||||
|
||||
Reference in New Issue
Block a user