root/releases/pkgcore/0.1/dev-notes/developing.rst @ ferringb%2540gentoo.org-20060930194135-1fa9fedc9fd3d4a2

Revision ferringb%2540gentoo.org-20060930194135-1fa9fedc9fd3d4a2, 2.0 KB (checked in by Brian Harring <ferringb@…>, 2 years ago)

minor tweak.

Line 
1====================
2 Getting a bzr repo
3====================
4
5If you're just installing pkgcore from a released tarball, skip this section.
6
7The quickest way to get a copy of the integration (release) branch is via
8downloading
9http://dev.gentooexperimental.org/~pkgcore/releases/pkgcore/hourly-snapshot.tar.bz2
10
11This is a full branched bzr repo; just untar it, run bzr pull --overwrite, and you're
12good to go, full history history.
13
14
15====================
16 Installing pkgcore
17====================
18
19Set PYTHONPATH
20==============
21
22Set PYTHONPATH to include your pkgcore directory, so that python can find the
23pkgcore code. Fore example::
24
25 $ export PYTHONPATH="${PYTHONPATH}:/home/user/pkgcore/"
26
27Now test to see if it works::
28
29 $ python -c'import pkgcore'
30
31Python will scan pkgcore, see the pkgcore directory in it (and that it has
32__init__.py), and use that.
33
34
35Registering plugins
36===================
37
38Pkgcore is pluggable, so even to get the basis working some plugins must be
39registered by running as root::
40
41 # pkgcore/bin/utilities/register.bash
42
43If you register plugins manually you need to set PYTHONPATH (note that sudo
44cleanses the env normally).  If that fails, your PYTHONPATH is invalid;
45if it works it'll spit back a registering message.  So far, good to go.
46
47Test pkgcore
48============
49
50Drop back to normal user, and try::
51
52 $ python
53 >>> import pkgcore.config
54 >>> from pkgcore.ebuild.atom import atom
55 >>> conf=pkgcore.config.load_config()
56 >>> tree=conf.get_default('domain').repos[1]
57 >>> pkg=max(tree.itermatch(atom("dev-util/diffball")))
58 >>> print pkg
59 >>> print pkg.depends
60 >=dev-libs/openssl-0.9.6j >=sys-libs/zlib-1.1.4 >=app-arch/bzip2-1.0.2
61
62
63At the time of writing the domain interface is in flux, so this example might
64fail for you. If it doesn't work ask for assistance in #pkgcore on freenode,
65or email ferringb (at) gmail.com' with the traceback.
66
67Build filter-env
68================
69
70Finally, you need filter-env for the ebuild daemon::
71
72 $ python setup.py build_filter_env
Note: See TracBrowser for help on using the browser.