Browse Source
bash: do not hardcode prefix/home paths
Use @TERMUX_PREFIX@ or @TERMUX_HOME@ where needed.
emacs-27
Leonid Plyushch
6 years ago
No known key found for this signature in database
GPG Key ID: 45F2964132545795
2 changed files with
11 additions and
12 deletions
-
packages/bash/build.sh
-
packages/bash/etc-profile
|
|
@ -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,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 |
|
|
|