Bug 43305 - [glib] unexpected catalogue parsing
Summary: [glib] unexpected catalogue parsing
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: client-library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-28 06:45 UTC by Christian Persch (GNOME)
Modified: 2011-11-28 08:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (1.30 KB, patch)
2011-11-28 06:46 UTC, Christian Persch (GNOME)
Details | Splinter Review

Description Christian Persch (GNOME) 2011-11-28 06:45:08 UTC
The catalogue entries look like string lists, but are parsed with g_key_file_get_string() and only afterwards split along into parts. String lists end with a ';' character, which the current code will make into an empty string, which later leads to an error when the packagekit backend tries to install that "" package. Since it's surprising to the user that these entries are parsed as strings not string lists, the lib should tolerate the string list format and thus skip the empty string parts.

Alternatively, just use g_key_file_get_string_list(); is there any reason that ',' and ' ' are also supported as delimiters?
Comment 1 Christian Persch (GNOME) 2011-11-28 06:46:49 UTC
Created attachment 53902 [details] [review]
proposed patch
Comment 2 Richard Hughes 2011-11-28 08:17:54 UTC
Pushed with minor changes, many thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.