diff options
author | Nicholas Chin <nic.c3.14@gmail.com> | 2022-05-23 13:12:28 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-05-28 14:57:07 +0000 |
commit | c217f31d0bd59a9d63787a40b1995b08c8dc683b (patch) | |
tree | 00023a40e39978b599c43d09f721a504f425fbe6 /payloads/external/tianocore | |
parent | 284c8e7f20e697a60f20468b28b5d60c308aecfe (diff) |
payloads/tianocore: Fix unclean working directory detection
After commit ae48b42683 (payloads/tianocore: Init submodules),
Tianocore's Makefile no longer detects an unclean working directory and
thus always performs a `git checkout`, overwriting any uncommited
changes made in the cloned sources.
The change of "clean" to "dirty" effectively inverts the logic of the
if-else condition, which would normally swap the two possible code paths
of the branch. However, since `git status` outputs multiple lines, most
of which do not contain "clean", the -v option (select non-matching
lines) causes grep to always match at least 1 line and thus return
success. This causes the if-else branch containing the `git checkout`
to always be taken regardless of the state of the working tree, masking
the issue of the inverted logic. Removing the -v option addresses both
of these issues and restores the intended behavior of the if-else block.
TEST:
1) Build coreboot successfully with the Tianocore UefiPayloadPkg option.
2) Make a change in the cloned Tianocore sources that results in an
unclean working directory and check for the "Working directory not
clean" message when building coreboot.
Change-Id: Icd4952b40c147d0fba676089ced5a8b59b93ad50
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64608
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'payloads/external/tianocore')
-rw-r--r-- | payloads/external/tianocore/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile index 405af72f9d..e60a27938a 100644 --- a/payloads/external/tianocore/Makefile +++ b/payloads/external/tianocore/Makefile @@ -100,7 +100,7 @@ update: $(project_dir) echo " $(CONFIG_TIANOCORE_TAG_OR_REV) is not a valid git reference"; \ exit 1; \ fi; \ - if git status --ignore-submodules=dirty | grep -qv clean; then \ + if git status --ignore-submodules=dirty | grep -q clean; then \ echo " Checking out $(project_name) revision $(CONFIG_TIANOCORE_TAG_OR_REV)"; \ git checkout --detach $(CONFIG_TIANOCORE_TAG_OR_REV) -f; \ else \ |