mirror of
https://github.com/containers/podman.git
synced 2025-12-14 19:10:16 +08:00
Makefile: Handle unexpected empty var. values
Fixes #14021 Substitution values built from `$(shell ...)` output can easily be empty due to the shell's default `pipefail` behavior. This can also hide non-zero exit codes, similarly resulting in empty values being set. While not a perfect fix, the situation is improved by using the `err_if_empty` function in all cases where empty values would be unexpected. Remove the definitions for `GIT_BRANCH` and `GIT_BRANCH_CLEAN` which don't seem to actually be used anywhere (including in code). Add a simple release-test to verify `podman info` outputs a non-empty value for "GitCommit". Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
@@ -312,6 +312,11 @@ function _run_release() {
|
||||
if [[ -n "$dev" ]]; then
|
||||
die "Releases must never contain '-dev' in output of 'podman info' ($dev)"
|
||||
fi
|
||||
|
||||
commit=$(bin/podman info --format='{{.Version.GitCommit}}' | tr -d '[:space:]')
|
||||
if [[ -z "$commit" ]]; then
|
||||
die "Releases must contain a non-empty Version.GitCommit in 'podman info'"
|
||||
fi
|
||||
msg "All OK"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user