[packagekit] Apt Sqlite branch

Richard Hughes hughsient at gmail.com
Wed Oct 10 12:21:34 PDT 2007

On Wed, 2007-10-10 at 20:09 +0200, Tom Parker wrote:
> I've just committed my work with apt sqlite-caching to the main tree,
> as I'm convinced that it's now in a better condition than the existing
> apt backend. A couple of things are of note here.

I'll rip out the trailing whitespace from your commit (pet peeve of
mine) so you 'll want to pull in a few minutes.

> 1) After much deliberation, I'm now using a python helper script for
> the refresh-cache action in apt, mainly because we can't gain anything
> (i.e. caching) by using the C++ version, and this way we get to use
> the easier route of python-apt rather than maintaining a separate copy
> of the apt-get code.

Sure, seems sane.

> 2) backends/apt/ currently includes a couple of files that may well be
> useful for the wider community of backend builders:
>  - sqlite-pkg-cache.{cpp,h} - non apt-specific sqlite cache code. Used
> for searching an already built sqlite cache (built via
> backend-specific callback functions).

Well, I would like to try and avoid doing this "easily" for backends
unless people really need to do it. It adds another layer of complexity
when the API is already async. For apt it's sane, but for yum and conary
unnecessary. What you've done looks good tho.

>  - python-backend-common.{cpp,h} - currently, a single simple C
> (should really rename from cpp)

Yes please.

>  function that checks for network
> connectivity, and then calls pk_backend_spawn_helper for the
> backend-specific "refresh-cache.py". Notably, other backends that have
> their own separate python code can use this, and this file will be
> expanded in the future with other similar functions for common-named
> python code.

No, I don't think we should do this, to only save a few lines of copy
paste - it doesn't buy us much in my opinion. It certainly shouldn't be
in a backend specific directory.

> The second point means that the PK_BACKEND_OPTIONS for the apt backend
> is built from multiple sources, both apt-specific and generic
> functions, thus (potentially) reducing the amount of backend-specific
> code.

I'll change this just to you:

-       "Richard Hughes <richard at hughsie.com>", /* author */
-       NULL,                                   /* initalize */
+       "Richard Hughes <richard at hughsie.com>, Tom Parker <palfrey at tevp.net>",  /* author */
+       backend_initialize,                     /* initalize */

Putting me in the credits for the apt backends is just wrong. You're the
dude :-)


More information about the PackageKit mailing list