fix a bug in check_extra_modules

This commit is contained in:
guinux 2013-10-22 11:22:21 +02:00
parent c54dafc30c
commit c9cfcac8d0
2 changed files with 23 additions and 23 deletions

View File

@ -528,19 +528,19 @@ class PamacDBusService(dbus.service.Object):
# check if the current pkg is a kernel and if so, check if a module is required to install # 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) match = re.match("(linux[0-9]{2,3})(.*)", pkg.name)
if match: if match:
if not match.group(2): if not match.group(2): # match pkg is a kernel
for module in installed_modules: for module in installed_modules:
pkgname = match.group(1) + module pkgname = match.group(1) + module
if not localdb.get_pkg(pkgname): if not localdb.get_pkg(pkgname):
for db in syncdbs: for db in syncdbs:
pkg = db.get_pkg(pkgname) _pkg = db.get_pkg(pkgname)
if pkg: if _pkg:
if not pkg.name in already_checked: if not _pkg.name in already_checked:
depends[i+1].append(pkg) depends[i+1].append(_pkg)
already_checked.add(pkg.name) already_checked.add(_pkg.name)
if not pkg.name in to_add | to_remove: if not _pkg.name in to_add | to_remove:
to_add.add(pkg.name) to_add.add(_pkg.name)
self.t.add_pkg(pkg) self.t.add_pkg(_pkg)
break break
# check if the current pkg is a kernel module and if so, install it for all installed kernels # 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) match = re.match("(linux[0-9]{2,3})(.*-modules)", pkg.name)
@ -549,14 +549,14 @@ class PamacDBusService(dbus.service.Object):
pkgname = kernel + match.group(2) pkgname = kernel + match.group(2)
if not localdb.get_pkg(pkgname): if not localdb.get_pkg(pkgname):
for db in syncdbs: for db in syncdbs:
pkg = db.get_pkg(pkgname) _pkg = db.get_pkg(pkgname)
if pkg: if _pkg:
if not pkg.name in already_checked: if not _pkg.name in already_checked:
depends[i+1].append(pkg) depends[i+1].append(_pkg)
already_checked.add(pkg.name) already_checked.add(_pkg.name)
if not pkg.name in to_add | to_remove: if not _pkg.name in to_add | to_remove:
to_add.add(pkg.name) to_add.add(_pkg.name)
self.t.add_pkg(pkg) self.t.add_pkg(_pkg)
break break
for depend in pkg.depends: for depend in pkg.depends:
found_depend = pyalpm.find_satisfier(localdb.pkgcache, depend) found_depend = pyalpm.find_satisfier(localdb.pkgcache, depend)

View File

@ -275,10 +275,10 @@ def finalize():
progress_buffer.delete(progress_buffer.get_start_iter(), progress_buffer.get_end_iter()) progress_buffer.delete(progress_buffer.get_start_iter(), progress_buffer.get_end_iter())
ProgressCancelButton.set_visible(True) ProgressCancelButton.set_visible(True)
ProgressCloseButton.set_visible(False) ProgressCloseButton.set_visible(False)
#~ try: try:
Commit() Commit()
#~ except dbus.exceptions.DBusException as e: except dbus.exceptions.DBusException as e:
#~ handle_error(str(e)) Release()
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration() Gtk.main_iteration()