From 816a3c1802022b9d703be41024000d2c00552a76 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 14 Apr 2011 15:44:20 -0500 Subject: [PATCH] debian/postinst: correctly fix old-school screen-profiles era diversions of /usr/bin/screen, LP: #727738 --- debian/changelog | 5 +++++ debian/postinst | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9acb7434..9731b288 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ byobu (3.30) unreleased; urgency=low + [ Dustin Kirkland ] * usr/share/applications/byobu.desktop: fix description * usr/bin/byobu-status-detail: make a couple of minor modifications noticed while investigating the already-fixed LP: #750887 @@ -8,6 +9,10 @@ byobu (3.30) unreleased; urgency=low * usr/share/byobu/profiles/common: preserve splits across detach/reattach, LP: #760696 + [ Chaskiel Grundman ] + * debian/postinst: correctly fix old-school screen-profiles era diversions + of /usr/bin/screen, LP: #727738 + -- Dustin Kirkland Sun, 27 Feb 2011 10:29:53 -0600 byobu (3.29-0ubuntu1) natty; urgency=low diff --git a/debian/postinst b/debian/postinst index c2e2171f..80d38a28 100644 --- a/debian/postinst +++ b/debian/postinst @@ -12,9 +12,14 @@ else rm -f /etc/profile.d/Z98-$PKG.sh fi -# The target of the diversion somehow disappeared which will cause -# the divert removal to fail; we don't want that to happen -[ -e "/usr/bin/screen.real" ] && [ ! -e "/usr/bin/screen" ] && cp -a /usr/bin/screen.real /usr/bin/screen +# Clean up any old-school screen-profiles diversions of /usr/bin/screen +if [ -f /usr/bin/screen ] && [ -f /usr/bin/screen.real ]; then + divertpkg=$(dpkg-divert --listpackage /usr/bin/screen) + if [ "$divertpkg" = "screen-profiles" ]; then + rm -f /usr/bin/screen + dpkg-divert --package screen-profiles --rename --remove /usr/bin/screen + fi +fi # Remove the short-lived MOTD message rm -f /etc/update-motd.d/55-window-manager