From: Guido Günther Date: Tue, 24 Feb 2009 19:07:25 +0000 (+0100) Subject: make --export a config file option X-Git-Tag: debian/0.4.49~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ccd4828f9296c6dcd95f50881d9c719e75716e3;p=tools%2Fgit-buildpackage.git make --export a config file option --- diff --git a/gbp.conf b/gbp.conf index 5a0d6aa7..7075e99c 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 2789e2a3..cbacc9cb 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 1761128f..a8f2993a 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):