root/masterdriverz/use-expand/dev-notes/developing.rst @ jokey%2540gentoo.org-20070118231239-ewd4ic7ptl6ym3yf

Revision jokey%2540gentoo.org-20070118231239-ewd4ic7ptl6ym3yf, 2.6 kB (checked in by Markus Ullmann <jokey@…>, 2 years ago)

Update README and some URLs

Line 
1====================
2 Getting a bzr repo
3====================
4
5If you're just installing pkgcore from a released tarball, skip this section.
6
7To get the current (development) code without history, install bazaar_
8(``emerge bzr`` on gentoo) and run::
9
10  bzr co --lightweight http://bzr.pkgcore.org/<branch>
11
12Currently the "main" branches are ``ferringb/pkgcore-dev`` and
13``marienz/pkgcore-dev``.
14
15If you also want history, omit ``--lightweight`` (beware: this is over
1610 mb of data).
17
18.. _bazaar: http://bazaar-vcs.org/
19
20====================
21 Installing pkgcore
22====================
23
24Set PYTHONPATH
25==============
26
27If you only want to run scripts from pkgcore itself (the ones in its
28"bin" directory) you do not have to do anything with PYTHONPATH. If
29you want to use pkgcore from an interactive python interpreter session
30you do not have to do anything if you start the interpreter from the
31"root" of the pkgcore source tree. For other uses you probably want to
32set PYTHONPATH to include your pkgcore directory, so that python can
33find the pkgcore code. For example::
34
35 $ export PYTHONPATH="${PYTHONPATH}:/home/user/pkgcore/"
36
37Now test to see if it works::
38
39 $ python -c'import pkgcore'
40
41Python will scan pkgcore, see the pkgcore directory in it (and that it has
42__init__.py), and use that.
43
44
45Registering plugins
46===================
47
48Pkgcore uses plugins for some basic functionality. You do not really
49have to do anything to get this working, but things are a bit faster
50if the plugin cache is up to date. This happens automatically if the
51cache is stale and the user running pkgcore may write there, but if
52pkgcore is installed somewhere system-wide and you only run it as user
53you can force a regeneration with::
54
55 # pplugincache
56
57If you want to update plugin caches for something other than pkgcore's
58core plugin registry, pass the package name as an argument.
59
60Test pkgcore
61============
62
63Drop back to normal user, and try::
64
65 $ python
66 >>> import pkgcore.config
67 >>> from pkgcore.ebuild.atom import atom
68 >>> conf=pkgcore.config.load_config()
69 >>> tree=conf.get_default('domain').repos[1]
70 >>> pkg=max(tree.itermatch(atom("dev-util/diffball")))
71 >>> print pkg
72 >>> print pkg.depends
73 >=dev-libs/openssl-0.9.6j >=sys-libs/zlib-1.1.4 >=app-arch/bzip2-1.0.2
74
75
76At the time of writing the domain interface is in flux, so this example might
77fail for you. If it doesn't work ask for assistance in #pkgcore on freenode,
78or email ferringb (at) gmail.com' with the traceback.
79
80Build extensions
81================
82
83If you want to run pkgcore from its source directory but also want the
84extra speed from the compiled extension modules, compile them in place::
85
86 $ python setup.py build_ext -i
Note: See TracBrowser for help on using the browser.