diff --git a/byobu-status b/byobu-status index 1026ba84..1493757c 100755 --- a/byobu-status +++ b/byobu-status @@ -28,6 +28,25 @@ PKG="byobu" +migrate() { + OLDPKG="screen-profiles" + # Rename the config dir + mv "$HOME/.$OLDPKG" "$HOME/.$PKG" + ln -s "$HOME/.$PKG" "$HOME/.$OLDPKG" + # Replace all instances of the old package name with the new + find "$HOME/.$PKG" -type f | xargs sed -i "s/$OLDPKG/$PKG/g" + # Fix the chosen profile symlink + if [ -h "$HOME/.$PKG/profile" ]; then + # Determine the chosen profile color + profile=`stat "$HOME/.$PKG/profile" | head -n1 | sed "s:^.*[/-]::" | sed "s:'$::"` + # Try to set that color, if it exists, otherwise default to light + select-screen-profile -s "$profile" || select-screen-profile -s "light" + fi +} + +# If the old config dir exists, but the new one doesn't, provide a migration mechanism +[ -d "$HOME/.$OLDPKG" -a ! -d "$HOME/.$PKG" ] && migrate + if [ -d "$HOME/.$PKG/bin" ]; then DIR="$HOME/.$PKG/bin" elif [ -d "/usr/lib/$PKG" ]; then diff --git a/debian/changelog b/debian/changelog index 00ca0bc5..d3957006 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ byobu (2.1) unreleased; urgency=low * byobu-export: touch an empty .byobu/profile, silence error message + * byobu-status, debian/rules: migrate existing screen-profiles config + dir smoothly by linking the old screen-profiles-status script to the + new byobu-status, and add a migrate function to that script Tranform byobu-status --detail to use vim's folding feature * byobu-status: output text compatible with vim's folding feature @@ -23,7 +26,7 @@ byobu (2.1) unreleased; urgency=low * bin/users: grep out the grep statement in the ps * bin/whoami: print /etc/passwd info on --detail - -- Dustin Kirkland Wed, 06 May 2009 21:01:56 -0500 + -- Dustin Kirkland Thu, 07 May 2009 00:11:51 -0500 byobu (2.0-0ubuntu1) karmic; urgency=low diff --git a/debian/rules b/debian/rules index 2014cacc..85bed1d7 100755 --- a/debian/rules +++ b/debian/rules @@ -49,6 +49,7 @@ install: build install-po dh_testroot dh_clean -k dh_link usr/bin/byobu usr/bin/screen + dh_link usr/bin/byobu-status usr/bin/screen-profiles-status dh_install -X.bzr # Everything else is handled by dh_install