summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-11 10:18:47 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:47:20 +0200
commitc977df22678e9bb220afa86bbc5edcbf39acb048 (patch)
tree306fbbe15aba45de127be29ff99433da9ef846ab /gbp
parent0342b355586da7f21f9858cc3eb59f7aee0de3dd (diff)
downloadgit-buildpackage-c977df22678e9bb220afa86bbc5edcbf39acb048.tar.gz
git-buildpackage-c977df22678e9bb220afa86bbc5edcbf39acb048.tar.bz2
git-buildpackage-c977df22678e9bb220afa86bbc5edcbf39acb048.zip
pq-rpm: implement --new-packaging-dir cmdline option
Used for setting the packaging directory to be used in the new orphan packaging branch. Defaults to --packaging-dir so that the gbp.conf files are more likely to work without modification. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rwxr-xr-xgbp/scripts/pq_rpm.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py
index 6c07c725..7ee407dc 100755
--- a/gbp/scripts/pq_rpm.py
+++ b/gbp/scripts/pq_rpm.py
@@ -522,7 +522,8 @@ def convert_package(repo, options):
(old_packaging, new_branch))
packaging_tree = '%s:%s' % (old_packaging, options.packaging_dir)
packaging_tmp = tempfile.mkdtemp(prefix='pack_', dir=options.tmp_dir)
- dump_tree(repo, packaging_tmp, packaging_tree, with_submodules=False,
+ dump_packaging_dir = os.path.join(packaging_tmp, options.new_packaging_dir)
+ dump_tree(repo, dump_packaging_dir, packaging_tree, with_submodules=False,
recursive=False)
msg = "Auto-import packaging files from branch '%s'" % old_packaging
@@ -530,9 +531,10 @@ def convert_package(repo, options):
repo.set_branch(new_branch)
# Generate patches
- spec = SpecFile(spec.specfile)
+ spec = SpecFile(os.path.join(options.new_packaging_dir, spec.specfile))
patches = update_patch_series(repo, spec, upstream_commit, old_packaging,
options)
+ patches = [os.path.join(options.new_packaging_dir, pat) for pat in patches]
# Commit paches and spec
if patches:
@@ -588,6 +590,10 @@ def main(argv):
parser.add_config_file_option(option_name="spec-file", dest="spec_file")
parser.add_config_file_option(option_name="packaging-dir",
dest="packaging_dir")
+ parser.add_option("--new-packaging-dir",
+ help="Packaging directory in the new packaging branch. Only "
+ "relevant for the 'convert' action. If not defined, defaults "
+ "to '--packaging-dir'")
parser.add_config_file_option(option_name="packaging-branch",
dest="packaging_branch",
help="Branch the packaging is being maintained on. Only relevant "
@@ -612,6 +618,8 @@ def main(argv):
(options, args) = parser.parse_args(argv)
gbp.log.setup(options.color, options.verbose, options.color_scheme)
options.patch_export_compress = string_to_int(options.patch_export_compress)
+ if options.new_packaging_dir is None:
+ options.new_packaging_dir = options.packaging_dir
if len(args) < 2:
gbp.log.err("No action given.")