From 6b9d3af14a504b32ee0ab98b05d709dc1ee4aa8c Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 10 Sep 2008 16:31:58 +0000 Subject: [PATCH] - Fix an error where we don't check for existing packages in the catalog code properly. Also fixes the self tests. --- PackageKit.spec | 10 +++++++++- pk-catalog-parameter-fix.patch | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 pk-catalog-parameter-fix.patch diff --git a/PackageKit.spec b/PackageKit.spec index 886a369..0301799 100644 --- a/PackageKit.spec +++ b/PackageKit.spec @@ -8,7 +8,7 @@ Summary: System daemon that is a DBUS abstraction layer for package management Name: PackageKit Version: 0.3.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://packagekit.freedesktop.org @@ -18,6 +18,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Upstream: 0bc4ba936db39ccf0466987d964a016363bceeee Patch0: pk-dont-show-brackets-null.patch +# Upstream: 918dd9d10ef18725776c6a55fe9cf03ec18db047 +Patch1: pk-catalog-parameter-fix.patch + Requires: dbus >= %{dbus_version} Requires: dbus-glib >= %{dbus_glib_version} Requires: PackageKit-libs = %{version}-%{release} @@ -142,6 +145,7 @@ using PackageKit. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %configure --enable-yum --enable-smart --with-default-backend=yum --disable-local @@ -270,6 +274,10 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %{_includedir}/* %changelog +* Wed Sep 10 2008 Richard Hughes - 0.3.2-3 +- Fix an error where we don't check for existing packages in the catalog + code properly. Also fixes the self tests. + * Wed Sep 10 2008 Richard Hughes - 0.3.2-2 - Fix a library error so we don't print (null) in the UI. diff --git a/pk-catalog-parameter-fix.patch b/pk-catalog-parameter-fix.patch new file mode 100644 index 0000000..c69604c --- /dev/null +++ b/pk-catalog-parameter-fix.patch @@ -0,0 +1,32 @@ +commit 918dd9d10ef18725776c6a55fe9cf03ec18db047 +Author: Richard Hughes +Date: Wed Sep 10 17:24:24 2008 +0100 + + bugfix: use a bitfield when searching for files in the catalog else we might return the wrong results + +diff --git a/libpackagekit/pk-catalog.c b/libpackagekit/pk-catalog.c +index 3072ad1..fcd14a2 100644 +--- a/libpackagekit/pk-catalog.c ++++ b/libpackagekit/pk-catalog.c +@@ -174,12 +174,18 @@ pk_catalog_process_type (PkCatalog *catalog) + /* do the actions */ + if (mode == PK_CATALOG_PROGRESS_PACKAGES) { + packages = pk_package_ids_from_id (package); +- ret = pk_client_resolve (catalog->priv->client, PK_FILTER_ENUM_NOT_INSTALLED, packages, &error); ++ ret = pk_client_resolve (catalog->priv->client, ++ pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED), ++ packages, &error); + g_strfreev (packages); + } else if (mode == PK_CATALOG_PROGRESS_FILES) { +- ret = pk_client_search_file (catalog->priv->client, PK_FILTER_ENUM_NOT_INSTALLED, package, &error); ++ ret = pk_client_search_file (catalog->priv->client, ++ pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED), ++ package, &error); + } else if (mode == PK_CATALOG_PROGRESS_PROVIDES) { +- ret = pk_client_what_provides (catalog->priv->client, PK_FILTER_ENUM_NOT_INSTALLED, 0, package, &error); ++ ret = pk_client_what_provides (catalog->priv->client, ++ pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED), ++ PK_PROVIDES_ENUM_ANY, package, &error); + } + if (!ret) { + egg_warning ("method failed: %s", error->message);