From c7d27f5b89185589451656fdd1f7637d5a5f76b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= Date: Tue, 30 Sep 2025 11:10:48 +0200 Subject: [PATCH] umpf: preserve flags between utags and umerges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While tags are correctly stored and loaded via useries files, the same is not entirely the case for utags and umerges: 1. utags are correctly annotated with '# umpf-flags: flag=val'. But when running a build command from such a utag, the flag is not parsed. Add the appropriate build namespace parser function. 2. Flags are correctly parsed from umerges, but only if they are annotated correctly via git-notes. An incorrect bashism assumes the flags are stored in a file as opposed to a variable, breaking the annotation. Fix it. With these changes, tags are correctly preserved between a series of commands like: git checkout ; umpf build; umpf merge; umpf tag. Signed-off-by: Alvin Šipraga --- umpf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/umpf b/umpf index 4fbe477..ec8d516 100755 --- a/umpf +++ b/umpf @@ -1589,6 +1589,12 @@ build_branch() { fi } +build_flags() { + if [ -z "${FLAGS}" ]; then + FLAGS="${content}" + fi +} + build_topic() { if ${IDENTICAL}; then if [ -n "${MERGE_TOPIC}" ]; then @@ -1612,8 +1618,8 @@ build_hashinfo() { run_build() { parse_series build "${STATE}/series" ${GIT} notes add -m "umpf-build-note: $(<"${STATE}/base-name") $(<"${STATE}/name")" - if [ -f "${FLAGS}" ]; then - ${GIT} notes append -m "umpf-build-flags: $(<"${FLAGS}")" + if [ -n "${FLAGS}" ]; then + ${GIT} notes append -m "umpf-build-flags: ${FLAGS}" fi if [ -n "${GIT_RELATIVE}" ]; then ${GIT} notes append -m "umpf-build-relative: ${GIT_RELATIVE}"