From 7fc6197dcd03a314d99539c2fecfd8702afc5d43 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 7 Mar 2014 01:55:21 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/moderate | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/moderate b/examples/moderate index f424aa0..f25cbb1 100644 --- a/examples/moderate +++ b/examples/moderate @@ -53,31 +53,34 @@ linux_installed, linux_latest = None, None def uname(): global have_linux_libre, have_pacman, linux_installed, linux_latest + uname_ = Uname() + nodename = uname_.nodename + kernel_release = uname_.kernel_release + operating_system = uname_.operating_system + + lts = '-lts' if kernel_release.lower().endswith('-lts') else '' if have_pacman is None: + have_pacman = True 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: try: - linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False) + linux_latest = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, False) except: have_pacman = None elif have_pacman: try: - linux_installed = Pacman('linux-libre' if have_linux_libre else 'linux', True) - linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False) + linux_installed = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, True) + linux_latest = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, False) except: have_pacman = None - uname_ = Uname() - nodename = uname_.nodename - kernel_release = uname_.kernel_release - operating_system = uname_.operating_system if (have_pacman is not None) and have_pacman: linux_running = kernel_release.split('-') linux_running, kernel_release = linux_running[:2], linux_running[2:] -- cgit v1.2.3-70-g09d2