@ -56,7 +56,8 @@ termux_step_make() {
termux_step_create_debscripts ( ) {
termux_step_create_debscripts ( ) {
# Clean texlive's folder if needed (run on upgrade)
# Clean texlive's folder if needed (run on upgrade)
echo " if [ ! -f $TERMUX_PREFIX /opt/texlive/2016/install-tl -a ! -f $TERMUX_PREFIX /opt/texlive/2017/install-tl ]; then exit 0; else echo 'Removing residual files from old version of TeX Live for Termux'; fi " > preinst
echo " #! $TERMUX_PREFIX /bin/sh " > preinst
echo " if [ ! -f $TERMUX_PREFIX /opt/texlive/2016/install-tl -a ! -f $TERMUX_PREFIX /opt/texlive/2017/install-tl ]; then exit 0; else echo 'Removing residual files from old version of TeX Live for Termux'; fi " >> preinst
echo " rm -rf $TERMUX_PREFIX /etc/profile.d/texlive.sh " >> preinst
echo " rm -rf $TERMUX_PREFIX /etc/profile.d/texlive.sh " >> preinst
echo " rm -rf $TERMUX_PREFIX /opt/texlive/2016 " >> preinst
echo " rm -rf $TERMUX_PREFIX /opt/texlive/2016 " >> preinst
# Let's not delete the previous texmf-dist so that people who have installed a full distribution won't need to download everything again
# Let's not delete the previous texmf-dist so that people who have installed a full distribution won't need to download everything again
@ -64,7 +65,8 @@ termux_step_create_debscripts () {
echo "exit 0" >> preinst
echo "exit 0" >> preinst
chmod 0755 preinst
chmod 0755 preinst
echo " mkdir -p $TL_ROOT /{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}} " > postinst
echo " #! $TERMUX_PREFIX /bin/sh " > postinst
echo " mkdir -p $TL_ROOT /{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}} " >> postinst
echo " export PATH=\$PATH: $TL_BINDIR " >> postinst
echo " export PATH=\$PATH: $TL_BINDIR " >> postinst
echo "echo Updating tlmgr" >> postinst
echo "echo Updating tlmgr" >> postinst
echo "tlmgr update --self" >> postinst
echo "tlmgr update --self" >> postinst
@ -84,7 +86,8 @@ termux_step_create_debscripts () {
chmod 0755 postinst
chmod 0755 postinst
# Remove all files installed through tlmgr on removal
# Remove all files installed through tlmgr on removal
echo 'if [ $1 != "remove" ]; then exit 0; fi' > prerm
echo " #! $TERMUX_PREFIX /bin/sh " > prerm
echo 'if [ $1 != "remove" ]; then exit 0; fi' >> prerm
#echo "tlmgr remove --dry-run "
#echo "tlmgr remove --dry-run "
echo "echo Running texlinks --unlink" >> prerm
echo "echo Running texlinks --unlink" >> prerm
echo "texlinks --unlink" >> prerm
echo "texlinks --unlink" >> prerm