good progress
This commit is contained in:
@@ -259,7 +259,7 @@ def handle_error(error):
|
||||
transaction.to_remove = []
|
||||
transaction_dict.clear()
|
||||
transaction_type = None
|
||||
transaction.get_handle()
|
||||
transaction.update_db()
|
||||
set_packages_list()
|
||||
if mode == 'updater':
|
||||
have_updates()
|
||||
@@ -276,10 +276,11 @@ def handle_reply(reply):
|
||||
transaction.t_lock = False
|
||||
transaction.Release()
|
||||
transaction.ProgressWindow.hide()
|
||||
transaction.TransactionDone()
|
||||
transaction.to_add = []
|
||||
transaction.to_remove = []
|
||||
transaction_dict.clear()
|
||||
transaction.get_handle()
|
||||
transaction.update_db()
|
||||
if (transaction_type == "install") or (transaction_type == "remove"):
|
||||
transaction_type = None
|
||||
set_packages_list()
|
||||
@@ -384,7 +385,6 @@ def finalize():
|
||||
def check_conflicts(pkg_list):
|
||||
depends = [pkg_list]
|
||||
warning = ''
|
||||
#transaction.get_handle()
|
||||
pkgs = transaction.handle.get_localdb().search('linux3')
|
||||
installed_linux = []
|
||||
for i in pkgs:
|
||||
@@ -479,16 +479,17 @@ def check_conflicts(pkg_list):
|
||||
for replace in pkg.replaces:
|
||||
provide = pyalpm.find_satisfier(transaction.localpkgs.values(), replace)
|
||||
if provide:
|
||||
if provide.name != pkg.name:
|
||||
if not pkg.name in transaction.localpkgs.keys():
|
||||
if common.format_pkg_name(replace) in transaction.localpkgs.keys():
|
||||
if not provide.name in transaction.to_remove:
|
||||
transaction.to_remove.append(provide.name)
|
||||
if warning:
|
||||
warning = warning+'\n'
|
||||
warning = warning+provide.name+' will be replaced by '+pkg.name
|
||||
if not pkg.name in transaction.to_add:
|
||||
transaction.to_add.append(pkg.name)
|
||||
if not common.format_pkg_name(replace) in transaction.syncpkgs.keys():
|
||||
if provide.name != pkg.name:
|
||||
if not pkg.name in transaction.localpkgs.keys():
|
||||
if common.format_pkg_name(replace) in transaction.localpkgs.keys():
|
||||
if not provide.name in transaction.to_remove:
|
||||
transaction.to_remove.append(provide.name)
|
||||
if warning:
|
||||
warning = warning+'\n'
|
||||
warning = warning+provide.name+' will be replaced by '+pkg.name
|
||||
if not pkg.name in transaction.to_add:
|
||||
transaction.to_add.append(pkg.name)
|
||||
print(transaction.to_add,transaction.to_remove)
|
||||
if warning:
|
||||
transaction.WarningDialog.format_secondary_text(warning)
|
||||
|
@@ -176,16 +176,13 @@ class PamacDBusService(dbus.service.Object):
|
||||
return error
|
||||
|
||||
@dbus.service.signal('org.manjaro.pamac')
|
||||
def EmitAvailableUpdates(self, available_updates):
|
||||
def EmitTransactionDone(self, done):
|
||||
pass
|
||||
|
||||
@dbus.service.method('org.manjaro.pamac', '', '')
|
||||
def CheckUpdates(self):
|
||||
for pkg in config.handle.get_localdb().pkgcache:
|
||||
candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
|
||||
if candidate:
|
||||
self.EmitAvailableUpdates(True)
|
||||
return
|
||||
def TransactionDone(self):
|
||||
self.EmitTransactionDone(True)
|
||||
return
|
||||
|
||||
@dbus.service.method('org.manjaro.pamac', 'a{sb}', 's', sender_keyword='sender', connection_keyword='connexion')
|
||||
def Init(self, options, sender=None, connexion=None):
|
||||
|
@@ -33,11 +33,15 @@ ProgressCancelButton = interface.get_object('ProgressCancelButton')
|
||||
|
||||
def get_handle():
|
||||
global handle
|
||||
handle = config.pacman_conf.initialize_alpm()
|
||||
print('get handle')
|
||||
|
||||
def update_db():
|
||||
get_handle()
|
||||
global syncpkgs
|
||||
global localpkgs
|
||||
syncpkgs = OrderedDict()
|
||||
localpkgs = OrderedDict()
|
||||
handle = config.pacman_conf.initialize_alpm()
|
||||
for repo in handle.get_syncdbs():
|
||||
for pkg in repo.pkgcache:
|
||||
if not pkg.name in syncpkgs.keys():
|
||||
@@ -45,13 +49,11 @@ def get_handle():
|
||||
for pkg in handle.get_localdb().pkgcache:
|
||||
if not pkg.name in localpkgs.keys():
|
||||
localpkgs[pkg.name] = pkg
|
||||
print('get handle')
|
||||
|
||||
DBusGMainLoop(set_as_default=True)
|
||||
bus = dbus.SystemBus()
|
||||
proxy = bus.get_object('org.manjaro.pamac','/org/manjaro/pamac', introspect=False)
|
||||
Refresh = proxy.get_dbus_method('Refresh','org.manjaro.pamac')
|
||||
CheckUpdates = proxy.get_dbus_method('CheckUpdates','org.manjaro.pamac')
|
||||
Init = proxy.get_dbus_method('Init','org.manjaro.pamac')
|
||||
Sysupgrade = proxy.get_dbus_method('Sysupgrade','org.manjaro.pamac')
|
||||
Remove = proxy.get_dbus_method('Remove','org.manjaro.pamac')
|
||||
@@ -61,6 +63,7 @@ To_Remove = proxy.get_dbus_method('To_Remove','org.manjaro.pamac')
|
||||
To_Add = proxy.get_dbus_method('To_Add','org.manjaro.pamac')
|
||||
Commit = proxy.get_dbus_method('Commit','org.manjaro.pamac')
|
||||
Release = proxy.get_dbus_method('Release','org.manjaro.pamac')
|
||||
TransactionDone = proxy.get_dbus_method('TransactionDone','org.manjaro.pamac')
|
||||
StopDaemon = proxy.get_dbus_method('StopDaemon','org.manjaro.pamac')
|
||||
|
||||
def action_signal_handler(action):
|
||||
@@ -115,12 +118,11 @@ def get_updates():
|
||||
"""Return a list of package objects in local db which can be updated"""
|
||||
do_syncfirst = False
|
||||
list_first = []
|
||||
#get_handle()
|
||||
#update_db()
|
||||
if config.syncfirst:
|
||||
for name in config.syncfirst:
|
||||
pkg = handle.get_localdb().get_pkg(name)
|
||||
if pkg:
|
||||
candidate = pyalpm.sync_newversion(pkg, handle.get_syncdbs())
|
||||
if name in localpkgs.keys():
|
||||
candidate = pyalpm.sync_newversion(localpkgs[name], handle.get_syncdbs())
|
||||
if candidate:
|
||||
for repo in handle.get_syncdbs():
|
||||
pkg = repo.get_pkg(candidate.name)
|
||||
|
Reference in New Issue
Block a user