Added by zodman, last edited by zodman on Jul 10, 2010  (view change)

Labels:

conary conary Delete
development development Delete
packaging packaging Delete
page page Delete
devel devel Delete
packagekit packagekit Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

This page is to offer some tips for testing and debugging the conary backend for packagekit.

Misc
  • Check out the latest git version for development.
  • Here is some documentation (from Fedora project wiki) on building PackageKit and others from source.
Debugging information
import logging as log
log.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s')

####
log.debug("Log phrase")

To remove logging, reset the debug level (or set to any level higher than DEBUG, like INFO):

level=logging.NOTSET
Build packagekit to run locally

Pass these flags to the ./configure script (change --prefix as you need):

NOCONFIGURE=yes ./autogen.sh
./configure --with-default-backend=conary  --disable-qt --enable-local --with-default-backend=conary --enable-conary /
 --enable-dummy --with-security-framework=polkit --disable-gtk-doc   --disable-browser-plugin  --disable-gstreamer-plugin  /
 --disable-ruck --disable-command-not-found --disable-gtk-module --disable-strict

make

(why "--disable-gtk-module --disable-command-not-found --disable-browser-plugin --disable-gstreamer-plugin"?) >> disable extra plugins for only run packagekit

Run packagekit without installing
  • The conary backend is in backends/conary/ and the file conaryBackend.py acts as the entrance to the backend. The parameters that conaryBackend.py receives can be get from backends/conary/pk-backend-conary.c (simply search for 'conaryBackend.py').

So you can directly launch pkcon commands on the backend, shown as following.

Before you run the 'python conaryBackend.py <cmd>' commands, some preparation should be done first (TODO):

export NETWORK=
export BACKGROUND=

PackageKit:
pkcon refresh

backend:
sudo BACKGROUND=FALSE NETWORK=TRUE IDLE=FALSE python conaryBackend.py refresh-cache no

Packagekit
pkcon search name gimp

backend:
sudo BACKGROUND=FALSE NETWORK=TRUE IDLE=FALSE python conaryBackend.py search-name none gimp

PackageKit:
pkcon remove pastebinit

backend:
python conaryBackend.py remove-packages none "pastebinit:runtime;0.7-1-1;x86;/foresight.rpath.org@fl:2-qa/1222042924.172:0.7-1-1,1#x86"

Packagekit:
??

backend:
python conaryBackend.py update-packages "pastebinit;0.7-1-1;x86;/foresight.rpath.org@fl:2-qa/1222042924.172:0.7-1-1,1#x86"

PackageKit:
pkcon install pastebinit

backend:
python conaryBackend.py install-packages "pastebinit;0.7-1-1;x86;/foresight.rpath.org@fl:2-qa/1222042924.172:0.7-1-1,1#x86"

Packagekit:
pkcon resolve <app>

backend:
python conaryBackend.py resolve installed pastebinit

.h5 Compile gnome-packagekit

./configure --disable-gudev PACKAGEKIT_CFLAGS='-I/home/zodman/Desarrollo/newpkg/PackageKit-0.5.7/lib/packagekit-glib2' PACKAGEKIT_LIBS='-lpackagekit-glib2'
[zodman@cosmogirl gnome-packagekit]$ pkg-config --cflags --libs packagekit-glib2
-pthread -I/usr/include/PackageKit -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

-pthread -lpackagekit-glib2 -lgobject-2.0 -lsqlite3 -lgthread-2.0 -lrt -lglib-2.0  -L/home/zodman/Desarrollo/newpkg/PackageKit-0.5.7/lib/packagekit-glib2/.libs

.h5 Callbacks of conary

Callbacks

UpdateSytem:requestingChangeset STATUS_REQUEST
updateSystem:downloadingChangeSet STATUS_DOWNLOAD
UpdateSytem:requestingChangeset STATUS_REQUEST
updateSystem:downloadingChangeSet STATUS_DOWNLOAD
updateSystem:resolvingDependencies STATUS_DEP_RESOLVE

