Add --no-patch-export options for export/build module, #594
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 8 Jan 2013 07:27:03 +0000 (15:27 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 8 Jan 2013 07:54:01 +0000 (15:54 +0800)
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
gitbuildsys/cmd_export.py
tools/gbs

index 401f49b..47cbcdd 100644 (file)
@@ -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]
index 3305589..d377001 100644 (file)
@@ -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:
index 83af6e5..4ad040e 100755 (executable)
--- 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',