[PATCH] Support looking up Plasma services (yum and zif backends only for now).
Kevin Kofler
kevin.kofler at chello.at
Sun Jun 19 18:05:18 PDT 2011
Add a PK_PROVIDES_ENUM_PLASMA_SERVICE enum entry.
Handle it in the yum and zif backends.
---
backends/yum/yumBackend.py | 3 +++
backends/zif/pk-backend-zif.c | 3 +++
lib/packagekit-glib2/pk-enum.c | 1 +
lib/packagekit-glib2/pk-enum.h | 1 +
lib/packagekit-qt/src/enum.h | 1 +
lib/packagekit-qt2/transaction.h | 3 ++-
6 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 05f5ce0..d66f862 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -902,12 +902,15 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
return [ "mimehandler(%s)" % value ]
if provides_type == PROVIDES_POSTSCRIPT_DRIVER:
return [ "postscriptdriver(%s)" % value ]
+ if provides_type == PROVIDES_PLASMA_SERVICE:
+ return [ "plasma4(%s)" % value ]
if provides_type == PROVIDES_ANY:
provides = []
provides.append(self._get_provides_query(PROVIDES_CODEC, value)[0])
provides.append(self._get_provides_query(PROVIDES_FONT, value)[0])
provides.append(self._get_provides_query(PROVIDES_MIMETYPE, value)[0])
provides.append(self._get_provides_query(PROVIDES_POSTSCRIPT_DRIVER, value)[0])
+ provides.append(self._get_provides_query(PROVIDES_PLASMA_SERVICE, value)[0])
provides.append(value)
return provides
diff --git a/backends/zif/pk-backend-zif.c b/backends/zif/pk-backend-zif.c
index 9ef27ab..33461f9 100644
--- a/backends/zif/pk-backend-zif.c
+++ b/backends/zif/pk-backend-zif.c
@@ -5139,11 +5139,14 @@ pk_backend_what_provides (PkBackend *backend, PkBitfield filters,
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) {
+ g_ptr_array_add (array, g_strdup_printf ("plasma4(%s)", values[i]));
} else if (provides == PK_PROVIDES_ENUM_ANY) {
g_ptr_array_add (array, g_strdup_printf ("gstreamer0.10(%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]));
} else {
pk_backend_error_code (backend,
PK_ERROR_ENUM_PROVIDE_TYPE_NOT_SUPPORTED,
diff --git a/lib/packagekit-glib2/pk-enum.c b/lib/packagekit-glib2/pk-enum.c
index 3d0cdf2..724d98c 100644
--- a/lib/packagekit-glib2/pk-enum.c
+++ b/lib/packagekit-glib2/pk-enum.c
@@ -359,6 +359,7 @@ static const PkEnumMatch enum_provides[] = {
{PK_PROVIDES_ENUM_HARDWARE_DRIVER, "driver"},
{PK_PROVIDES_ENUM_FONT, "font"},
{PK_PROVIDES_ENUM_POSTSCRIPT_DRIVER, "postscript-driver"},
+ {PK_PROVIDES_ENUM_PLASMA_SERVICE, "plasma-service"},
{0, NULL}
};
diff --git a/lib/packagekit-glib2/pk-enum.h b/lib/packagekit-glib2/pk-enum.h
index 48dc5ec..52bea6e 100644
--- a/lib/packagekit-glib2/pk-enum.h
+++ b/lib/packagekit-glib2/pk-enum.h
@@ -498,6 +498,7 @@ typedef enum {
PK_PROVIDES_ENUM_FONT,
PK_PROVIDES_ENUM_HARDWARE_DRIVER,
PK_PROVIDES_ENUM_POSTSCRIPT_DRIVER,
+ PK_PROVIDES_ENUM_PLASMA_SERVICE,
PK_PROVIDES_ENUM_LAST
} PkProvidesEnum;
diff --git a/lib/packagekit-qt/src/enum.h b/lib/packagekit-qt/src/enum.h
index 4a54bf4..f870370 100644
--- a/lib/packagekit-qt/src/enum.h
+++ b/lib/packagekit-qt/src/enum.h
@@ -450,6 +450,7 @@ public:
ProvidesFont,
ProvidesHardwareDriver,
ProvidesPostscriptDriver,
+ ProvidesPlasmaService,
/* this always has to be at the end of the list */
LastProvides
} Provides;
diff --git a/lib/packagekit-qt2/transaction.h b/lib/packagekit-qt2/transaction.h
index 5c2ff1a..04e6bcf 100644
--- a/lib/packagekit-qt2/transaction.h
+++ b/lib/packagekit-qt2/transaction.h
@@ -337,7 +337,8 @@ public:
ProvidesMimetype,
ProvidesFont,
ProvidesHardwareDriver,
- ProvidesPostscriptDriver
+ ProvidesPostscriptDriver,
+ ProvidesPlasmaService
} Provides;
/**
--
1.7.4.4
--nextPart2287280.guGZAbPHS5--
More information about the PackageKit
mailing list