mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-14 10:46:58 -07:00
* 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:
parent
72485d5dfa
commit
b6fb57f94f
3 changed files with 8 additions and 1 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue