pamac-classic/pamac-refresh.py

23 lines
462 B
Python
Raw Normal View History

2013-09-26 13:02:07 -03:00
#! /usr/bin/pkexec /usr/bin/python3
2013-03-31 14:31:33 -03:00
# -*- coding:utf-8 -*-
2013-03-18 07:07:58 -03:00
2013-09-26 13:02:07 -03:00
from pamac import common, config
2013-03-18 07:07:58 -03:00
if not common.pid_file_exists():
2013-09-26 13:02:07 -03:00
print('refreshing')
handle = config.handle()
for db in handle.get_syncdbs():
try:
t = handle.init_transaction()
db.update(force = False)
t.release()
except:
try:
t.release()
except:
pass
print('refreshing {} failed'.format(db.name))
break
else:
print('refreshing {} succeeded'.format(db.name))