add downgrade support

This commit is contained in:
guinux 2014-03-05 15:00:39 +01:00
parent 812b7c9b44
commit 3750486576
2 changed files with 5 additions and 5 deletions

View File

@ -521,11 +521,11 @@ class PamacDBusService(dbus.service.Object):
finally: finally:
return error return error
@dbus.service.method('org.manjaro.pamac', '', 's') @dbus.service.method('org.manjaro.pamac', 'b', 's')
def Sysupgrade(self): def Sysupgrade(self, downgrade):
error = '' error = ''
try: try:
self.t.sysupgrade(downgrade=False) self.t.sysupgrade(downgrade = bool(downgrade))
except pyalpm.error as e: except pyalpm.error as e:
error = format_error(e.args) error = format_error(e.args)
self.t.release() self.t.release()

View File

@ -786,7 +786,7 @@ def set_transaction_sum(show_updates = True):
else: else:
sum_bottom_label.set_markup('<b>{} {}</b>'.format(_('Total download size:'), common.format_size(dsize))) sum_bottom_label.set_markup('<b>{} {}</b>'.format(_('Total download size:'), common.format_size(dsize)))
def sysupgrade(show_updates = True): def sysupgrade(show_updates = True, downgrade = False):
syncfirst, updates = available_updates syncfirst, updates = available_updates
if updates: if updates:
global to_update global to_update
@ -834,7 +834,7 @@ def sysupgrade(show_updates = True):
error += init_transaction() error += init_transaction()
if not error: if not error:
if to_update: if to_update:
error += Sysupgrade() error += Sysupgrade(downgrade)
_error = '' _error = ''
for name in to_add: for name in to_add:
_error += Add(name) _error += Add(name)