[packagekit] Groups for Debian/Ubuntu

Richard Hughes hughsient at gmail.com
Tue Aug 19 06:50:38 PDT 2008


On Tue, 2008-08-19 at 09:02 +0200, Sebastian Heinlein wrote:
> > Ahhhhhh! These enums push us over the 32bit enum limit (my fault for
> not
> > noticing). This was always a future problem that could be solved
> > switching to gperf. I really don't want to do all the build
> engineering
> > that gperf entails right now.
> > 
> > Do you mind if I back out these changes, and we add them back for
> 0.3.1?
> > 
> > Richard.
> 
> No problem.

Right, the conclusion I've come to after a few hours of late night
hacking is that it's not worth the extra complexity of gperf (and a fair
bit of awk) to autogenerate our enums to be guint64 bits. The more I
played with the code, it became more obvious we shouldn't be using int
enums for bitfields.

I've created a couple of new files, libpackagekit/pk-bitfield.{c|h}
which are just renamed versions of the _enums_ functions with extra
logic to do all the bit shifting where needed.

This is a quite invasive change (sorry!) but I think I've fixed up all
the backends and support code:

 backends/alpm/pk-backend-alpm.c                  |   66 +--
 backends/apt.deprecated/pk-apt-search-plain.c    |   14 
 backends/apt.deprecated/pk-apt-search-sqlite.cpp |    2 
 backends/apt.deprecated/pk-backend-apt.c         |   48 +-
 backends/apt/pk-backend-apt.c                    |   70 +--
 backends/box/pk-backend-box.c                    |   52 +-
 backends/conary/pk-backend-conary.c              |   42 +-
 backends/dummy/pk-backend-dummy.c                |   42 +-
 backends/opkg/pk-backend-opkg.c                  |   40 +
 backends/pisi/pk-backend-pisi.c                  |   88 ++--
 backends/poldek/pk-backend-poldek.c              |  128 +++---
 backends/razor/pk-backend-razor.c                |   18 
 backends/smart/pk-backend-smart.c                |   24 -
 backends/test/pk-backend-test-dbus.c             |    2 
 backends/test/pk-backend-test-fail.c             |   36 -
 backends/test/pk-backend-test-spawn.c            |    4 
 backends/test/pk-backend-test-succeed.c          |   44 +-
 backends/test/pk-backend-test-thread.c           |    8 
 backends/urpmi/pk-backend-urpmi.c                |  108 ++---
 backends/yum/pk-backend-yum.c                    |  104 ++---
 backends/yum2/pk-backend-yum2.c                  |   76 +--
 backends/zypp/pk-backend-zypp.cpp                |   89 ++--
 backends/zypp/zypp-utils.cpp                     |    8 
 backends/zypp/zypp-utils.h                       |    2 
 client/pk-console.c                              |   77 +--
 client/pk-generate-pack-main.c                   |    4 
 client/pk-generate-pack.c                        |    2 
 client/pk-generate-pack.h                        |    2 
 libpackagekit/Makefile.am                        |    5 
 libpackagekit/pk-bitfield.c                      |  470 +++++++++++++++++++++++
 libpackagekit/pk-bitfield.h                      |   51 ++
 libpackagekit/pk-client.c                        |   67 +--
 libpackagekit/pk-client.h                        |   23 -
 libpackagekit/pk-control.c                       |   20 
 libpackagekit/pk-control.h                       |    7 
 libpackagekit/pk-enum.c                          |  406 +------------------
 libpackagekit/pk-enum.h                          |  281 ++++++-------
 libpackagekit/pk-self-test.c                     |    2 
 src/Makefile.am                                  |    4 
 src/pk-backend-dbus.c                            |   44 +-
 src/pk-backend-dbus.h                            |  144 +++----
 src/pk-backend-internal.h                        |    7 
 src/pk-backend-python.c                          |   22 -
 src/pk-backend.c                                 |   63 +--
 src/pk-backend.h                                 |   27 -
 src/pk-engine.c                                  |   14 
 src/pk-transaction-db.c                          |    2 
 src/pk-transaction.c                             |   24 -
 49 files changed, 1550 insertions(+), 1348 deletions(-)

It looks scarier than it is, as most of the changes are just:

-backend_search_details (PkBackend *backend, PkFilterEnum filters, const gchar *search)
+backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *search)

Please can you check that your code still compiles and works, and yell
at the top of your lungs if it doesn't. Thanks. :-)

Richard.





More information about the PackageKit mailing list