diff --git a/debian/changelog b/debian/changelog index 1b722908..6afe1053 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ byobu (4.35) unreleased; urgency=low * usr/bin/byobu-janitor, usr/share/byobu/status/status: LP: #856467 - cleaner fix for ensuring ec2_cost is enabled in ec2 instances; previous fix just enabled it everywhere + * debian/postinst, usr/bin/byobu-janitor: + - smooth upgrades from older byobu (<= 4.0) -- Dustin Kirkland Wed, 21 Sep 2011 18:49:00 -0500 diff --git a/debian/postinst b/debian/postinst index 40f34906..4376afe2 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,14 +25,21 @@ fi rm -f /etc/update-motd.d/55-window-manager # Notify users that they should reload their profile +touch_flag() { + touch "$1" + chown --reference $(dirname "$1") "$1" || true + chmod 700 "$1" +} [ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" if [ -d "$SOCKETDIR" ]; then - for d in "$SOCKETDIR"/*/"$PKG"; do - [ -d "$d" ] || continue - flag="$d/reload-required" - touch "$flag" - chown --reference "$d" "$flag" || true - chmod 700 "$flag" + for d in "$SOCKETDIR"/*; do + if [ -d "$d/$PKG" ]; then + # New location of the reload flag + touch_flag "$d/$PKG/reload-required" + elif [ -d "$d" ]; then + # Old location of the reload flag + touch_flag "$d/$PKG.reload-required" + fi done fi diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index f2bce1d3..14bf0262 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -46,6 +46,12 @@ if [ -d "$BYOBU_CONFIG_DIR" ] && [ ! -w "$BYOBU_CONFIG_DIR" ]; then exit 1 fi +# Affects: Upgrades from <= byobu 4.30 +# Clear out old style status configuration +if ! grep -qs "^screen_upper_left=" "$BYOBU_CONFIG_DIR/status"; then + rm -f "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" +fi + # Affects: First runs with no configuration # Seed the configuration # Setup initial local user configuration @@ -127,7 +133,7 @@ fi # Affects: Upgrades from <= byobu 4.22 killall -u $USER byobu-statusd >/dev/null 2>&1 || true -# Clean up flag -rm -f "$FLAG" +# Clean up flag (new and old) +rm -f "$FLAG" "/var/run/screen/S-$USER/$PKG.reload-required" # vi: syntax=sh ts=4 noexpandtab