From a22ce9d153aed16fc91781ac096758236b238795 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 6 Mar 2014 19:16:12 +0100 Subject: add linux-lts detection (since linux 3.13.5 does not work) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugin-test | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/plugin-test b/examples/plugin-test index 711ef11..486212d 100644 --- a/examples/plugin-test +++ b/examples/plugin-test @@ -56,24 +56,23 @@ def redraw(): users = ['%s{%i}' % (colour_user(u) % u, len(users_[u])) for u in users_.keys()] users = 'Users: %s' % (' '.join(users)) + uname_ = Uname() + nodename = uname_.nodename + kernel_release = uname_.kernel_release + operating_system = uname_.operating_system + lts = '-lts' if kernel_release.lower().endswith('-lts') else '' have_linux_libre, have_pacman = True, True linux_installed, linux_latest = None, None try: - linux_installed = Pacman('linux-libre', True) + linux_installed = Pacman('linux-libre' + lts, True) except: have_linux_libre = False try: - linux_installed = Pacman('linux', True) + linux_installed = Pacman('linux' + lts, True) except: have_pacman = False if have_pacman: - linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False) - - uname_ = Uname() - nodename = uname_.nodename - kernel_release = uname_.kernel_release - operating_system = uname_.operating_system - if have_pacman: + linux_latest = Pacman('linux-libre' + lts if have_linux_libre else 'linux' + lts, False) linux_running = kernel_release.split('-') linux_running, kernel_release = linux_running[:2], linux_running[2:] linux_running = '-'.join(linux_running) -- cgit v1.2.3-70-g09d2