From a44a3561888fd7d1f054a0df1a0a495d0a2c1794 Mon Sep 17 00:00:00 2001 From: guinux Date: Sat, 4 May 2013 18:05:20 +0200 Subject: [PATCH] fix version comparison --- pamac-tray.py | 1 - pamac/main.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pamac-tray.py b/pamac-tray.py index 8a30c60..e1fed67 100755 --- a/pamac-tray.py +++ b/pamac-tray.py @@ -111,7 +111,6 @@ def set_icon(updates): bus.add_signal_receiver(set_icon, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates") tray = Tray() -#set_icon() t = PeriodicTask() t.start() Gtk.main() diff --git a/pamac/main.py b/pamac/main.py index 0d7b6bc..6fef778 100644 --- a/pamac/main.py +++ b/pamac/main.py @@ -330,11 +330,12 @@ def get_transaction_sum(): others = sorted(transaction.To_Add()) for name, version, dsize in others: if name in transaction.localpkgs.keys(): - if version > transaction.localpkgs[name].version: + comp = pyalpm.vercmp(version, transaction.localpkgs[name].version) + if comp == 1: transaction_dict['to_update'].append((name+' '+version, dsize)) - elif version == transaction.localpkgs[name].version: + elif comp == 0: transaction_dict['to_reinstall'].append((name+' '+version, dsize)) - elif version < transaction.localpkgs[name].version: + elif comp == -1: transaction_dict['to_downgrade'].append((name+' '+version, dsize)) else: transaction_dict['to_install'].append((name+' '+version, dsize))