From 34d3a85f8d1674f3bbb60bab8292d05a27e66424 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 9 Feb 2010 12:50:53 -0600 Subject: [PATCH] byobu-config: correct logic in determining if byobu is set to auto launch --- debian/changelog | 4 +++- usr/bin/byobu-config | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c783eb9..a6e1d83d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ -byobu (2.57) unreleased; urgency=low +byobu (2.57-0ubuntu1) lucid; urgency=low * debian/postinst, usr/bin/byobu-config, usr/bin/byobu-launcher, usr/bin/byobu-launcher-uninstall: install the profile.d script at Z98-* to ensure that it's sourced last-ish; clean up and check for the new location; check if shell is interactive before exec'ing in the launcher + * byobu-config: correct logic in determining if byobu is set to auto + launch -- Dustin Kirkland Tue, 09 Feb 2010 00:07:27 -0600 diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index 0e454c90..d8859d39 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -405,22 +405,18 @@ def defaultwindows(screen, size): return 100 def install(screen, size, isInstalled): - if not isInstalled: - out = commands.getoutput("byobu-launcher-install") - if out == "": - out = _("Byobu will be launched automatically next time you login.") - - button = messagebox(screen, 60, 2, "Message", out, \ - buttons=((_("Menu"), ))) - return 100 - else: + if isInstalled: out = commands.getoutput("byobu-launcher-uninstall") if out == "": out = _("Byobu will not be used next time you login.") - - button = messagebox(screen, 60, 2, _("Message"), out, \ - buttons=((_("Menu"), ))) + button = messagebox(screen, 60, 2, _("Message"), out, buttons=((_("Menu"), ))) return 101 + else: + out = commands.getoutput("byobu-launcher-install") + if out == "": + out = _("Byobu will be launched automatically next time you login.") + button = messagebox(screen, 60, 2, "Message", out, buttons=((_("Menu"), ))) + return 100 def appendtofile(p, s): f = open(p, 'a') @@ -499,7 +495,7 @@ def chgesc(screen, size): def autolaunch(): if os.path.exists("%s/.%s/disable-autolaunch" % (HOME, PKG)): return 0 - if commands.getoutput('grep -qs byobu-launcher %s/.profile' % HOME): + if commands.getstatusoutput('grep -qs byobu-launcher %s/.profile' % HOME): return 1 if os.path.exists("/etc/profile.d/Z98-%s.sh" % PKG): return 1 @@ -541,7 +537,7 @@ def main(): tag = defaultwindows(screen, size) elif tag == 9: tag = install(screen, size, isInstalled) - isInstalled=(tag == 100) + isInstalled = autolaunch() screen.finish() sys.exit(0)