From 68fbe062ec284aa39c8aca1884ad637e1e9f6755 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 8 Oct 2014 17:07:33 +0300 Subject: [PATCH] Implement 'native' config option Add new 'native' configuration file option. The new option explicitly sets the "nativity" of the package and no guessing based on existing branches is done. It is recommended to have this option set in the package-specific (i.e. committed in the Git tree) .gbs.conf for every package. In the config file, values 'yes', 'on', '1', 'true' and 'enabled' are interpreted as True, all other non-empty values are interpreted as False. Change-Id: Ie7474c04287124fd928e7b8b43d64392dc68ca3c Signed-off-by: Markus Lehtonen --- gitbuildsys/cmd_export.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index e2fbc90..6b6112e 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -61,6 +61,10 @@ def is_native_pkg(repo, args): """ Determine if the package is "native" """ + forced = configmgr.get_optional_item('general', 'native') + if forced is not None: + return config_is_true(forced) + upstream_branch = configmgr.get_arg_conf(args, 'upstream_branch') return not repo.has_branch(upstream_branch) @@ -157,9 +161,9 @@ 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) or args.no_patch_export: - argv.extend(["--git-no-patch-export", - "--git-upstream-tree=%s" % commit]) + argv.append('--git-native=on') else: + argv.append('--git-native=off') # Check if the revision seems to be of an orphan development branch is_orphan = False export_commitish = 'HEAD' if commit == 'WC.UNTRACKED' else commit -- 2.34.1