prereq-build: do not replace binaries with symlinks
authorMichael Pratt <mcpratt@pm.me>
Sat, 27 May 2023 21:11:47 +0000 (17:11 -0400)
committerPetr Štetiar <ynezz@true.cz>
Mon, 5 Jun 2023 06:31:50 +0000 (08:31 +0200)
commit729909c07fae4201591e51895833112cb88485e1
tree4ca58581ec4a1c42c1a18da137bbf9d24afe6bb7
parent9ffd6013b918145295d12ef15ca4282f48ce49e5
prereq-build: do not replace binaries with symlinks

Some programs, like bash and patch, are checked by prereq stage
and have a symlink installed, but then is later built from source.

Now that the prereq-build checks are not successful
just by finding the file alone, it is possible for
a new symlink to overwrite the installed binary.

If a normal file is found in staging_dir/host/bin,
let the check look for the associated stampfile, and if found,
skip creation of a symlink and exit successfully.

Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
include/prereq.mk