aboutsummaryrefslogtreecommitdiff
path: root/HACKING
blob: 6fbd41b27ebcbdd7f4b0067bae73f9fb4e856de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Running the Tests
-----------------
The tests are run via

    make

To also run the component tests, you need to initialize the git submodules once
via:

    git submodule update --init --recursive

This will fetch the necessary binary data for the DEB and RPM component tests,
and the tests are from now on included within each regular test run.

Some tests reach out to the network. To run these in addition to all
other tests use:

    make all+net

You can run the tests in a debian/sid docker container by using
tests/helpers/run-in-docker.

Building the API Docs
---------------------
You can build the API docs using

    make apidocs


Contributing Patches
--------------------
Make sure the tests pass before sending in patch. You can either send it to the
mailing list or add it to a bug report against git-buildpackage on

    http://bugs.debian.org/src:git-buildpackage


Layout
------

    gbp/scripts/*.py    - the actual gbp commands (buildpackage, dch, …)
    gbp/scripts/common/ - code shared between Debian and RPM commands
    gbp/deb/            - Debian package handling (control, dsc, …)
    gbp/rpm/            - RPM package handling (spec files, …)
    gbp/git/            - Git repository interaction
    tests/*.py          - unit tests
    tests/doctests      - doctests that also serve as examples
    tests/component/    - component tests that invoke actual commands

Interfaces
----------
A gbp command in gbp/scripts/<commmand>.py must provide these interfaces:

When one invokes `gbp <command>` gbp/scripts/<commmand>.py is imported by

    gbp/scripts/supercommand.py

which then invokes it's *main* function with all given command line arguments.
It is expected to return with the exit status that should be passed back to the
shell.

When one invokes `gbp config <command>` gbp/scripts/<commmand>.py is imported by

    gbp/scripts/config.py

which then invokes it's *build_parser* function with the command name as argument.
It is expected to return a GbpConfigParser with all config files parsed.