From d54c5e16477e1907646bffa6eabb28666dba7146 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 10 Sep 2008 14:32:51 +0000 Subject: [PATCH] - Fix a library error so we don't print (null) in the UI. --- PackageKit.spec | 9 ++++++- pk-dont-show-brackets-null.patch | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 pk-dont-show-brackets-null.patch diff --git a/PackageKit.spec b/PackageKit.spec index 01366eb..886a369 100644 --- a/PackageKit.spec +++ b/PackageKit.spec @@ -8,13 +8,16 @@ Summary: System daemon that is a DBUS abstraction layer for package management Name: PackageKit Version: 0.3.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://packagekit.freedesktop.org Source0: http://www.packagekit.org/releases/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Upstream: 0bc4ba936db39ccf0466987d964a016363bceeee +Patch0: pk-dont-show-brackets-null.patch + Requires: dbus >= %{dbus_version} Requires: dbus-glib >= %{dbus_glib_version} Requires: PackageKit-libs = %{version}-%{release} @@ -138,6 +141,7 @@ using PackageKit. %prep %setup -q +%patch0 -p1 %build %configure --enable-yum --enable-smart --with-default-backend=yum --disable-local @@ -266,6 +270,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %{_includedir}/* %changelog +* Wed Sep 10 2008 Richard Hughes - 0.3.2-2 +- Fix a library error so we don't print (null) in the UI. + * Mon Sep 08 2008 Richard Hughes - 0.3.2-1 - New upstream version - This is the first release with the dispatcher functionality that allows diff --git a/pk-dont-show-brackets-null.patch b/pk-dont-show-brackets-null.patch new file mode 100644 index 0000000..789ba63 --- /dev/null +++ b/pk-dont-show-brackets-null.patch @@ -0,0 +1,43 @@ +commit 0bc4ba936db39ccf0466987d964a016363bceeee +Author: Richard Hughes +Date: Wed Sep 10 15:17:01 2008 +0100 + + bugfix: don't convert null sections of a package_id to '(NULL)' instead use an empty string. + +diff --git a/libpackagekit/pk-package-id.c b/libpackagekit/pk-package-id.c +index f328225..9d911fb 100644 +--- a/libpackagekit/pk-package-id.c ++++ b/libpackagekit/pk-package-id.c +@@ -218,9 +214,12 @@ pk_package_id_copy (const PkPackageId *id) + gchar * + pk_package_id_to_string (const PkPackageId *id) + { +- return g_strdup_printf ("%s;%s;%s;%s", +- id->name, id->version, +- id->arch, id->data); ++ g_return_val_if_fail (id != NULL, NULL); ++ g_return_val_if_fail (id->name != NULL, NULL); ++ return g_strdup_printf ("%s;%s;%s;%s", id->name, ++ id->version != NULL ? id->version : "", ++ id->arch != NULL ? id->arch : "", ++ id->data != NULL ? id->data : ""); + } + + /** +@@ -237,11 +236,10 @@ pk_package_id_build (const gchar *name, const gchar *version, + const gchar *arch, const gchar *data) + { + g_return_val_if_fail (name != NULL, NULL); +- g_return_val_if_fail (version != NULL, NULL); +- g_return_val_if_fail (arch != NULL, NULL); +- g_return_val_if_fail (data != NULL, NULL); +- +- return g_strdup_printf ("%s;%s;%s;%s", name, version, arch, data); ++ return g_strdup_printf ("%s;%s;%s;%s", name, ++ version != NULL ? version : "", ++ arch != NULL ? arch : "", ++ data != NULL ? data : ""); + } + + /** +