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 729909c07f)
This commit is contained in:
committed by
Petr Štetiar
parent
c7bd7a9c51
commit
43b92ff6ce
@@ -110,6 +110,10 @@ define SetupHostCommand
|
|||||||
*" -> $$$$$$$$bin"*) \
|
*" -> $$$$$$$$bin"*) \
|
||||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||||
;; \
|
;; \
|
||||||
|
"-"*) \
|
||||||
|
find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \
|
||||||
|
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||||
|
;; \
|
||||||
esac; \
|
esac; \
|
||||||
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
||||||
exit 0; \
|
exit 0; \
|
||||||
|
|||||||
Reference in New Issue
Block a user