Переглянути джерело

prereq-build: replace relative symlinks only if broken

Some programs installed to staging_dir/host/bin
also install some symlinks to itself
for an alternative name.

Some of those new symlinks are overwriting
symlinks that were installed by prereq stage.

If prereq stage were to somehow be run again,
it should not be overwriting symlinks
that point to programs that are already built.

To filter that out, catch all symlinks
after first catching all symlinks
that have an absolute target
after all other cases in the case statement,
make sure it is not broken, and if so exit successfully.

Suggested-by: Kevin Darbyshire-Bryant <[email protected]>
Signed-off-by: Michael Pratt <[email protected]>
Michael Pratt 2 роки тому
батько
коміт
b890e2fbf9
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      include/prereq.mk

+ 5 - 0
include/prereq.mk

@@ -114,6 +114,11 @@ define SetupHostCommand
 						find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \
 						find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \
 						[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
 						[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
 						;; \
 						;; \
+					*" -> /"*) \
+						;; \
+					*" -> "*) \
+						[ -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 1; \
 				exit 1; \