Change Makefile to not delete legacy binaries, but instead just notify the user about them. Change Makefile to only look for legacy binaries in $PREFIX instead of using which.

https://github.com/fish-shell/fish-shell/pull/655
This commit is contained in:
ridiculousfish 2013-04-12 13:46:27 -07:00
parent bcab703e31
commit 3c116cd077

View File

@ -509,23 +509,20 @@ check-uninstall:
fi; fi;
.PHONY: check-uninstall .PHONY: check-uninstall
check-legacy-binaries:
# seq used to be a shell script that we would install @SEQLOC=$(prefix)/bin/seq;\
# Now we just look for previously installed seqs, and erase them if test -f "$$SEQLOC" && grep -q '\(^#!/.*/fish\|^#!/usr/bin/env fish\)' "$$SEQLOC"; then\
# No big deal if it fails echo "An outdated seq from a previous fish install was found. You should remove it with:";\
# same with set_color, which is now a builtin. echo " rm '$$SEQLOC'";\
# Invoke set_color with -v to make sure it's ours. fi;
cleanup_old_binaries: @SETCOLOR_LOC=$(prefix)/bin/set_color;\
SEQLOC=`which seq`;\
if test -x "$$SEQLOC" && grep -q '\(^#!/.*/fish\|^#!/usr/bin/env fish\)' "$$SEQLOC"; then\
rm -f "$$SEQLOC";\
fi;\
SETCOLOR_LOC=`which set_color`;\
if test -x "$$SETCOLOR_LOC" && $$SETCOLOR_LOC -v 2>&1 >/dev/null | grep -q "^set_color, version "; then\ if test -x "$$SETCOLOR_LOC" && $$SETCOLOR_LOC -v 2>&1 >/dev/null | grep -q "^set_color, version "; then\
rm -f "$$SETCOLOR_LOC";\ echo "An outdated set_color from a previous fish install was found. You should remove it with:";\
fi;\ echo " rm '$$SETCOLOR_LOC'";\
true; fi;
.PHONY: cleanup_old_binaries @true;
.PHONY: check-legacy-binaries
# #
# This check makes sure that the install-sh script is executable. The # This check makes sure that the install-sh script is executable. The
@ -542,7 +539,7 @@ install-sh:
# Try to install after checking for incompatible installed versions. # Try to install after checking for incompatible installed versions.
# #
install: all cleanup_old_binaries install-sh check-uninstall install-force install: all install-sh check-uninstall install-force check-legacy-binaries
.PHONY: install .PHONY: install
# #