Subject: relax badshell tilde test
Author: Faidon Liambotis <paravoid@debian.org>
Bug: http://issues.asterisk.org/view.php?id=14718
Last-Update: 2009-12-19

badshell is disallowing tildes (~) in the DESTDIR directory to warn people
who use a shell that doesn't expand it to $HOMEDIR.

However, we have such a tilde in our directory (~rcN) that isn't expanded
to $HOMEDIR nor shouldn't be.

This patch relaxes this test just for cases where the ~ is followed by a '/',
which should catch most cases.

--- a/Makefile
+++ b/Makefile
@@ -599,7 +599,7 @@ oldmodcheck:
 	fi
 
 badshell:
-ifneq ($(findstring ~,$(DESTDIR)),)
+ifneq ($(findstring ~/,$(DESTDIR)),)
 	@echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
 	@echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
 	@exit 1
