forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] read uninstall from manifest (JuliaLang#33906)
This helps us uninstall the right content more generally. And this also lets us print a warning of the user's versions mismatch those in the repository (may be intentional, so we just print a warning so that the user is aware).
- Loading branch information
Showing
6 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# include after all other files: | ||
# defines uninstallers and version-checks | ||
# based on the contents of the UNINSTALL_* variables and the manifest files | ||
|
||
install: version-check | ||
version-check: $(addprefix version-check-, $(DEP_LIBS_STAGED)) | ||
uninstall: $(addprefix uninstall-, $(DEP_LIBS_STAGED)) | ||
|
||
## read 'uninstall-*' definition from either the manifest or the current session | ||
define define-uninstaller | ||
MANIFEST_$1 := $$(shell [ -e $$(build_prefix)/manifest/$1 ] && cat $$(build_prefix)/manifest/$1) | ||
ifeq (undefined,$$(flavor $$(word 2,$$(MANIFEST_$1)))) | ||
MANIFEST_$1 := $$(UNINSTALL_$1) | ||
endif | ||
UNINST_HOW_$1 := $$(word 2,$$(MANIFEST_$1)) | ||
ifneq ($$(UNINST_HOW_$1),) | ||
UNINST_WHO_$1 := $$(firstword $$(MANIFEST_$1)) | ||
UNINST_WHERE_$1 := $$(wordlist 3,99,$$(MANIFEST_$1)) | ||
$$(eval $$(call $$(UNINST_HOW_$1),$1,$$(UNINST_WHO_$1),$$(UNINST_WHERE_$1))) | ||
endif | ||
endef | ||
$(foreach dep,$(DEP_LIBS_STAGED),$(eval $(call define-uninstaller,$(dep)))) | ||
|
||
# for each subproject with a manifest, keep the user aware if something is not the expected version | ||
$(addprefix version-check-,$(DEP_LIBS_STAGED)) : version-check-% : install-% | ||
@if [ ! -e $(build_prefix)/manifest/$* ] || ( \ | ||
[ "1" != "`wc -w $(build_prefix)/manifest/$* | cut -f 1 -d ' '`" ] && \ | ||
[ "$(UNINSTALL_$*)" != "`cat $(build_prefix)/manifest/$*`" ]) ; then \ | ||
echo "WARNING: using mismatched version for $$(cat $(build_prefix)/manifest/$*):" ; \ | ||
echo " want $(UNINSTALL_$*)" ; \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters