From c06f8cfe0803b23e4851dd7e8beaf46af0c629a8 Mon Sep 17 00:00:00 2001
From: bionel <ionel.busuioc@gmail.com>
Date: Thu, 5 Oct 2017 13:55:49 +0300
Subject: identify rebuilt packages, improve selects

---
 src/frontend/gui/sisyphus-gui.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 5719ff9..61e0203 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -147,28 +147,26 @@ class Sisyphus(QtWidgets.QMainWindow):
                 i.name AS pn,
                 a.version AS av,
                 i.version AS iv,
-                i.description AS descr,
-                CASE WHEN rm.name ISNULL THEN 'no' ELSE 'yes' END AS rmv
+                i.description AS descr
                 FROM local_packages AS i
                 LEFT JOIN remote_packages AS a
                 ON i.category = a.category
                 AND i.name = a.name
                 AND i.slot = a.slot
-                LEFT JOIN removable_packages as rm
+                INNER JOIN removable_packages as rm
                 ON i.category = rm.category
                 AND i.name = rm.name
                 AND i.slot = rm.slot
                 WHERE %s LIKE %s
-                AND rmv = "yes"
             ''' % (Sisyphus.SEARCHFIELD, Sisyphus.SEARCHTERM)),
             ('upgradable','''SELECT
                 i.category AS cat,
                 i.name AS pn,
-                a.version AS av,
+                CASE WHEN a.version = i.version THEN 'Rebuilt' ELSE a.version END AS av,
                 i.version AS iv,
                 i.description AS descr
                 FROM local_packages AS i
-                LEFT JOIN remote_packages AS a
+                INNER JOIN remote_packages AS a
                 ON i.category = a.category
                 AND i.name = a.name
                 AND i.slot = a.slot
-- 
cgit v1.2.3