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, 12 Jun 2023 20:10:22 +0000 (22:10 +0200)
commit43b92ff6ce203dee5049c3ad4f28c95a69dd0694
tree3986a4eb729733fac46880a60912deaed49b8aea
parentc7bd7a9c5143f25dc6137439794fdf075c6cc424
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>
(cherry picked from commit 729909c07fae4201591e51895833112cb88485e1)
include/prereq.mk