put shebang in scripts
[termux-packages] / packages / texlive / build.sh
index d556991..7f2f472 100644 (file)
@@ -56,15 +56,17 @@ termux_step_make() {
 
 termux_step_create_debscripts () {
        # 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/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
        echo "rm -rf $TERMUX_PREFIX/opt/texlive/2017/!(texmf-dist)" >> preinst
        echo "exit 0" >> 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 "echo Updating tlmgr" >> postinst
        echo "tlmgr update --self" >> postinst
@@ -84,7 +86,8 @@ termux_step_create_debscripts () {
        chmod 0755 postinst
 
        # 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 "echo Running texlinks --unlink" >> prerm
        echo "texlinks --unlink" >> prerm