- Fix a library error so we don't print (null) in the UI.

This commit is contained in:
Richard Hughes 2008-09-10 14:32:51 +00:00
parent 017493cba7
commit d54c5e1647
2 changed files with 51 additions and 1 deletions

View File

@ -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 <rhughes@redhat.com> - 0.3.2-2
- Fix a library error so we don't print (null) in the UI.
* Mon Sep 08 2008 Richard Hughes <rhughes@redhat.com> - 0.3.2-1
- New upstream version
- This is the first release with the dispatcher functionality that allows

View File

@ -0,0 +1,43 @@
commit 0bc4ba936db39ccf0466987d964a016363bceeee
Author: Richard Hughes <richard@hughsie.com>
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 : "");
}
/**