| 1 | ================ |
|---|
| 2 | pkgcore-checks |
|---|
| 3 | ================ |
|---|
| 4 | |
|---|
| 5 | Dependencies |
|---|
| 6 | ============ |
|---|
| 7 | |
|---|
| 8 | pkgcore-checks is developed alongside pkgcore. To run the development |
|---|
| 9 | version of pkgcore-checks you will need the development version of |
|---|
| 10 | pkgcore. |
|---|
| 11 | Otherwise the 0.x version numbers need to match. |
|---|
| 12 | |
|---|
| 13 | The metadata.xml checks require either xmllint (installed as part of |
|---|
| 14 | libxml2) or the python bindings to libxml2 (installed as part of |
|---|
| 15 | libxml2 with USE=python), with the latter preferred for speed reasons. |
|---|
| 16 | |
|---|
| 17 | Installation |
|---|
| 18 | ============ |
|---|
| 19 | |
|---|
| 20 | No installation is strictly required: just run the ``pcheck`` script and |
|---|
| 21 | as long as you are not root things should work. If you want to make |
|---|
| 22 | pkgcore-checks available system-wide use the provided ``setup.py`` |
|---|
| 23 | (see `Installing python modules`_ for details). |
|---|
| 24 | |
|---|
| 25 | Configuration |
|---|
| 26 | ============= |
|---|
| 27 | |
|---|
| 28 | No configuration is required, but some configuration makes ``pcheck`` |
|---|
| 29 | easier to use. |
|---|
| 30 | |
|---|
| 31 | Suites |
|---|
| 32 | ------ |
|---|
| 33 | |
|---|
| 34 | With no configuration it will try to guess the repository to use based |
|---|
| 35 | on your working directory and the list of repositories pkgcore knows |
|---|
| 36 | about. This will usually not quite work because the same location |
|---|
| 37 | often has multiple "repositories" with a slightly different |
|---|
| 38 | configuration and ``pcheck`` cannot guess which one to use. |
|---|
| 39 | |
|---|
| 40 | Defining "suites" in the configuration solves this ambiguity. A |
|---|
| 41 | "suite" contains a target repository, optionally a source repository |
|---|
| 42 | to use as a base and optionally a set of checks to run. If there is a |
|---|
| 43 | single suite with a target repository containing the current directory |
|---|
| 44 | it is used. So with the following suite definition in |
|---|
| 45 | ``~/.pkgcore.conf``:: |
|---|
| 46 | |
|---|
| 47 | [pcheck-portdir-suite] |
|---|
| 48 | class=pkgcore_checks.base.Suite |
|---|
| 49 | target_repo=portdir |
|---|
| 50 | |
|---|
| 51 | you can run ``pcheck`` with no further arguments inside your portage |
|---|
| 52 | directory and it will do the right thing. |
|---|
| 53 | |
|---|
| 54 | For use with overlays you need to define the "source" repo too:: |
|---|
| 55 | |
|---|
| 56 | [pcheck-overlay-suite] |
|---|
| 57 | class=pkgcore_checks.base.Suite |
|---|
| 58 | target_repo=/usr/local/portage/private |
|---|
| 59 | src_repo=portdir |
|---|
| 60 | |
|---|
| 61 | (the ``target_repo`` and ``src_repo`` settings are both names of |
|---|
| 62 | repository sections, not arbitrary filesystem paths). |
|---|
| 63 | |
|---|
| 64 | See Overlays_ for more information on ``src_repo``. |
|---|
| 65 | |
|---|
| 66 | Finally, you can define a different checkset per suite:: |
|---|
| 67 | |
|---|
| 68 | [pcheck-portdir-suite] |
|---|
| 69 | class=pkgcore_checks.base.Suite |
|---|
| 70 | target_repo=portdir |
|---|
| 71 | checkset=no-arch-checks |
|---|
| 72 | |
|---|
| 73 | This disables checks that are not interesting unless you can set |
|---|
| 74 | stable keywords for this suite. See Checksets_ for more information. |
|---|
| 75 | |
|---|
| 76 | Instead of relying on the working directory to pick the right suite |
|---|
| 77 | you can specify one explicitly with ``pcheck --suite``. |
|---|
| 78 | |
|---|
| 79 | Checksets |
|---|
| 80 | --------- |
|---|
| 81 | |
|---|
| 82 | By default ``pcheck`` runs all available checks. This is not always |
|---|
| 83 | desired. For example, checks about missing stable keywords are often |
|---|
| 84 | just noise in the output for ebuild devs. A checkset defines a subset |
|---|
| 85 | of checks to run. There are two kinds: one enabling a specific set of |
|---|
| 86 | checks and one running every available check except for the specified |
|---|
| 87 | ones. Examples:: |
|---|
| 88 | |
|---|
| 89 | [no-arch-checks] |
|---|
| 90 | class=pkgcore_checks.base.Blacklist |
|---|
| 91 | patterns=unstable_only stale_unstable imlate |
|---|
| 92 | |
|---|
| 93 | [only-arch-checks] |
|---|
| 94 | class=pkgcore_checks.base.Whitelist |
|---|
| 95 | patterns=unstable_only stale_unstable imlate |
|---|
| 96 | |
|---|
| 97 | The first disables the three specified checks, the second enables only |
|---|
| 98 | those three. For available names see ``pcheck --list-checks``. |
|---|
| 99 | |
|---|
| 100 | ``patterns`` is a whitespace-separated list. If the values are strings |
|---|
| 101 | they need to match a component of the name in ``--list-checks`` |
|---|
| 102 | exactly. If it looks like a regexp (currently defined as "contains a + |
|---|
| 103 | or \*") this needs to match the entire name. |
|---|
| 104 | |
|---|
| 105 | Checksets called ``no-arch-checks`` and ``all-checks`` are defined by |
|---|
| 106 | default. |
|---|
| 107 | |
|---|
| 108 | There are various ways to pick the checkset to use: ``pquery |
|---|
| 109 | --checkset``, the checkset setting of a suite and setting |
|---|
| 110 | ``default=true`` on a checkset in the configuration. |
|---|
| 111 | |
|---|
| 112 | Overlays |
|---|
| 113 | -------- |
|---|
| 114 | |
|---|
| 115 | Checking just an overlay does not work very well since pkgcore-checks |
|---|
| 116 | needs to know about profiles and checks if all dependencies are |
|---|
| 117 | available. To do this you will usually have to specify a base or |
|---|
| 118 | "source" repo to pull this data from. You can set this with ``pcheck |
|---|
| 119 | --overlayed-repo`` or the ``pcheck -o`` shorthand, or you can set it |
|---|
| 120 | in the configuration file as part of a suite__ definition. |
|---|
| 121 | |
|---|
| 122 | __ Suites_ |
|---|
| 123 | |
|---|
| 124 | Reporters |
|---|
| 125 | --------- |
|---|
| 126 | |
|---|
| 127 | By default the output is in a colorful human-readable format. For full |
|---|
| 128 | tree checks this format may not be optimal since it is a bit hard to |
|---|
| 129 | grep. To use an output format that prints everything on one line, put |
|---|
| 130 | this in your configuration:: |
|---|
| 131 | |
|---|
| 132 | [pcheck-plain-reporter] |
|---|
| 133 | class=pkgcore_checks.reporters.plain_reporter |
|---|
| 134 | default=true |
|---|
| 135 | |
|---|
| 136 | To use a non-default reporter use ``pcheck --reporter``. To see the |
|---|
| 137 | reporters available use ``pconfig configurables |
|---|
| 138 | pcheck_reporter_factory``. |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | .. _`Installing python modules`: http://docs.python.org/inst/ |
|---|