bash: do not hardcode prefix/home paths
Use @TERMUX_PREFIX@ or @TERMUX_HOME@ where needed.
This commit is contained in:
parent
1e5d50a950
commit
a997e982a2
@ -54,13 +54,12 @@ termux_step_pre_configure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
termux_step_post_make_install() {
|
termux_step_post_make_install() {
|
||||||
sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" $TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile
|
sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
|
||||||
sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
|
-e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \
|
||||||
$TERMUX_PKG_BUILDER_DIR/etc-profile | \
|
$TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile
|
||||||
sed "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" > \
|
|
||||||
$TERMUX_PREFIX/etc/profile
|
|
||||||
# /etc/bash.bashrc - System-wide .bashrc file for interactive shells. (config-top.h in bash source, patched to enable):
|
# /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|" \
|
sed -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \
|
||||||
$TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > \
|
-e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|" \
|
||||||
$TERMUX_PREFIX/etc/bash.bashrc
|
$TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > $TERMUX_PREFIX/etc/bash.bashrc
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@ unset i
|
|||||||
# Source etc/bash.bashrc and ~/.bashrc also for interactive bash login shells:
|
# Source etc/bash.bashrc and ~/.bashrc also for interactive bash login shells:
|
||||||
if [ "$BASH" ]; then
|
if [ "$BASH" ]; then
|
||||||
if [[ "$-" == *"i"* ]]; then
|
if [[ "$-" == *"i"* ]]; then
|
||||||
if [ -r /data/data/com.termux/files/usr/etc/bash.bashrc ]; then
|
if [ -r @TERMUX_PREFIX@/etc/bash.bashrc ]; then
|
||||||
. /data/data/com.termux/files/usr/etc/bash.bashrc
|
. @TERMUX_PREFIX@/etc/bash.bashrc
|
||||||
fi
|
fi
|
||||||
if [ -r /data/data/com.termux/files/home/.bashrc ]; then
|
if [ -r @TERMUX_HOME@/.bashrc ]; then
|
||||||
. /data/data/com.termux/files/home/.bashrc
|
. @TERMUX_HOME@/.bashrc
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user