* 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


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-05-07 00:12:03 -05:00
commit 882b1e652f
3 changed files with 24 additions and 1 deletions

View file

@ -28,6 +28,25 @@
PKG="byobu" 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 if [ -d "$HOME/.$PKG/bin" ]; then
DIR="$HOME/.$PKG/bin" DIR="$HOME/.$PKG/bin"
elif [ -d "/usr/lib/$PKG" ]; then elif [ -d "/usr/lib/$PKG" ]; then

5
debian/changelog vendored
View file

@ -1,6 +1,9 @@
byobu (2.1) unreleased; urgency=low byobu (2.1) unreleased; urgency=low
* byobu-export: touch an empty .byobu/profile, silence error message * 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 Tranform byobu-status --detail to use vim's folding feature
* byobu-status: output text compatible with 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/users: grep out the grep statement in the ps
* bin/whoami: print /etc/passwd info on --detail * bin/whoami: print /etc/passwd info on --detail
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 May 2009 21:01:56 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Thu, 07 May 2009 00:11:51 -0500
byobu (2.0-0ubuntu1) karmic; urgency=low byobu (2.0-0ubuntu1) karmic; urgency=low

1
debian/rules vendored
View file

@ -49,6 +49,7 @@ install: build install-po
dh_testroot dh_testroot
dh_clean -k dh_clean -k
dh_link usr/bin/byobu usr/bin/screen dh_link usr/bin/byobu usr/bin/screen
dh_link usr/bin/byobu-status usr/bin/screen-profiles-status
dh_install -X.bzr dh_install -X.bzr
# Everything else is handled by dh_install # Everything else is handled by dh_install