Browse Source

bash: do not hardcode prefix/home paths

Use @TERMUX_PREFIX@ or @TERMUX_HOME@ where needed.
emacs-27
Leonid Plyushch 5 years ago
parent
commit
d535055ab5
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 15
      packages/bash/build.sh
  2. 8
      packages/bash/etc-profile

15
packages/bash/build.sh

@ -54,13 +54,12 @@ termux_step_pre_configure() {
}
termux_step_post_make_install() {
sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" $TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile
sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
$TERMUX_PKG_BUILDER_DIR/etc-profile | \
sed "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" > \
$TERMUX_PREFIX/etc/profile
sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
-e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \
$TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile
# /etc/bash.bashrc - System-wide .bashrc file for interactive shells. (config-top.h in bash source, patched to enable):
sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
$TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > \
$TERMUX_PREFIX/etc/bash.bashrc
sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
-e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \
$TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > $TERMUX_PREFIX/etc/bash.bashrc
}

8
packages/bash/etc-profile

@ -8,11 +8,11 @@ unset i
# Source etc/bash.bashrc and ~/.bashrc also for interactive bash login shells:
if [ "$BASH" ]; then
if [[ "$-" == *"i"* ]]; then
if [ -r /data/data/com.termux/files/usr/etc/bash.bashrc ]; then
. /data/data/com.termux/files/usr/etc/bash.bashrc
if [ -r @TERMUX_PREFIX@/etc/bash.bashrc ]; then
. @TERMUX_PREFIX@/etc/bash.bashrc
fi
if [ -r /data/data/com.termux/files/home/.bashrc ]; then
. /data/data/com.termux/files/home/.bashrc
if [ -r @TERMUX_HOME@/.bashrc ]; then
. @TERMUX_HOME@/.bashrc
fi
fi
fi

Loading…
Cancel
Save