Skip to content

Commit

Permalink
Merge pull request #30 from bith3ad/flags-fixes
Browse files Browse the repository at this point in the history
umpf: fix ignoring flags
  • Loading branch information
michaelolbrich authored Nov 24, 2023
2 parents 78ce139 + d1e1625 commit ec592fa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion umpf
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,22 @@ import_series() {
base_rev="$(${GIT} merge-base "${base_rev}^1" "${base_rev}^2")"
exec {revlistfd}< <(${GIT} rev-list --merges --topo-order --parents "${base_rev}...${import}")
while read head base merges <&${revlistfd}; do
local magic base name
local magic base name flags
exec {localfd}< <(${GIT} notes show "${head}" 2>/dev/null)
# Reading git notes must be in sync with run_build()
while read magic base name <&${localfd}; do
if [ "${magic}" = "umpf-build-note:" ]; then
BASE="${BASE:-${base}}"
NAME="${NAME:-${name}}"
break
fi
done
while read magic flags <&${localfd}; do
if [ "${magic}" = "umpf-build-flags:" ]; then
FLAGS="${FLAGS:-${flags}}"
break
fi
done
exec {localfd}<&-
if [[ -n "${BASE}" && -n "${NAME}" ]]; then
break
Expand Down Expand Up @@ -861,13 +868,15 @@ parse() {
echo "${line}" >> "${STATE}/done"
content="${FLAGS}"
line="# umpf-flags: ${content}"
echo "${content}" > "${STATE}/flags"
do_exec flags
fi
;;
flags)
${has_base} || bailout "${cmd} before base"
test -n "${content}" || bailout "${cmd} line without value"
if [ -z "${FLAGS}" ]; then
echo "${content}" > "${STATE}/flags"
do_exec flags
fi
;;
Expand Down Expand Up @@ -1481,6 +1490,7 @@ build_hashinfo() {
run_build() {
parse_series build "${STATE}/series"
${GIT} notes add -m "umpf-build-note: $(<"${STATE}/base-name") $(<"${STATE}/name")"
[ -f "${STATE}/flags" ] && ${GIT} notes append -m "umpf-build-flags: $(<"${STATE}/flags")"
cleanup
}
Expand Down

0 comments on commit ec592fa

Please sign in to comment.