#!/usr/bin/env bash

# micro_release means delete everything that you only need to develop
#
# First, strip all binaries. Note that you must not strip Python libraries
# while Python is running! So the stripping is done in a shell script.



#*****************************************************************************
#       Copyright (C) 2012 Volker Braun <vbraun.name@gmail.com>
#
#  Distributed under the terms of the GNU General Public License (GPL)
#
#                  http://www.gnu.org/licenses/
#*****************************************************************************

# There is lots of cruft in $SAGE_LOCAL/lib since people think its a
# good idea to install html files there. Luckily strip will notice
# that and just thrown an error (which we ignore)

echo "Stripping all binaries, this might take a while..."

find "$SAGE_LOCAL/bin" "$SAGE_LOCAL/lib" -type f -exec strip '{}' ';' |& grep -v "File format not recognized" | grep -v "File truncated" || true


"$SAGE_LOCAL/bin/sage-micro_release.py"
