From c9cfcac8d08c70c785d6ae2cd8b8d72b8ebcc743 Mon Sep 17 00:00:00 2001 From: guinux Date: Tue, 22 Oct 2013 11:22:21 +0200 Subject: [PATCH] fix a bug in check_extra_modules --- pamac-daemon.py | 38 +++++++++++++++++++------------------- pamac/transaction.py | 8 ++++---- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pamac-daemon.py b/pamac-daemon.py index 07370ac..64bf946 100755 --- a/pamac-daemon.py +++ b/pamac-daemon.py @@ -528,35 +528,35 @@ class PamacDBusService(dbus.service.Object): # check if the current pkg is a kernel and if so, check if a module is required to install match = re.match("(linux[0-9]{2,3})(.*)", pkg.name) if match: - if not match.group(2): + if not match.group(2): # match pkg is a kernel for module in installed_modules: - pkgname = match.group(1)+module + pkgname = match.group(1) + module if not localdb.get_pkg(pkgname): for db in syncdbs: - pkg = db.get_pkg(pkgname) - if pkg: - if not pkg.name in already_checked: - depends[i+1].append(pkg) - already_checked.add(pkg.name) - if not pkg.name in to_add | to_remove: - to_add.add(pkg.name) - self.t.add_pkg(pkg) + _pkg = db.get_pkg(pkgname) + if _pkg: + if not _pkg.name in already_checked: + depends[i+1].append(_pkg) + already_checked.add(_pkg.name) + if not _pkg.name in to_add | to_remove: + to_add.add(_pkg.name) + self.t.add_pkg(_pkg) break # check if the current pkg is a kernel module and if so, install it for all installed kernels match = re.match("(linux[0-9]{2,3})(.*-modules)", pkg.name) if match: for kernel in installed_kernels: - pkgname = kernel+match.group(2) + pkgname = kernel + match.group(2) if not localdb.get_pkg(pkgname): for db in syncdbs: - pkg = db.get_pkg(pkgname) - if pkg: - if not pkg.name in already_checked: - depends[i+1].append(pkg) - already_checked.add(pkg.name) - if not pkg.name in to_add | to_remove: - to_add.add(pkg.name) - self.t.add_pkg(pkg) + _pkg = db.get_pkg(pkgname) + if _pkg: + if not _pkg.name in already_checked: + depends[i+1].append(_pkg) + already_checked.add(_pkg.name) + if not _pkg.name in to_add | to_remove: + to_add.add(_pkg.name) + self.t.add_pkg(_pkg) break for depend in pkg.depends: found_depend = pyalpm.find_satisfier(localdb.pkgcache, depend) diff --git a/pamac/transaction.py b/pamac/transaction.py index 652bea6..82f506f 100644 --- a/pamac/transaction.py +++ b/pamac/transaction.py @@ -275,10 +275,10 @@ def finalize(): progress_buffer.delete(progress_buffer.get_start_iter(), progress_buffer.get_end_iter()) ProgressCancelButton.set_visible(True) ProgressCloseButton.set_visible(False) - #~ try: - Commit() - #~ except dbus.exceptions.DBusException as e: - #~ handle_error(str(e)) + try: + Commit() + except dbus.exceptions.DBusException as e: + Release() while Gtk.events_pending(): Gtk.main_iteration()