From 5152f01be8b3f638f6068ee1dcbb0d5a9dc891cc Mon Sep 17 00:00:00 2001 From: guinux Date: Wed, 29 Jan 2014 16:21:37 +0100 Subject: [PATCH] authentication timeout and check kernel modules fixes --- pamac-daemon.py | 15 +++++++++++---- pamac/transaction.py | 3 +-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pamac-daemon.py b/pamac-daemon.py index 8afb274..55ee524 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -71,7 +71,6 @@ class PamacDBusService(dbus.service.Object): self.get_handle() def get_handle(self): - print('daemon get handle') self.handle = config.handle() self.localdb = self.handle.get_localdb() self.syncdbs = self.handle.get_syncdbs() @@ -417,7 +416,9 @@ class PamacDBusService(dbus.service.Object): Subject = ('unix-process', {'pid': dbus.UInt32(sender_pid, variant_level=1), 'start-time': dbus.UInt64(0, variant_level=1)}) - (is_authorized,is_challenge,details) = policykit_authority.CheckAuthorization(Subject, action, {'': ''}, dbus.UInt32(1), '') + # We would like an infinite timeout, but dbus-python won't allow it. + # Pass the longest timeout dbus-python will accept + (is_authorized,is_challenge,details) = policykit_authority.CheckAuthorization(Subject, action, {'': ''}, dbus.UInt32(1), '',timeout=2147483) return is_authorized @dbus.service.method('org.manjaro.pamac', 'si', 's') @@ -593,10 +594,16 @@ class PamacDBusService(dbus.service.Object): for module in installed_modules: pkgname = match.group(1)+module if not pkgname in to_remove: - to_remove.add(pkgname) _pkg = self.localdb.get_pkg(pkgname) if _pkg: - self.t.remove_pkg(_pkg) + # Check we won't remove a third party kernel + third_party = False + for provide in _pkg.provides: + if 'linux=' in provide: + third_party = True + if not third_party: + to_remove.add(pkgname) + self.t.remove_pkg(_pkg) # start loops to check pkgs i = 0 while depends[i]: diff --git a/pamac/transaction.py b/pamac/transaction.py index e0ee0c6..048a753 100644 --- a/pamac/transaction.py +++ b/pamac/transaction.py @@ -241,7 +241,6 @@ def get_handle(): handle = config.handle() syncdbs = handle.get_syncdbs() localdb = handle.get_localdb() - print('get handle') def get_localpkg(name): return localdb.get_pkg(name) @@ -395,7 +394,7 @@ def check_to_build(): to_mark_as_dep.add(name) # reorder to_build following build_order to_build.sort(key = lambda pkg: build_order.index(pkg.name)) - print('order:', build_order) + #print('order:', build_order) print('to build:',to_build) print('makedeps:',make_depends) print('builddeps:',build_depends)