@@ -19,6 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
+import json
import os
import shutil
import re
@@ -96,12 +97,28 @@ def _get_changelog(pn, workdir):
return None
+def _changelog_skip(pn):
+ """Return True if devtool flagged the changelog of pn as badly formed
+ for a commit message (RECIPE_UPGRADE_CHANGELOG_SKIP in oe-core)."""
+ metadata_path = os.path.join(os.environ.get('BUILDDIR', ''),
+ 'workspace', 'changelogs', '{}.json'.format(pn))
+ try:
+ with open(metadata_path, 'r', encoding='utf-8') as f:
+ return bool(json.load(f).get('changelog_skip', False))
+ except (OSError, ValueError):
+ return False
+
+
def _append_changelog_to_commit_msg(group, opts):
max_len = int(opts['changelog_max_len'])
seen = set()
for p in group['pkgs']:
if 'changelog_text' not in p:
continue
+ # Changelog stays attached to the email, only the commit message skips it
+ if p.get('changelog_skip'):
+ I(" %s: changelog not added to commit message (RECIPE_UPGRADE_CHANGELOG_SKIP)" % p['PN'])
+ continue
text = p['changelog_text'].strip()
# Group recipes may share a source and produce identical changelogs
# (e.g. mesa, mesa-native); skip proven duplicates, keep the rest.
@@ -122,6 +139,7 @@ def _devtool_upgrade(devtool, bb, git, opts, pkg_ctx, workdir):
changelog_text = _get_changelog(pkg_ctx['PN'], workdir)
if changelog_text:
pkg_ctx['changelog_text'] = changelog_text
+ pkg_ctx['changelog_skip'] = _changelog_skip(pkg_ctx['PN'])
# If devtool failed to rebase patches, it does not fail, but we should
if 'conflict' in devtool_output:
raise DevtoolError("Running 'devtool upgrade' for recipe %s failed." %(pkg_ctx['PN']), devtool_output)