aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/chapters/building.sgml2
-rw-r--r--docs/chapters/cfgfile.sgml8
-rw-r--r--docs/chapters/import.sgml2
-rw-r--r--docs/chapters/releases.sgml1
-rw-r--r--docs/chapters/special.sgml4
-rw-r--r--docs/manpages/gbp-clone.sgml5
-rw-r--r--docs/manpages/gbp-create-remote-repo.sgml3
-rw-r--r--docs/manpages/gbp-pull.sgml2
-rw-r--r--docs/manpages/git-buildpackage.sgml9
-rwxr-xr-xexamples/gbp-add-patch4
-rw-r--r--gbp/config.py15
-rwxr-xr-xgbp/scripts/buildpackage.py4
-rw-r--r--gbp/scripts/create_remote_repo.py6
-rw-r--r--gbp/scripts/dch.py6
-rw-r--r--gbp/scripts/import_dsc.py6
-rw-r--r--gbp/scripts/import_orig.py6
-rwxr-xr-x[-rw-r--r--]gbp/scripts/pq.py6
-rw-r--r--tests/01_test_help.py2
-rw-r--r--tests/test_Config.py59
19 files changed, 116 insertions, 34 deletions
diff --git a/docs/chapters/building.sgml b/docs/chapters/building.sgml
index 9bab07a..1d95faf 100644
--- a/docs/chapters/building.sgml
+++ b/docs/chapters/building.sgml
@@ -9,6 +9,7 @@
During the development phase (when you're either not on the
<emphasis>debian-branch</emphasis> or when you have uncommitted changes in
your repository) you'll usually use:
+ </para>
<screen>
&git-buildpackage; <option>--git-ignore-new</option>
</screen>
@@ -96,6 +97,7 @@ export-dir=../build-area
<option>postbuild</option>=<replaceable>lintian $GBP_CHANGES_FILE</replaceable>
</programlisting>
to your <filename>.gbp.conf</filename>.
+ </para>
</sect2>
<sect2 id="gbp.building.push">
<title>Pushing into a remote repository</title>
diff --git a/docs/chapters/cfgfile.sgml b/docs/chapters/cfgfile.sgml
index d69ebef..d7c7a0d 100644
--- a/docs/chapters/cfgfile.sgml
+++ b/docs/chapters/cfgfile.sgml
@@ -33,22 +33,22 @@
<varlistentry>
<term>[git-buildpackage]</term>
<listitem><para>Options in this section apply to &git-buildpackage; only and override options from the
- [DEFAULT] section.</listitem>
+ [DEFAULT] section.</para></listitem>
</varlistentry>
<varlistentry>
<term>[git-import-orig]</term>
<listitem><para>Options in this section apply to &git-import-orig; only and override options from the
- [DEFAULT] section.</listitem>
+ [DEFAULT] section.</para></listitem>
</varlistentry>
<varlistentry>
<term>[git-import-dsc]</term>
<listitem><para>Options in this section apply to &git-import-dsc; only and override options from the
- [DEFAULT] section.</listitem>
+ [DEFAULT] section.</para></listitem>
</varlistentry>
<varlistentry>
<term>[git-dch]</term>
<listitem><para>Options in this section apply to &git-dch; only and override options from the
- [DEFAULT] section.</listitem>
+ [DEFAULT] section.</para></listitem>
</varlistentry>
</variablelist>
The actual options in these sections are the command line options without
diff --git a/docs/chapters/import.sgml b/docs/chapters/import.sgml
index c4a5f1f..54d23b8 100644
--- a/docs/chapters/import.sgml
+++ b/docs/chapters/import.sgml
@@ -88,6 +88,7 @@ by version number.
<para>
If the &git; repository wasn't created with &git-import-dsc; you have to tell
&git-buildpackage; and friends where to find the upstream sources.
+ </para>
<sect2>
<title>Upstream sources on a branch</title>
<para>
@@ -176,5 +177,6 @@ EOF
<command>dh_make</command>
</screen>
That's it, you're done. If you want to publish you're new repository you can use &gbp-create-remote-repo;.
+ </para>
</sect1>
</chapter>
diff --git a/docs/chapters/releases.sgml b/docs/chapters/releases.sgml
index 95f89b4..9d3bf74 100644
--- a/docs/chapters/releases.sgml
+++ b/docs/chapters/releases.sgml
@@ -21,6 +21,7 @@
<option>--release</option>.</para>
<para>
But what if you want to have an (unreleased) snapshot for intermediate testing:
+ </para>
<screen>
&git-dch; <option>--snapshot</option>
</screen>
diff --git a/docs/chapters/special.sgml b/docs/chapters/special.sgml
index cf34904..653f0ae 100644
--- a/docs/chapters/special.sgml
+++ b/docs/chapters/special.sgml
@@ -4,6 +4,7 @@
<title>Handling non-DFSG clean upstream sources</title>
<para>If you have to handle non DFSG clean upstream sources you can use a
different branch which you have to create once:
+ </para>
<screen>
&gitcmd; branch dfsg_clean upstream
</screen>
@@ -37,6 +38,7 @@ cleanup-script.sh
&gitcmd; checkout <replaceable>master</replaceable>
&gitcmd; pull <replaceable>.</replaceable> <replaceable>dfsg_clean</replaceable>
</screen>
+ </sect1>
<sect1 id="gbp.special.nmus">
<title>Importing NMUs</title>
@@ -108,6 +110,7 @@ builder = /usr/bin/git-pbuilder
one of your &git; repositories instead of
<filename>~/.gbp.conf</filename>.
</para>
+ </sect1>
<sect1 id="gbp.special.hacking">
<title>Working on random packages</title>
@@ -119,6 +122,7 @@ git-import-dsc --download <filename>package</filename>
cd <filename>package</filename>
git-branch debian
</programlisting>
+ </para>
<para>
This uses <command>apt-get</command> to download the source package,
puts the orig tarball on the <option>upstream-branch</option> and the
diff --git a/docs/manpages/gbp-clone.sgml b/docs/manpages/gbp-clone.sgml
index f4be976..31c2fed 100644
--- a/docs/manpages/gbp-clone.sgml
+++ b/docs/manpages/gbp-clone.sgml
@@ -48,7 +48,7 @@
</term>
<listitem>
<para>Track all branches, not only <replaceable>debian</replaceable>
- and <replaceable>upstream</replaceable>.
+ and <replaceable>upstream</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -56,7 +56,7 @@
</term>
<listitem>
<para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.
+ developed on, default is <replaceable>master</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -89,6 +89,7 @@
</listitem>
</varlistentry>
</variablelist>
+ </refsect1>
<refsect1>
&man.git.config-files;
</refsect1>
diff --git a/docs/manpages/gbp-create-remote-repo.sgml b/docs/manpages/gbp-create-remote-repo.sgml
index 782d70b..5e59511 100644
--- a/docs/manpages/gbp-create-remote-repo.sgml
+++ b/docs/manpages/gbp-create-remote-repo.sgml
@@ -72,7 +72,7 @@
</term>
<listitem>
<para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.
+ developed on, default is <replaceable>master</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -113,6 +113,7 @@
</listitem>
</varlistentry>
</variablelist>
+ </refsect1>
<refsect1>
&man.git.config-files;
</refsect1>
diff --git a/docs/manpages/gbp-pull.sgml b/docs/manpages/gbp-pull.sgml
index b8dcde4..44d667e 100644
--- a/docs/manpages/gbp-pull.sgml
+++ b/docs/manpages/gbp-pull.sgml
@@ -63,7 +63,7 @@
</term>
<listitem>
<para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.
+ developed on, default is <replaceable>master</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/docs/manpages/git-buildpackage.sgml b/docs/manpages/git-buildpackage.sgml
index 2dbe85b..4a452ce 100644
--- a/docs/manpages/git-buildpackage.sgml
+++ b/docs/manpages/git-buildpackage.sgml
@@ -108,7 +108,7 @@
<listitem>
<para>Don't abort if there are uncommitted changes in the source tree
or the current branch doesn't match the
- <replaceable>debian-branch</replaceable>.
+ <replaceable>debian-branch</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -160,7 +160,7 @@
<listitem>
<para>Build for architecture <replaceable>ARCH</replaceable> when
using <command>--git-pbuilder</command>. If unset no architecture is
- passed to <command>git-pbuilder</command>.
+ passed to <command>git-pbuilder</command>.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -169,7 +169,7 @@
<para>Whether to try to autoconfigure
<command>git-pbuilder</command> or to rely on the settings in
.pbuilderrc. See the <command>git-pbuilder</command>
- manpage for details.</listitem>
+ manpage for details.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--git-pbuilder-options</option></term>
@@ -284,8 +284,9 @@
or the application specified via <option>--git-builder</option>.</para>
<para>Exported environment variables are:
<envar>GBP_GIT_DIR</envar> (the repository the package is being built from),
- <envar>GBP_BUILD_DIR</envar> (the build dir).
+ <envar>GBP_BUILD_DIR</envar> (the build dir).</para>
</listitem>
+ </varlistentry>
<varlistentry>
<term><option>--git-debian-tag=</option><replaceable>tag-format</replaceable>
</term>
diff --git a/examples/gbp-add-patch b/examples/gbp-add-patch
index 5a974cd..6af6bc4 100755
--- a/examples/gbp-add-patch
+++ b/examples/gbp-add-patch
@@ -38,7 +38,7 @@ import os, os.path
from gbp.command_wrappers import (Command,
CommandExecFailed,
GitCommand)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import (GitRepositoryError, GitRepository)
from gbp.patch_series import Patch
@@ -70,7 +70,7 @@ def build_commit_msg(repo, patch, options):
def main(argv):
retval = 0
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
usage='%prog [options] - add a new patch')
parser.add_config_file_option(option_name="meta-closes", dest="meta_closes",
help="Meta tags for the bts close commands, default is '%(meta-closes)s'")
diff --git a/gbp/config.py b/gbp/config.py
index e857b3e..090c4f7 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -68,9 +68,7 @@ class GbpOptionParser(OptionParser):
@cvar config_files: list of config files we parse
@type config_files: list
"""
- defaults = { 'builder' : 'debuild -i -I',
- 'cleaner' : 'debuild -d clean',
- 'debian-branch' : 'master',
+ defaults = { 'debian-branch' : 'master',
'upstream-branch' : 'upstream',
'upstream-tree' : 'TAG',
'pristine-tar' : 'False',
@@ -327,4 +325,15 @@ class GbpOptionGroup(OptionGroup):
neg_help = "negates '--%s%s'" % (self.parser.prefix, option_name)
self.add_config_file_option(option_name="no-%s" % option_name, dest=dest, help=neg_help, action="store_false")
+
+class GbpOptionParserDebian(GbpOptionParser):
+ """
+ Handles commandline options and parsing of config files for Debian tools
+ """
+ defaults = dict(GbpOptionParser.defaults)
+ defaults.update( {
+ 'builder' : 'debuild -i -I',
+ 'cleaner' : 'debuild -d clean',
+ } )
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 327c398..3fd6917 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -29,7 +29,7 @@ import gbp.deb as du
from gbp.command_wrappers import (Command,
RunAtCommand, CommandExecFailed,
RemoveTree, CatenateTarArchive)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
from gbp.deb.changelog import ChangeLog, NoChangeLogError, ParseChangeLogError
from gbp.errors import GbpError
@@ -465,7 +465,7 @@ def parse_args(argv, prefix):
args.append(arg)
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix=prefix)
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix=prefix)
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None, None
diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py
index d00963c..d6174e3 100644
--- a/gbp/scripts/create_remote_repo.py
+++ b/gbp/scripts/create_remote_repo.py
@@ -28,7 +28,7 @@ import tty, termios
import re
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.command_wrappers import (CommandExecFailed, GitCommand)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import (GitRepositoryError, GitRepository)
import gbp.log
@@ -146,8 +146,8 @@ def main(argv):
retval = 0
changelog = 'debian/changelog'
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] - create a remote repository')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] - create a remote repository')
branch_group = GbpOptionGroup(parser, "branch options", "branch layout and tracking options")
branch_group.add_config_file_option(option_name="remote-url-pattern", dest="remote_url")
parser.add_option_group(branch_group)
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py
index 2ee988d..3a4a02a 100644
--- a/gbp/scripts/dch.py
+++ b/gbp/scripts/dch.py
@@ -26,7 +26,7 @@ import subprocess
import gbp.command_wrappers as gbpc
import gbp.dch as dch
import gbp.log
-from gbp.config import GbpOptionParser, GbpOptionGroup
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup
from gbp.errors import GbpError
from gbp.deb import compare_versions
from gbp.deb.git import GitRepositoryError, DebianGitRepository
@@ -332,8 +332,8 @@ def main(argv):
version_change = {}
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] paths')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] paths')
except ConfigParser.ParsingError, err:
gbp.log.errror(err)
return 1
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index 6aed3c2..c5093fc 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -32,7 +32,7 @@ from gbp.deb import (debian_version_chars,
from gbp.deb.git import (DebianGitRepository, GitRepositoryError)
from gbp.deb.changelog import ChangeLog
from gbp.git import rfc822_date_to_git
-from gbp.config import GbpOptionParser, GbpOptionGroup, no_upstream_branch_msg
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import GbpError
import gbp.log
@@ -160,8 +160,8 @@ def set_bare_repo_options(options):
def parse_args(argv):
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] /path/to/package.dsc')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] /path/to/package.dsc')
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 0446fda..6693acd 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -32,7 +32,7 @@ from gbp.deb import (UpstreamSource,
upstreamversion_msg)
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
-from gbp.config import GbpOptionParser, GbpOptionGroup, no_upstream_branch_msg
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import (GbpError, GbpNothingImported)
import gbp.log
@@ -269,8 +269,8 @@ def set_bare_repo_options(options):
def parse_args(argv):
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py
index 7fa57cf..ec9ae6d 100644..100755
--- a/gbp/scripts/pq.py
+++ b/gbp/scripts/pq.py
@@ -24,7 +24,7 @@ import shutil
import subprocess
import sys
import tempfile
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.git import (GitRepositoryError, GitRepository)
from gbp.command_wrappers import (Command, GitCommand, RunAtCommand,
CommandExecFailed)
@@ -337,8 +337,8 @@ def switch_pq(repo, current):
def main(argv):
retval = 0
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage="%prog [options] action - maintain patches on a patch queue branch\n"
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage="%prog [options] action - maintain patches on a patch queue branch\n"
"Actions:\n"
" export export the patch queue associated to the current branch\n"
" into a quilt patch series in debian/patches/ and update the\n"
diff --git a/tests/01_test_help.py b/tests/01_test_help.py
index cee7911..1974c30 100644
--- a/tests/01_test_help.py
+++ b/tests/01_test_help.py
@@ -7,6 +7,8 @@ import unittest
class TestHelp(unittest.TestCase):
"""Test help output of gbp commands"""
+ os.environ['PYTHONPATH'] = '.'
+
def testHelp(self):
for prog in [ "buildpackage", "import-orig", "import-dsc", "dch" ]:
ret = os.system("bin/git-%s --help >/dev/null" % prog)
diff --git a/tests/test_Config.py b/tests/test_Config.py
new file mode 100644
index 0000000..7d4ba34
--- /dev/null
+++ b/tests/test_Config.py
@@ -0,0 +1,59 @@
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.config.GbpOptionParser}
+Test L{gbp.config.GbpOptionParserDebian}
+"""
+
+def test_option_parser():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParser.add_config_file_option}
+ - L{gbp.config.GbpOptionParser.add_boolean_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('common', prefix='test')
+ >>> c.add_config_file_option(option_name='upstream-branch', dest='upstream')
+ >>> c.add_boolean_config_file_option(option_name='overlay', dest='overlay')
+ >>> c.add_boolean_config_file_option(option_name='track', dest='track')
+ """
+
+def test_option_parser_debian():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParserDebian.add_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParserDebian('debian')
+ >>> c.add_config_file_option(option_name='builder', dest='builder')
+ Traceback (most recent call last):
+ ...
+ KeyError: 'builder'
+ >>> c.add_config_file_option(option_name='builder', dest='builder', help='foo')
+ """
+
+def test_option_group():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionGroup.add_config_file_option}
+ - L{gbp.config.GbpOptionGroup.add_boolean_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('debian')
+ >>> g = gbp.config.GbpOptionGroup(c, 'wheezy')
+ >>> g.add_config_file_option(option_name='debian-branch', dest='branch')
+ >>> g.add_boolean_config_file_option(option_name='track', dest='track')
+ """
+
+def test_tristate():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParser.add_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('tristate')
+ >>> c.add_config_file_option(option_name="color", dest="color", type='tristate')
+ >>> options, args= c.parse_args(['--color=auto'])
+ >>> options.color
+ auto
+ """