[packagekit] handling input

Richard Hughes hughsient at gmail.com
Tue Jan 1 11:57:06 PST 2008


On Tue, 2008-01-01 at 14:19 -0500, Matthias Clasen wrote:
> I've now noticed several places where packagekit exhibits a tendency
> to force a narrow view of input validity instead of working with what
> the user/backend provides:
> 
> - repo ids are not allowed to contain spaces ? yum has no such
> restriction, afaics...

Well, it's an artificial restriction. If you removed the check and used
a package_id with a space then everything would still work. The point is
_why_ - can and should a package name ever contain a space?

> - search terms are forced through the same strvalidate function than
> everything else, meaning I cannot search for
> anything containing space, $,  ", [, ]. <. >, etc. In particular for
> searching in descriptions, this seems somewhat restrictive.

Sure, that does sound overly militant for description searches.

> - update descriptions are artificially forced to be a single line by
> means of s/\n/;/. This looks, smells and feels like a bug introduced
> by the choice to funnel the frontend-backend communication through
> single lines on stdout...

Yes, we have to do this to keep everything abstract for the non-compiled
backends. We have to work with backends written in python, perl, sh or
whatever. stdout is the lowest common denominator and also allows us to
test stuff trivially.

> We can certainly do better than this (at least pup can...)

Why is s/\n/;/ a problem? Are there any other issues with this?

> While we are on the topic of frontend-backend communication, is there
> any documentation about the protocol used for
> this ? both the dbus protocol and the ad hoc protocol between backend
> and helpers would be good to have written down in some form.

Quite a bit; have a look in docs/spec/*.html

Richard.





More information about the PackageKit mailing list