2013-04-07 09:16:23 -03:00
|
|
|
#! /usr/bin/python3
|
2013-03-31 14:31:33 -03:00
|
|
|
# -*- coding:utf-8 -*-
|
2013-03-18 07:07:58 -03:00
|
|
|
|
|
|
|
from gi.repository import GObject
|
2013-05-18 05:24:20 -04:00
|
|
|
from pamac import common
|
2013-03-18 07:07:58 -03:00
|
|
|
import dbus
|
|
|
|
|
|
|
|
def reply(reply):
|
|
|
|
transaction.StopDaemon()
|
|
|
|
print('check updates done')
|
|
|
|
loop.quit()
|
|
|
|
|
|
|
|
def error(error):
|
|
|
|
transaction.StopDaemon()
|
|
|
|
print('check updates failed')
|
|
|
|
loop.quit()
|
|
|
|
|
|
|
|
loop = GObject.MainLoop()
|
|
|
|
|
|
|
|
if not common.pid_file_exists():
|
|
|
|
print('checking updates')
|
2013-05-18 05:24:20 -04:00
|
|
|
from pamac import transaction
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
bus.add_signal_receiver(reply, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionDone")
|
|
|
|
bus.add_signal_receiver(error, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionError")
|
2013-06-01 04:56:23 -04:00
|
|
|
try:
|
|
|
|
transaction.Refresh()
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
loop.run()
|