aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-02-24 20:07:25 +0100
committerGuido Günther <agx@sigxcpu.org>2009-02-26 13:48:28 +0100
commit6ccd4828f9296c6dcd95f50881d9c719e75716e3 (patch)
treebb82e7ad361879e1d4f197b3089172051cddd717
parent1e62d1a4775669f65d42d8724dad7947674f605b (diff)
make --export a config file option
-rw-r--r--gbp.conf1
-rw-r--r--gbp/config.py1
-rwxr-xr-xgit-buildpackage12
3 files changed, 8 insertions, 6 deletions
diff --git a/gbp.conf b/gbp.conf
index 5a0d6aa..7075e99 100644
--- a/gbp.conf
+++ b/gbp.conf
@@ -28,6 +28,7 @@
#export-dir = ../build-area/
#tarball-dir = ../tarballs/
#ignore-new = True
+#export = HEAD
# Options only affecting git-import-orig
[git-import-orig]
diff --git a/gbp/config.py b/gbp/config.py
index 2789e2a..cbacc9c 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -39,6 +39,7 @@ class GbpOptionParser(OptionParser):
'filter' : [],
'snapshot-number' : 'snapshot + 1',
'git-log' : '--no-merges',
+ 'export' : 'HEAD',
'export-dir' : '',
'tarball-dir' : '',
'ignore-new' : 'False',
diff --git a/git-buildpackage b/git-buildpackage
index 1761128..a8f2993 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -189,8 +189,8 @@ def main(argv):
help="hook run after a successful tag operation, default is '%(posttag)s'")
export_group.add_config_file_option(option_name="export-dir", dest="export_dir",
help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'")
- export_group.add_option("--git-export", dest="treeish", default=default_tree,
- help="export treeish object TREEISH, default is '%s'" % default_tree)
+ 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")
(options, args) = parser.parse_args(args)
@@ -238,16 +238,16 @@ def main(argv):
# Export to another build dir if requested:
if options.export_dir:
# write a tree of the index if necessary:
- if options.treeish == index_name:
+ if options.export == index_name:
tree = repo.write_tree()
- elif options.treeish == wc_name:
+ elif options.export == wc_name:
tree = write_wc(repo)
else:
- tree = options.treeish
+ tree = options.export
if not repo.has_treeish(tree):
raise GbpError # git-ls-tree printed an error message already
tmp_dir = os.path.join(output_dir, "%s-tmp" % cp['Source'])
- print "Exporting '%s' to '%s'" % (options.treeish, tmp_dir)
+ print "Exporting '%s' to '%s'" % (options.export, tmp_dir)
dump_tree(tmp_dir, tree)
cp = du.parse_changelog(os.path.join(tmp_dir, 'debian', 'changelog'))
if du.is_native(cp):