Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umpf: fix ignoring flags #30

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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