updateSystem:setChangesetHunk 1/80
UpdateSytem:requestingChangeset STATUS_WAIT
updateSystem:downloadingChangeSet STATUS_DOWNLOAD
updateSystem:setUpdateHunk STATUS_QUERY
updatesystem:setUpdateJob ---> troves on jobs
updatesystem:creatingRollback STATUS_ROLLBACK
updatesystem:preparingUpdate
updatesystem:creatingDatabaseTransaction STATUS_COPY_FILES
updatesystem:committingTransaction STATUS_COMMIT
updatesystem:updateDone STATUS_CLEANUP

updateSystem:setChangesetHunk 2.00/80.00

updateSystem:setChangesetHunk 2.00/80.00

.h5 notes:

12:26] zodman: for getting the jobs what need to update
[12:26] zodman: i see conary
[12:27] zodman: do 2 times a requestiongChanset.downloadChangeset do resolveDeps. and then show the jobs with the troves.
[12:27] mkj_wk: one to each repository
[12:27] zodman: why do 2 times the download changeset ?
[12:27] mkj_wk: foresight.rpath.org and conary.rpath.com
[12:27] mkj_wk: or two times to reach repo?
[12:27] zodman: oh oh ok ok ok
[12:28] mkj_wk: oh, downloading troves without files, then with files where necessary
[12:28] zodman: mmm i think 2 times one by fl and other for conary
[12:28] zodman: sound logic.
[12:28] mkj_wk: do you know about CONARY_CLIENT_LOG ?
[12:29] zodman: it is env ?
[12:29] zodman: var*
[12:29] mkj_wk: yes
[12:29] zodman: ok ok let take note.
[12:29] mkj_wk: it will log all your repository calls in the same format used for the binary repository log
[12:30] mkj_wk: then you can use scripts/logcat to read that file
[12:30] mkj_wk: you can use scripts/logcat -f /path/to/log/file to tail the log, just like cat -f
[12:30] mkj_wk: s/cat -f/tail -f/
[12:30] zodman: ok
[12:30] mkj_wk: (I knew what I meant...
[12:31] zodman: other question mkj_wk jijiji
[12:31] zodman: sorry
[12:31] zodman: exist a way for convert and string version,string flavor to VFS() an Flavor() objects ?
[12:31] zodman: version string like "1.0-1-3"
[12:32] zodman: and flavor like "x86"
[12:32] zodman: but with getting on client.repos...
[12:32] zodman: without*
[12:32] mkj_wk: well, findTroves gets you actual version objects
[12:32] zodman: but without getting on client.repos.*
[12:33] mkj_wk: if you don't have a real version, you don't really know what should be in the version object
[12:33] mkj_wk: (the only time this makes sense is cook time, I think)
[12:34] Gung-Ho_ (~brector@66.192.95.199) has joined
[12:34] Gung-Ho_ (~brector@66.192.95.199) has disconnected: Remote host closed the connection
[12:34] Gung-Ho (~brector@66.192.95.199) has disconnected: Read error: Connection reset by peer
[12:34] mkj_wk: so what do you need the version object for?
[12:34] Gung-Ho (~brector@66.192.95.199) has joined
[12:35] zodman: ok ok
[12:35] mkj_wk: for flavor I assume you want deps.deps.parseFlavor()
[12:35] zodman: exist a plugin on packagekit like command-line autocomplete
[12:36] zodman: when you type gediit
[12:36] mkj_wk: and I'm sure you know about parseTroveSpec for turning foo=a@b:c/1-1-1[is:x86] into ('foo', 'a@b:c/1-1-1', 'is: x86')
[12:36] zodman: some like that mkj_wk.
[12:37] zodman: but 'a@b:c/1-1-1' its a VFS object ?
[12:37] mkj_wk: no, it's a string
[12:37] zodman: mmmmmmmm i can use it too....
[12:37] mkj_wk: conaryclient.cmdline.parseTroveSpec
[12:37] zodman: yes can help it.
[12:38] zodman: tnx man!
[12:38] mkj_wk: yw!