put shebang in scripts
authorits-pointless <bored@goat.si>
Tue, 15 Aug 2017 05:09:08 +0000 (15:09 +1000)
committerFredrik Fornwall <fredrik@fornwall.net>
Wed, 16 Aug 2017 22:26:27 +0000 (00:26 +0200)
packages/dropbear/build.sh
packages/graphviz/build.sh
packages/man/build.sh
packages/mlocate/build.sh
packages/mpd/build.sh
packages/openssh/build.sh
packages/python/build.sh
packages/python2/build.sh
packages/texlive/build.sh
packages/zsh/build.sh

index 827fc1f..46ebf51 100755 (executable)
@@ -12,7 +12,8 @@ TERMUX_PKG_EXTRA_MAKE_ARGS="MULTI=1"
 TERMUX_PKG_BUILD_IN_SRC="yes"
 
 termux_step_create_debscripts () {
-        echo "mkdir -p $TERMUX_PREFIX/etc/dropbear" >> postinst
+        echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "mkdir -p $TERMUX_PREFIX/etc/dropbear" >> postinst
         echo "for a in rsa dss ecdsa; do" >> postinst
         echo "    KEYFILE=$TERMUX_PREFIX/etc/dropbear/dropbear_\${a}_host_key" >> postinst
         echo "    test ! -f \$KEYFILE && dropbearkey -t \$a -f \$KEYFILE" >> postinst
index 3212422..702de0a 100644 (file)
@@ -43,7 +43,8 @@ termux_step_post_make_install() {
 }
 
 termux_step_create_debscripts () {
-       echo "dot -c" > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "dot -c" >> postinst
        echo "exit 0" >> postinst
        chmod 0755 postinst
 }
index 98ffeed..0fba053 100644 (file)
@@ -24,7 +24,8 @@ termux_step_pre_configure () {
 
 termux_step_create_debscripts () {
        echo "interest-noawait $TERMUX_PREFIX/share/man" > triggers
-
-       echo "makewhatis -Q" > postinst
+       
+       echo "#!$TERMUX_PREFIX/bin/sh" >> postinst
+       echo "makewhatis -Q" >> postinst
        echo "exit 0" >> postinst
 }
index e98d8e0..13b6001 100644 (file)
@@ -10,7 +10,8 @@ termux_step_pre_configure() {
 }
 
 termux_step_create_debscripts () {
-        echo "mkdir -p $TERMUX_PREFIX/var/mlocate/" > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "mkdir -p $TERMUX_PREFIX/var/mlocate/" >> postinst
         echo "exit 0" >> postinst
         chmod 0755 postinst
 }
index 3754288..bfabc5b 100644 (file)
@@ -59,5 +59,6 @@ termux_step_make_install () {
 }
 
 termux_step_create_debscripts() {
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
        echo 'mkdir -p $HOME/.mpd/playlists' >> postinst
 }
index 4d9bddf..19c683d 100755 (executable)
@@ -70,7 +70,8 @@ termux_step_post_make_install () {
 }
 
 termux_step_create_debscripts () {
-       echo "mkdir -p \$HOME/.ssh" > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "mkdir -p \$HOME/.ssh" >> postinst
        echo "touch \$HOME/.ssh/authorized_keys" >> postinst
        echo "chmod 700 \$HOME/.ssh" >> postinst
        echo "chmod 600 \$HOME/.ssh/authorized_keys" >> postinst
index d991ebc..88fb014 100644 (file)
@@ -70,7 +70,8 @@ termux_step_post_massage () {
 
 termux_step_create_debscripts () {
        ## POST INSTALL:
-       echo 'echo "Setting up pip..."' > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo 'echo "Setting up pip..."' >> postinst
        # Fix historical mistake which removed bin/pip but left site-packages/pip-*.dist-info,
        # which causes ensurepip to avoid installing pip due to already existing pip install:
        echo "if [ ! -f $TERMUX_PREFIX/bin/pip -a -d $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ]; then rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ; fi" >> postinst
@@ -78,8 +79,9 @@ termux_step_create_debscripts () {
        echo "$TERMUX_PREFIX/bin/python -m ensurepip --upgrade --default-pip" >> postinst
 
        ## PRE RM:
-       # Avoid running on update:
-       echo 'if [ $1 != "remove" ]; then exit 0; fi' > prerm
+       # Avoid running on update
+       echo "#!$TERMUX_PREFIX/bin/sh" > prerm:
+       echo 'if [ $1 != "remove" ]; then exit 0; fi' >> prerm
        # Uninstall everything installed through pip:
        echo "pip freeze 2> /dev/null | xargs pip uninstall -y > /dev/null 2> /dev/null" >> prerm
        # Cleanup __pycache__ folders:
index 12098cb..afb2e2b 100644 (file)
@@ -77,7 +77,8 @@ termux_step_post_massage () {
 
 termux_step_create_debscripts () {
        ## POST INSTALL:
-       echo "echo 'Setting up pip2...'" > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "echo 'Setting up pip2...'" >> postinst
        # Fix historical mistake which removed bin/pip2 but left site-packages/pip-*.dist-info,
        # which causes ensurepip to avoid installing pip due to already existing pip install:
        echo "if [ ! -f $TERMUX_PREFIX/bin/pip2 -a -d $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ]; then rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ; fi" >> postinst
@@ -85,8 +86,9 @@ termux_step_create_debscripts () {
        echo "$TERMUX_PREFIX/bin/python2 -m ensurepip --upgrade --no-default-pip" >> postinst
 
        ## PRE RM:
-       # Avoid running on update:
-       echo 'if [ $1 != "remove" ]; then exit 0; fi' > prerm
+       # Avoid running on update
+       echo "#!$TERMUX_PREFIX/bin/sh" > prerm:
+       echo 'if [ $1 != "remove" ]; then exit 0; fi' >> prerm
        # Uninstall everything installed through pip:
        echo "pip2 freeze 2> /dev/null | xargs pip2 uninstall -y > /dev/null 2> /dev/null" >> prerm
        # Cleanup __pycache__ folders
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
index bdbb2ec..cb02fdc 100644 (file)
@@ -44,7 +44,8 @@ termux_step_post_make_install () {
 
 termux_step_create_debscripts () {
        # For already installed packages:
-       echo "chmod 700 $TERMUX_PREFIX/share/zsh" > postinst
+       echo "#!$TERMUX_PREFIX/bin/sh" > postinst
+       echo "chmod 700 $TERMUX_PREFIX/share/zsh" >> postinst
        echo "exit 0" >> postinst
        chmod 0755 postinst
 }