* usr/bin/byobu-disable-prompt.in,

usr/bin/byobu-janitor.in:
  - Test if $HOME/.bashrc exists before modifying it (and potentially
    creating it)
This commit is contained in:
Jeffery To 2019-05-27 03:09:25 +08:00
commit b6fb57f94f
3 changed files with 8 additions and 1 deletions

4
debian/changelog vendored
View file

@ -20,6 +20,10 @@ byobu (5.128) unreleased; urgency=medium
- https://github.com/dustinkirkland/byobu/pull/30
[ Jeffery To ]
* usr/bin/byobu-disable-prompt.in,
usr/bin/byobu-janitor.in:
- Test if $HOME/.bashrc exists before modifying it (and potentially
creating it)
* usr/lib/byobu/logo:
- Add logo for OpenWrt

View file

@ -22,6 +22,8 @@ PKG="byobu"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="@prefix@" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"
[ -w "$HOME/.bashrc" ] || exit 1
$BYOBU_SED_INLINE -e "/#byobu-prompt#$/d" "$HOME/.bashrc"
if [ "$1" != "--no-reload" ]; then

View file

@ -112,7 +112,8 @@ killall -u $USER byobu-statusd >/dev/null 2>&1 || true
rm -f "$FLAG" "/var/run/screen/S-$USER/$PKG.reload-required"
# Affects: Upgrades from <= byobu 5.50, install byobu prompt if using stock bashrc
if ! (grep -qs "#byobu-prompt#$" "$HOME/.bashrc") && ! [ -e "$BYOBU_CONFIG_DIR/prompt" ]; then
if [ -r /etc/skel/.bashrc ] && [ -r "$HOME/.bashrc" ] && [ -w "$HOME/.bashrc" ] && \
! (grep -qs "#byobu-prompt#$" "$HOME/.bashrc") && ! [ -e "$BYOBU_CONFIG_DIR/prompt" ]; then
if eval $BYOBU_TEST diff >/dev/null 2>&1; then
if diff /etc/skel/.bashrc "$HOME/.bashrc" >/dev/null 2>&1; then
printf "[ -r $BYOBU_CONFIG_DIR/prompt ] && . $BYOBU_CONFIG_DIR/prompt #byobu-prompt#\n" >> "$HOME/.bashrc"