From: wanchao-xu Date: Fri, 13 Oct 2023 01:43:36 +0000 (+0800) Subject: Fix the gbs export doesn't generate patches when packaging non-native package. X-Git-Tag: accepted/tools/devbase/tools/20250527.103741~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdf38d8023f89ef48d75ed3cb4430e09e0f447d4;p=tools%2Fgbs.git Fix the gbs export doesn't generate patches when packaging non-native package. Reason: The packages can be divided into 2 categories: native packages and non-native (or upstream) packages. Please refer to https://docs.tizen.org/platform/reference/gbs/gbs-maintenance-models/. If the package has export branch and upstream branch, but the export branch is not based on upstream, gbs will export this package as no-native without auto-generate patches. Solution: Export the package as native package if the export branch is not based on upstream. Change-Id: I16f12acc9ab2111f8f5b2e966bbf6b4d56ae5086 Signed-off-by: wanchao-xu --- diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index 43245ac..37e9bd6 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -163,18 +163,18 @@ def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, args, if force_native or is_native_pkg(repo, args) or args.no_patch_export: 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 try: repo.get_merge_base(export_commitish, upstream_branch) except GitRepositoryError: - is_orphan = True - # Development branch in orphan packaging model is identified in the conf - orphan_packaging = configmgr.get('packaging_branch', 'orphan-devel') - - if not is_orphan: + log.warn("No common ancestor between export commit and upstream, " + "enable native packaging mode") + argv.append('--git-native=on') + else: + argv.append('--git-native=off') + # Development branch in orphan packaging model is identified in the conf + orphan_packaging = configmgr.get('packaging_branch', 'orphan-devel') argv.extend(["--git-patch-export", "--git-patch-export-compress=100k", "--git-patch-export-squash-until=%s" % @@ -187,8 +187,8 @@ def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, args, export_rev = orphan_packaging argv.extend(["--git-patch-export-rev=%s" % commit]) - if repo.has_branch("pristine-tar"): - argv.extend(["--git-pristine-tar"]) + if repo.has_branch("pristine-tar"): + argv.extend(["--git-pristine-tar"]) argv.append("--git-export=%s" % export_rev)