# HG changeset patch
# User Georg S. Weber <GeorgSWeberYouKnowWhatGooglemailYouKnowTheRest>
# Date 1226608214 -3600
# Node ID 566b5d963d42ff9e06e20a564a32276048753ed6
# Parent  7882d45049c6e94f30896209d71403cf8e0d5f27
Trac ticket #3761
Fixed PART2

diff -r 7882d45049c6 -r 566b5d963d42 sage-bdist
--- a/sage-bdist	Thu Nov 13 00:31:25 2008 +0100
+++ b/sage-bdist	Thu Nov 13 21:30:14 2008 +0100
@@ -4,7 +4,7 @@
 # Build Sage *binary* distribution
 # This script should be called by the sage-sage script
 #
-# Released under the GNU GPL -- (c) William Stein
+# Released under the GNU GPL-v2+ -- (c) William Stein
 ########################################################
 
 PKGDIR=spkg
@@ -25,6 +25,14 @@
 SAGE_VERSION=$1
 SAGE_ROOT=$2
 export SAGE_VERSION SAGE_ROOT
+
+$SAGE_ROOT/sage -c "print 'Sage works!'"
+if [ $? -ne 0 ]; then
+    echo "Sage doesn't even start.  Refusing to make a binary."
+    exit 1
+fi
+#3761 trac
+$SAGE_ROOT/local/bin/sage-location
 
 TARGET=sage-"$SAGE_VERSION"-`uname -m`-`uname`
 TARGET=`echo $TARGET | sed -e 's/ //'`     #no blank spaces
