From: Markus Lehtonen Date: Tue, 15 Jul 2014 11:54:44 +0000 (+0300) Subject: buildpackage-rpm: add '--git-native' option X-Git-Tag: tizen/0.6.22-20150206~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13dbee0f3a8a4dc52de5709f22f51f782a1b7e95;p=tools%2Fgit-buildpackage.git buildpackage-rpm: add '--git-native' option Can be used to explicitly configure a package as native or non-native. Default behavior is still to guess based on the existence of upstream branch. Signed-off-by: Markus Lehtonen --- diff --git a/gbp/config.py b/gbp/config.py index 983c5ef..dd0c631 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -604,6 +604,7 @@ class GbpOptionParserRpm(GbpOptionParser): 'builder' : 'rpmbuild', 'cleaner' : '/bin/true', 'export-dir' : '../rpmbuild', + 'native' : 'auto', 'ignore-untracked' : 'False', 'rpmbuild-builddir' : 'BUILD', 'rpmbuild-rpmdir' : 'RPMS', @@ -655,6 +656,8 @@ class GbpOptionParserRpm(GbpOptionParser): "Spec file to use, 'auto' makes gbp to guess, other values " "make the packaging-dir option to be ignored, default is " "'%(spec-file)s'", + 'native': + "Treat this package as native, default is '%(native)s'", 'ignore-untracked': "build with untracked files in the source tree, default is " "'%(ignore-untracked)s'", diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py index d9abb80..fdde2db 100755 --- a/gbp/scripts/buildpackage_rpm.py +++ b/gbp/scripts/buildpackage_rpm.py @@ -298,9 +298,9 @@ def export_patches(repo, spec, export_treeish, options): def is_native(repo, options): """Determine whether a package is native or non-native""" - if repo.has_branch(options.upstream_branch): - return False - return True + if options.native.is_auto(): + return not repo.has_branch(options.upstream_branch) + return options.native.is_on() def setup_builder(options, builder_args): @@ -416,6 +416,8 @@ def parse_args(argv, prefix, git_treeish=None): dest="color_scheme") parser.add_config_file_option(option_name="notify", dest="notify", type='tristate') parser.add_config_file_option(option_name="vendor", action="store", dest="vendor") + parser.add_config_file_option(option_name="native", dest="native", + type='tristate') tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False, help="create a tag after a successful build") tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,