summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-03-22 18:14:33 +0100
committerGuido Günther <agx@sigxcpu.org>2013-03-22 18:34:01 +0100
commitfc9d019eb9af759c46a7a183d69e248275afe6bc (patch)
tree718a9db57828712f7c60478687c4c5266681dbf1
parenteb999f77c3cd4fa806eea54ae82e6b9079b207c8 (diff)
downloadgit-buildpackage-fc9d019eb9af759c46a7a183d69e248275afe6bc.tar.gz
git-buildpackage-fc9d019eb9af759c46a7a183d69e248275afe6bc.tar.bz2
git-buildpackage-fc9d019eb9af759c46a7a183d69e248275afe6bc.zip
Purging of the build dir should be configurable via a config file
so introdice --git[-no]-purge which is consistent with the other boolean options and deprecate --git-dont-purge. Closes: #702200
-rw-r--r--docs/chapters/building.sgml2
-rw-r--r--docs/manpages/git-buildpackage.sgml10
-rw-r--r--gbp/config.py5
-rwxr-xr-xgbp/scripts/buildpackage.py12
4 files changed, 23 insertions, 6 deletions
diff --git a/docs/chapters/building.sgml b/docs/chapters/building.sgml
index 5005416a..159f476c 100644
--- a/docs/chapters/building.sgml
+++ b/docs/chapters/building.sgml
@@ -68,7 +68,7 @@ export-dir=../build-area
#export-dir=/home/debian-packages/build-area
</programlisting>
&git-buildpackage; will cleanup the build-area after a successful build. If
- you want to keep the build tree use <replaceable>--git-dont-purge</replaceable>.
+ you want to keep the build tree use <replaceable>--git-no-purge</replaceable>.
</para>
</sect1>
<sect1 id="gbp.building.hooks">
diff --git a/docs/manpages/git-buildpackage.sgml b/docs/manpages/git-buildpackage.sgml
index 3e640d42..d528f3d4 100644
--- a/docs/manpages/git-buildpackage.sgml
+++ b/docs/manpages/git-buildpackage.sgml
@@ -53,6 +53,7 @@
<arg><option>--git-export=</option><replaceable>treeish</replaceable></arg>
<arg><option>--git-[no-]pristine-tar</option></arg>
<arg><option>--git-[no-]pristine-tar-commit</option></arg>
+ <arg><option>--git-[no-]-purge</option></arg>
<arg><option>--git-dont-purge</option></arg>
<arg><option>--git-tag-only</option></arg>
<arg><option>--git-retag</option></arg>
@@ -390,10 +391,17 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--git[-no]-purge</option>
+ </term>
+ <listitem>
+ <para>Purge (remove) temporary build directory after build</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--git-dont-purge</option>
</term>
<listitem>
- <para>retain exported build directory after build</para>
+ <para>Deprecated, use --git-no-purge instead.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/gbp/config.py b/gbp/config.py
index cec593b6..ec75765a 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -131,6 +131,7 @@ class GbpOptionParser(OptionParser):
'remote-config': '',
'allow-unauthenticated': 'False',
'symlink-orig': 'True',
+ 'purge': 'True',
}
help = {
'debian-branch':
@@ -262,7 +263,9 @@ class GbpOptionParser(OptionParser):
'symlink-orig':
("Whether to creat a symlink from the upstream tarball "
"to the orig.tar.gz if needed, default is "
- "'%(symlink-orig)s'")
+ "'%(symlink-orig)s'"),
+ 'purge':
+ "Purge exported package build directory. Default is '%(purge)s'",
}
def_config_files = [ '/etc/git-buildpackage/gbp.conf',
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 09d40829..c021b866 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2006-2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006-2013 Guido Günther <agx@sigxcpu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -425,8 +425,9 @@ def parse_args(argv, prefix):
help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'")
export_group.add_config_file_option("export", dest="export",
help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH")
- export_group.add_option("--git-dont-purge", action="store_false", dest="purge", default=True,
- help="retain exported package build directory")
+ export_group.add_boolean_config_file_option(option_name="purge", dest="purge")
+ export_group.add_option("--git-dont-purge", action="store_true", dest="dont_purge", default=False,
+ help="deprecated, use --git-no-purge instead")
export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay")
options, args = parser.parse_args(args)
@@ -440,6 +441,11 @@ def parse_args(argv, prefix):
gbp.log.err("Overlay must be used with --git-export-dir")
return None, None, None
+ # --git-dont-purge is deprecated:
+ if options.dont_purge:
+ gbp.log.warning("--git-dont-purge is depreceted, use --git-no-purge instead")
+ options.purge = False
+
return options, args, dpkg_args