From 9ec10051594b916a5c5ebc3d1ace0fcab23d11c0 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Tue, 8 Jan 2013 15:27:03 +0800 Subject: [PATCH] Add --no-patch-export options for export/build module, #594 with --no-patch-export, gbs does not create patches between upstream and export-treeish, and and create tar ball from the export-treeish instead of upstream branch Change-Id: Iabad13eb75c425a104f20f507ae265801ab6aa3b --- gitbuildsys/cmd_build.py | 2 ++ gitbuildsys/cmd_export.py | 2 +- tools/gbs | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index 401f49b..47cbcdd 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -295,6 +295,8 @@ def main(args): cmd += ['--upstream-tag=%s' % args.upstream_tag] if args.squash_patches_until: cmd += ['--squash-patches-until=%s' % args.squash_patches_until] + if args.no_patch_export: + cmd += ['--no-patch-export'] if args.define: cmd += [('--define="%s"' % i) for i in args.define] diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index 3305589..d377001 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -152,7 +152,7 @@ def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, args, if args.debug: argv.append("--git-verbose") - if force_native or is_native_pkg(repo, args): + if force_native or is_native_pkg(repo, args) or args.no_patch_export: argv.extend(["--git-no-patch-export", "--git-upstream-tree=%s" % commit]) else: diff --git a/tools/gbs b/tools/gbs index 83af6e5..4ad040e 100755 --- a/tools/gbs +++ b/tools/gbs @@ -97,6 +97,10 @@ def export_parser(parser): 'would be included while generating tar ball') parser.add_argument('--source-rpm', action='store_true', help='generate source rpm') + parser.add_argument('--no-patch-export', action='store_true', + help='don\'t create patches between upstream and ' + 'export-treeish, and create tar ball from the ' + 'export-treeish instead of upstream branch') parser.add_argument('--upstream-branch', help='upstream branch') parser.add_argument('--upstream-tag', help="upstream tag format, '${upstreamversion}' is " @@ -187,6 +191,10 @@ def build_parser(parser): 'to given commit-ish into one monolithic diff file. ' 'Format is the commit-ish optionally followed by a ' 'colon and diff filename base.') + group.add_argument('--no-patch-export', action='store_true', + help='don\'t create patches between upstream and ' + 'export-treeish, and create tar ball from the ' + 'export-treeish instead of upstream branch') group = parser.add_argument_group('incremental build options') group.add_argument('--incremental', action='store_true', -- 2.7.4