put shebang in scripts

This commit is contained in:
its-pointless
2017-08-15 15:09:08 +10:00
committed by Fredrik Fornwall
parent 2f90522ad3
commit aa605e8901
10 changed files with 31 additions and 17 deletions

View 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: