aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kastner <debian@kvr.at>2010-06-10 18:30:50 +0200
committerGuido G√ľnther <agx@sigxcpu.org>2010-06-19 16:06:03 +0200
commit2173157e8139855242b07605c266f0359a15205f (patch)
tree116896394069972607a6403e70a7a2003604aae5
parent5988e2087615a3eb218cbee7c6eb470b9df9be0c (diff)
Add option --git-force-create to force tarball creation
Closes: #519297
-rw-r--r--docs/manpages/git-buildpackage.sgml8
-rw-r--r--gbp/config.py1
-rwxr-xr-xgit-buildpackage6
3 files changed, 13 insertions, 2 deletions
diff --git a/docs/manpages/git-buildpackage.sgml b/docs/manpages/git-buildpackage.sgml
index a5cd159d..afb96629 100644
--- a/docs/manpages/git-buildpackage.sgml
+++ b/docs/manpages/git-buildpackage.sgml
@@ -32,6 +32,7 @@
<arg><option>--git-posttag=</option><replaceable>command</replaceable></arg>
<arg><option>--git-postbuild=</option><replaceable>command</replaceable></arg>
<arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--git-force-create</option></arg>
<arg><option>--git-no-create-orig</option></arg>
<arg><option>--git-tarball-dir=</option><replaceable>directory</replaceable></arg>
<arg><option>--git-compression=</option><replaceable>type</replaceable></arg>
@@ -200,6 +201,13 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--git-force-create</option>
+ </term>
+ <listitem>
+ <para>Force creation of an orig.tar.gz (overwriting a pre-existing one if present)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--git-no-create-orig</option>
</term>
<listitem>
diff --git a/gbp/config.py b/gbp/config.py
index d2aa97b4..0c57f3c2 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -32,6 +32,7 @@ class GbpOptionParser(OptionParser):
'pristine-tar' : 'False',
'filter-pristine-tar' : 'False',
'sign-tags' : 'False',
+ 'force-create' : 'False',
'no-create-orig' : 'False',
'keyid' : '',
'posttag' : '',
diff --git a/git-buildpackage b/git-buildpackage
index 7fd9d468..d5c3ce8c 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -218,6 +218,8 @@ def main(argv):
tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ orig_group.add_config_file_option(option_name="force-create", dest="force_create",
+ help="force creation of orig.tar.gz", action="store_true")
orig_group.add_config_file_option(option_name="no-create-orig", dest="no_create_orig",
help="don't create orig.tar.gz", action="store_true")
orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir",
@@ -313,8 +315,8 @@ def main(argv):
print "Orig tarball '%s' not found at '%s'" % (orig_file, tarball_dir)
else:
print "Orig tarball '%s' found at '%s'" % (orig_file, tarball_dir)
- # build an orig unless the user forbidds it
- if not options.no_create_orig and not du.has_orig(cp, options.comp_type, output_dir):
+ # build an orig unless the user forbids it, always build (and overwrite pre-existing) if user forces it
+ if options.force_create or (not options.no_create_orig and not du.has_orig(cp, options.comp_type, output_dir)):
if not pristine_tar_build_orig(repo, cp, output_dir, options):
git_archive_build_orig(repo, cp, output_dir, options)