port to libalpm 4.1 and fixes

This commit is contained in:
guinux 2013-04-10 16:20:54 +02:00
parent 4571580f12
commit 93b0e52bf7
6 changed files with 221 additions and 186 deletions

View File

@ -7,7 +7,6 @@ from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GObject from gi.repository import GObject
import pyalpm import pyalpm
#import traceback
from multiprocessing import Process from multiprocessing import Process
from pamac import config, common from pamac import config, common
@ -98,21 +97,25 @@ class PamacDBusService(dbus.service.Object):
formatted_event = 'Upgraded {pkgname} ({oldversion} -> {newversion})'.format(pkgname = tupel[1].name, oldversion = tupel[1].version, newversion = tupel[0].version) formatted_event = 'Upgraded {pkgname} ({oldversion} -> {newversion})'.format(pkgname = tupel[1].name, oldversion = tupel[1].version, newversion = tupel[0].version)
common.write_log_file(formatted_event) common.write_log_file(formatted_event)
print(formatted_event) print(formatted_event)
elif ID is 15: elif ID is 19:
self.action = _('Checking integrity')+'...' self.action = _('Checking integrity')+'...'
self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png' self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
self.already_transferred = 0 self.already_transferred = 0
elif ID is 17: elif ID is 21:
self.action = _('Loading packages files')+'...' self.action = _('Loading packages files')+'...'
self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png' self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
print('Loading packages files') print('Loading packages files')
elif ID is 26: elif ID is 30:
self.action = _('Configuring')+'...' self.action = _('Configuring')+'...'
self.icon = '/usr/share/pamac/icons/24x24/status/setup.png' self.icon = '/usr/share/pamac/icons/24x24/status/setup.png'
self.EmitPercent(2) self.EmitPercent(2)
print('Configuring a package') print('Configuring a package')
elif ID is 27: elif ID is 31:
print('Downloading a file') print('Downloading a file')
elif ID is 36:
self.action = _('Checking keys in keyring')+'...'
self.icon = '/usr/share/pamac/icons/24x24/status/package-search.png'
print('Checking keys in keyring')
else : else :
self.action = '' self.action = ''
#self.EmitTarget('') #self.EmitTarget('')
@ -213,6 +216,19 @@ class PamacDBusService(dbus.service.Object):
def CheckUpdates(self): def CheckUpdates(self):
updates = 0 updates = 0
_ignorepkgs = []
for group in self.handle.ignoregrps:
db = self.handle.get_localdb()
grp = db.read_grp(group)
if grp:
name, pkg_list = grp
for pkg in pkg_list:
if not pkg.name in _ignorepkgs:
_ignorepkgs.append(pkg.name)
for pkgname in self.handle.ignorepkgs:
if pkgname in localpkgs.keys():
if not pkgname in _ignorepkgs:
_ignorepkgs.append(pkgname)
if config.syncfirst: if config.syncfirst:
for name in config.syncfirst: for name in config.syncfirst:
pkg = self.handle.get_localdb().get_pkg(name) pkg = self.handle.get_localdb().get_pkg(name)
@ -224,7 +240,8 @@ class PamacDBusService(dbus.service.Object):
for pkg in self.handle.get_localdb().pkgcache: for pkg in self.handle.get_localdb().pkgcache:
candidate = pyalpm.sync_newversion(pkg, self.handle.get_syncdbs()) candidate = pyalpm.sync_newversion(pkg, self.handle.get_syncdbs())
if candidate: if candidate:
updates += 1 if not candidate.name in _ignorepkgs:
updates += 1
self.EmitAvailableUpdates(updates) self.EmitAvailableUpdates(updates)
@dbus.service.method('org.manjaro.pamac', '', 's', async_callbacks=('success', 'nosuccess')) @dbus.service.method('org.manjaro.pamac', '', 's', async_callbacks=('success', 'nosuccess'))
@ -239,7 +256,7 @@ class PamacDBusService(dbus.service.Object):
db.update(force=False) db.update(force=False)
except pyalpm.error as e: except pyalpm.error as e:
self.error += ' --> '+str(e)+'\n' self.error += ' --> '+str(e)+'\n'
#break break
finally: finally:
try: try:
self.t.release() self.t.release()
@ -265,8 +282,10 @@ class PamacDBusService(dbus.service.Object):
except pyalpm.error as e: except pyalpm.error as e:
self.error += ' --> '+str(e)+'\n' self.error += ' --> '+str(e)+'\n'
finally: finally:
if self.error:
self.EmitTransactionError(self.error)
return self.error return self.error
else : else:
return _('Authentication failed') return _('Authentication failed')
@dbus.service.method('org.manjaro.pamac', '', 's') @dbus.service.method('org.manjaro.pamac', '', 's')

View File

@ -41,10 +41,10 @@ def install(pkgnames):
main.finalize() main.finalize()
loop.run() loop.run()
else: else:
transaction.WarningDialog.format_secondary_text('Nothing to do') main.WarningDialog.format_secondary_text('Nothing to do')
response = transaction.WarningDialog.run() response = main.WarningDialog.run()
if response: if response:
transaction.WarningDialog.hide() main.WarningDialog.hide()
reply('') reply('')
bus = dbus.SystemBus() bus = dbus.SystemBus()
@ -58,16 +58,16 @@ transaction.update_db()
do_syncfirst, updates = transaction.get_updates() do_syncfirst, updates = transaction.get_updates()
if common.pid_file_exists(): if common.pid_file_exists():
transaction.ErrorDialog.format_secondary_text('Another instance of Pamac is running') main.ErrorDialog.format_secondary_text('Another instance of Pamac is running')
response = transaction.ErrorDialog.run() response = main.ErrorDialog.run()
if response: if response:
transaction.ErrorDialog.hide() main.ErrorDialog.hide()
transaction.StopDaemon() transaction.StopDaemon()
elif updates: elif updates:
transaction.ErrorDialog.format_secondary_text('Some updates are available.\nPlease update your system first') main.ErrorDialog.format_secondary_text('Some updates are available.\nPlease update your system first')
response = transaction.ErrorDialog.run() response = main.ErrorDialog.run()
if response: if response:
transaction.ErrorDialog.hide() main.ErrorDialog.hide()
transaction.StopDaemon() transaction.StopDaemon()
else: else:
common.write_pid_file() common.write_pid_file()

128
pamac.pot
View File

@ -1,4 +1,4 @@
## Translation of Pamac. # Translation of Pamac.
# Copyright (C) 2007-2012 Free Software Foundation, Inc. # Copyright (C) 2007-2012 Free Software Foundation, Inc.
# This file is distributed under the same license as the Pamac package. # This file is distributed under the same license as the Pamac package.
# Guillaume Benoit <guillaume@manjaro.org>, 2013. # Guillaume Benoit <guillaume@manjaro.org>, 2013.
@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: pamac\n" "Project-Id-Version: pamac\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-03-31 18:55+0200\n" "POT-Creation-Date: 2013-04-10 16:13+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,64 +17,68 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: pamac-daemon.py:30 pamac/main.py:594 #: pamac-daemon.py:29 pamac/main.py:602
msgid "Preparing" msgid "Preparing"
msgstr "" msgstr ""
#: pamac-daemon.py:69 #: pamac-daemon.py:68
msgid "Checking dependencies" msgid "Checking dependencies"
msgstr "" msgstr ""
#: pamac-daemon.py:72 #: pamac-daemon.py:71
msgid "Checking file conflicts" msgid "Checking file conflicts"
msgstr "" msgstr ""
#: pamac-daemon.py:75 #: pamac-daemon.py:74
msgid "Resolving dependencies" msgid "Resolving dependencies"
msgstr "" msgstr ""
#: pamac-daemon.py:78 #: pamac-daemon.py:77
msgid "Checking inter conflicts" msgid "Checking inter conflicts"
msgstr "" msgstr ""
#: pamac-daemon.py:81 pamac/main.py:73 #: pamac-daemon.py:80 pamac/main.py:75
msgid "Installing" msgid "Installing"
msgstr "" msgstr ""
#: pamac-daemon.py:88 pamac/main.py:73 #: pamac-daemon.py:87 pamac/main.py:75
msgid "Removing" msgid "Removing"
msgstr "" msgstr ""
#: pamac-daemon.py:95 pamac/main.py:73 #: pamac-daemon.py:94 pamac/main.py:75
msgid "Upgrading" msgid "Upgrading"
msgstr "" msgstr ""
#: pamac-daemon.py:102 #: pamac-daemon.py:101
msgid "Checking integrity" msgid "Checking integrity"
msgstr "" msgstr ""
#: pamac-daemon.py:106 #: pamac-daemon.py:105
msgid "Loading packages files" msgid "Loading packages files"
msgstr "" msgstr ""
#: pamac-daemon.py:110 pamac/main.py:73 #: pamac-daemon.py:109 pamac/main.py:75
msgid "Configuring" msgid "Configuring"
msgstr "" msgstr ""
#: pamac-daemon.py:162 #: pamac-daemon.py:116
msgid "Checking keys in keyring"
msgstr ""
#: pamac-daemon.py:165
msgid "Downloading {size}" msgid "Downloading {size}"
msgstr "" msgstr ""
#: pamac-daemon.py:167 pamac/main.py:504 #: pamac-daemon.py:170 pamac/main.py:512
msgid "Refreshing" msgid "Refreshing"
msgstr "" msgstr ""
#: pamac-daemon.py:270 pamac-daemon.py:378 pamac-daemon.py:386 #: pamac-daemon.py:289 pamac-daemon.py:397 pamac-daemon.py:405
#: pamac-daemon.py:408 #: pamac-daemon.py:427
msgid "Authentication failed" msgid "Authentication failed"
msgstr "" msgstr ""
#: pamac-daemon.py:374 #: pamac-daemon.py:393
msgid "Transaction successfully finished" msgid "Transaction successfully finished"
msgstr "" msgstr ""
@ -102,173 +106,173 @@ msgstr ""
msgid "Quit" msgid "Quit"
msgstr "" msgstr ""
#: pamac/main.py:110 pamac/main.py:923 #: pamac/main.py:112 pamac/main.py:947
msgid "Installed" msgid "Installed"
msgstr "" msgstr ""
#: pamac/main.py:110 pamac/main.py:925 #: pamac/main.py:112 pamac/main.py:949
msgid "Uninstalled" msgid "Uninstalled"
msgstr "" msgstr ""
#: pamac/main.py:110 pamac/main.py:927 #: pamac/main.py:112 pamac/main.py:951
msgid "Orphans" msgid "Orphans"
msgstr "" msgstr ""
#: pamac/main.py:110 pamac/main.py:428 pamac/main.py:929 #: pamac/main.py:112 pamac/main.py:430 pamac/main.py:953
msgid "To install" msgid "To install"
msgstr "" msgstr ""
#: pamac/main.py:110 pamac/main.py:408 pamac/main.py:931 #: pamac/main.py:112 pamac/main.py:410 pamac/main.py:955
msgid "To remove" msgid "To remove"
msgstr "" msgstr ""
#: pamac/main.py:129 pamac/main.py:939 #: pamac/main.py:131 pamac/main.py:963
msgid "local" msgid "local"
msgstr "" msgstr ""
#: pamac/main.py:295 #: pamac/main.py:297
msgid "No package found" msgid "No package found"
msgstr "" msgstr ""
#: pamac/main.py:346 #: pamac/main.py:348
msgid "Licenses" msgid "Licenses"
msgstr "" msgstr ""
#: pamac/main.py:351 #: pamac/main.py:353
msgid "Depends On" msgid "Depends On"
msgstr "" msgstr ""
#: pamac/main.py:353 #: pamac/main.py:355
msgid "Optional Deps" msgid "Optional Deps"
msgstr "" msgstr ""
#: pamac/main.py:356 #: pamac/main.py:358
msgid "Required By" msgid "Required By"
msgstr "" msgstr ""
#: pamac/main.py:358 #: pamac/main.py:360
msgid "Provides" msgid "Provides"
msgstr "" msgstr ""
#: pamac/main.py:360 #: pamac/main.py:362
msgid "Replaces" msgid "Replaces"
msgstr "" msgstr ""
#: pamac/main.py:362 #: pamac/main.py:364
msgid "Conflicts With" msgid "Conflicts With"
msgstr "" msgstr ""
#: pamac/main.py:367 #: pamac/main.py:369
msgid "Repository" msgid "Repository"
msgstr "" msgstr ""
#: pamac/main.py:369 gui/manager.glade:539 #: pamac/main.py:371 gui/manager.glade:539
msgid "Groups" msgid "Groups"
msgstr "" msgstr ""
#: pamac/main.py:371 #: pamac/main.py:373
msgid "Compressed Size" msgid "Compressed Size"
msgstr "" msgstr ""
#: pamac/main.py:372 #: pamac/main.py:374
msgid "Download Size" msgid "Download Size"
msgstr "" msgstr ""
#: pamac/main.py:374 #: pamac/main.py:376
msgid "Installed Size" msgid "Installed Size"
msgstr "" msgstr ""
#: pamac/main.py:375 #: pamac/main.py:377
msgid "Packager" msgid "Packager"
msgstr "" msgstr ""
#: pamac/main.py:379 #: pamac/main.py:381
msgid "Install Date" msgid "Install Date"
msgstr "" msgstr ""
#: pamac/main.py:381 #: pamac/main.py:383
msgid "Explicitly installed" msgid "Explicitly installed"
msgstr "" msgstr ""
#: pamac/main.py:383 #: pamac/main.py:385
msgid "Installed as a dependency for another package" msgid "Installed as a dependency for another package"
msgstr "" msgstr ""
#: pamac/main.py:385 #: pamac/main.py:387
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr ""
#: pamac/main.py:386 #: pamac/main.py:388
msgid "Install Reason" msgid "Install Reason"
msgstr "" msgstr ""
#: pamac/main.py:391 #: pamac/main.py:393
msgid "Signatures" msgid "Signatures"
msgstr "" msgstr ""
#: pamac/main.py:395 #: pamac/main.py:397
msgid "Backup files" msgid "Backup files"
msgstr "" msgstr ""
#: pamac/main.py:405 #: pamac/main.py:407
msgid "<big><b>Transaction Summary</b></big>" msgid "<big><b>Transaction Summary</b></big>"
msgstr "" msgstr ""
#: pamac/main.py:419 pamac/main.py:528 #: pamac/main.py:421 pamac/main.py:536
msgid "<b>Total download size: </b>" msgid "<b>Total download size: </b>"
msgstr "" msgstr ""
#: pamac/main.py:435 #: pamac/main.py:437
msgid "To update" msgid "To update"
msgstr "" msgstr ""
#: pamac/main.py:520 pamac/main.py:1048 #: pamac/main.py:528 pamac/main.py:1072
msgid "<big><b>Your system is up-to-date</b></big>" msgid "<big><b>Your system is up-to-date</b></big>"
msgstr "" msgstr ""
#: pamac/main.py:530 #: pamac/main.py:538
msgid "<big><b>1 available update</b></big>" msgid "<big><b>1 available update</b></big>"
msgstr "" msgstr ""
#: pamac/main.py:532 #: pamac/main.py:540
msgid "<big><b>{number} available updates</b></big>" msgid "<big><b>{number} available updates</b></big>"
msgstr "" msgstr ""
#: pamac/main.py:691 pamac/main.py:761 #: pamac/main.py:699 pamac/main.py:785
msgid "{pkgname1} will be replaced by {pkgname2}" msgid "{pkgname1} will be replaced by {pkgname2}"
msgstr "" msgstr ""
#: pamac/main.py:708 pamac/main.py:742 #: pamac/main.py:710 pamac/main.py:729 pamac/main.py:752 pamac/main.py:771
msgid "{pkgname1} conflicts with {pkgname2}"
msgstr ""
#: pamac/main.py:724 pamac/main.py:766
msgid "" msgid ""
"{pkgname1} conflicts with {pkgname2} but cannot be removed because it is " "{pkgname1} conflicts with {pkgname2} but cannot be removed because it is "
"needed by {pkgname3}" "needed by {pkgname3}"
msgstr "" msgstr ""
#: pamac/main.py:713 pamac/main.py:747 #: pamac/main.py:739
msgid "{pkgname1} conflicts with {pkgname2}"
msgstr ""
#: pamac/main.py:723
msgid "" msgid ""
"{pkgname1} conflicts with {pkgname2}\n" "{pkgname1} conflicts with {pkgname2}\n"
"None of them will be installed" "None of them will be installed"
msgstr "" msgstr ""
#: pamac/main.py:782 #: pamac/main.py:806
msgid "" msgid ""
"<b>{pkgname} is provided by {number} packages.\n" "<b>{pkgname} is provided by {number} packages.\n"
"Please choose the one(s) you want to install:</b>" "Please choose the one(s) you want to install:</b>"
msgstr "" msgstr ""
#: pamac/main.py:808 #: pamac/main.py:832
msgid "No package is selected" msgid "No package is selected"
msgstr "" msgstr ""
#: pamac/main.py:849 #: pamac/main.py:873
msgid "Nothing to do" msgid "Nothing to do"
msgstr "" msgstr ""
#: pamac/main.py:1032 #: pamac/main.py:1056
msgid "Pamac is already running" msgid "Pamac is already running"
msgstr "" msgstr ""

View File

@ -21,10 +21,10 @@ _ = gettext.gettext
interface = Gtk.Builder() interface = Gtk.Builder()
interface.set_translation_domain('pamac') interface.set_translation_domain('pamac')
#interface.add_from_file('/usr/share/pamac/gui/dialogs.glade') interface.add_from_file('/usr/share/pamac/gui/dialogs.glade')
#ErrorDialog = interface.get_object('ErrorDialog') ErrorDialog = interface.get_object('ErrorDialog')
#WarningDialog = interface.get_object('WarningDialog') WarningDialog = interface.get_object('WarningDialog')
#InfoDialog = interface.get_object('InfoDialog') InfoDialog = interface.get_object('InfoDialog')
#QuestionDialog = interface.get_object('QuestionDialog') #QuestionDialog = interface.get_object('QuestionDialog')
interface.add_from_file('/usr/share/pamac/gui/manager.glade') interface.add_from_file('/usr/share/pamac/gui/manager.glade')
@ -177,7 +177,7 @@ def set_list_dict_group(group):
pkg_name_list.append(pkg_object.name) pkg_name_list.append(pkg_object.name)
pkg_object_dict[pkg_object.name] = pkg_object pkg_object_dict[pkg_object.name] = pkg_object
pkg_installed_dict[pkg_object.name] = False pkg_installed_dict[pkg_object.name] = False
db = config.pacman_conf.initialize_alpm().get_localdb() db = transaction.handle.get_localdb()
grp = db.read_grp(group) grp = db.read_grp(group)
if grp is not None: if grp is not None:
name, pkg_list = grp name, pkg_list = grp
@ -449,20 +449,26 @@ def handle_error(error):
if error: if error:
if not 'DBus.Error.NoReply' in str(error): if not 'DBus.Error.NoReply' in str(error):
print('error:', error) print('error:', error)
transaction.ErrorDialog.format_secondary_text(error) ErrorDialog.format_secondary_text(error)
response = transaction.ErrorDialog.run() response = ErrorDialog.run()
if response: if response:
transaction.ErrorDialog.hide() ErrorDialog.hide()
transaction.t_lock = False transaction.t_lock = False
transaction.Release() try:
transaction.Release()
except:
pass
if mode == 'manager': if mode == 'manager':
transaction.to_add = [] transaction.to_add = []
transaction.to_remove = [] transaction.to_remove = []
transaction_dict.clear() transaction_dict.clear()
transaction_type = None
transaction.get_handle() transaction.get_handle()
transaction.update_db() transaction.update_db()
set_packages_list() if (transaction_type == "install") or (transaction_type == "remove"):
transaction_type = None
set_packages_list()
else:
transaction_type = None
if mode == 'updater': if mode == 'updater':
have_updates() have_updates()
@ -473,10 +479,10 @@ def handle_reply(reply):
#while Gtk.events_pending(): #while Gtk.events_pending():
# Gtk.main_iteration() # Gtk.main_iteration()
if reply: if reply:
transaction.InfoDialog.format_secondary_text(reply) InfoDialog.format_secondary_text(reply)
response = transaction.InfoDialog.run() response = InfoDialog.run()
if response: if response:
transaction.InfoDialog.hide() InfoDialog.hide()
transaction.t_lock = False transaction.t_lock = False
try: try:
transaction.Release() transaction.Release()
@ -510,7 +516,7 @@ def do_refresh():
ProgressWindow.show_all() ProgressWindow.show_all()
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration() Gtk.main_iteration()
transaction.Refresh()#reply_handler = handle_reply, error_handler = handle_error, timeout = 2000*1000) transaction.Refresh()
def have_updates(): def have_updates():
do_syncfirst, updates = transaction.get_updates() do_syncfirst, updates = transaction.get_updates()
@ -601,7 +607,7 @@ def finalize():
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration() Gtk.main_iteration()
try: try:
transaction.Commit()#reply_handler = handle_reply, error_handler = handle_error, timeout = 2000*1000) transaction.Commit()
except dbus.exceptions.DBusException as e: except dbus.exceptions.DBusException as e:
handle_error(str(e)) handle_error(str(e))
@ -781,10 +787,10 @@ def check_conflicts(mode, pkg_list):
transaction.to_add.append(pkg.name) transaction.to_add.append(pkg.name)
print('check result:', 'to add:', transaction.to_add, 'to remove:', transaction.to_remove) print('check result:', 'to add:', transaction.to_add, 'to remove:', transaction.to_remove)
if warning: if warning:
transaction.WarningDialog.format_secondary_text(warning) WarningDialog.format_secondary_text(warning)
response = transaction.WarningDialog.run() response = WarningDialog.run()
if response: if response:
transaction.WarningDialog.hide() WarningDialog.hide()
if error: if error:
handle_error(error) handle_error(error)
@ -823,10 +829,10 @@ class Handler:
def on_Manager_ValidButton_clicked(self, *arg): def on_Manager_ValidButton_clicked(self, *arg):
if not transaction_dict: if not transaction_dict:
transaction.ErrorDialog.format_secondary_text(_('No package is selected')) ErrorDialog.format_secondary_text(_('No package is selected'))
response = transaction.ErrorDialog.run() response = ErrorDialog.run()
if response: if response:
transaction.ErrorDialog.hide() ErrorDialog.hide()
else: else:
if transaction.t_lock is True: if transaction.t_lock is True:
print('Transaction locked') print('Transaction locked')
@ -864,10 +870,10 @@ class Handler:
set_transaction_sum() set_transaction_sum()
ConfDialog.show_all() ConfDialog.show_all()
else: else:
transaction.WarningDialog.format_secondary_text(_('Nothing to do')) WarningDialog.format_secondary_text(_('Nothing to do'))
response = transaction.WarningDialog.run() response = WarningDialog.run()
if response: if response:
transaction.WarningDialog.hide() WarningDialog.hide()
transaction.t_lock = False transaction.t_lock = False
def on_Manager_EraseButton_clicked(self, *arg): def on_Manager_EraseButton_clicked(self, *arg):
@ -1047,10 +1053,10 @@ class Handler:
def main(_mode): def main(_mode):
if common.pid_file_exists(): if common.pid_file_exists():
transaction.ErrorDialog.format_secondary_text(_('Pamac is already running')) ErrorDialog.format_secondary_text(_('Pamac is already running'))
response = transaction.ErrorDialog.run() response = ErrorDialog.run()
if response: if response:
transaction.ErrorDialog.hide() ErrorDialog.hide()
else: else:
common.write_pid_file() common.write_pid_file()
global mode global mode

View File

@ -1,8 +1,6 @@
#! /usr/bin/python3 #! /usr/bin/python3
# -*- coding:utf-8 -*- # -*- coding:utf-8 -*-
from gi.repository import Gtk
import pyalpm import pyalpm
from collections import OrderedDict from collections import OrderedDict
import dbus import dbus
@ -19,14 +17,6 @@ handle = None
syncpkgs = OrderedDict() syncpkgs = OrderedDict()
localpkgs = OrderedDict() localpkgs = OrderedDict()
interface = Gtk.Builder()
interface.add_from_file('/usr/share/pamac/gui/dialogs.glade')
ErrorDialog = interface.get_object('ErrorDialog')
WarningDialog = interface.get_object('WarningDialog')
#QuestionDialog = interface.get_object('QuestionDialog')
InfoDialog = interface.get_object('InfoDialog')
def get_handle(): def get_handle():
global handle global handle
handle = config.handle() handle = config.handle()
@ -69,10 +59,6 @@ def init_transaction(**options):
t_lock = True t_lock = True
return True return True
else: else:
ErrorDialog.format_secondary_text('Init Error:\n'+str(error))
response = ErrorDialog.run()
if response:
ErrorDialog.hide()
return False return False
def get_to_remove(): def get_to_remove():
@ -87,7 +73,20 @@ def get_updates():
"""Return a list of package objects in local db which can be updated""" """Return a list of package objects in local db which can be updated"""
do_syncfirst = False do_syncfirst = False
list_first = [] list_first = []
#update_db() _ignorepkgs = []
update_db()
for group in handle.ignoregrps:
db = handle.get_localdb()
grp = db.read_grp(group)
if grp:
name, pkg_list = grp
for pkg in pkg_list:
if not pkg.name in _ignorepkgs:
_ignorepkgs.append(pkg.name)
for pkgname in handle.ignorepkgs:
if pkgname in localpkgs.keys():
if not pkgname in _ignorepkgs:
_ignorepkgs.append(pkgname)
if config.syncfirst: if config.syncfirst:
for name in config.syncfirst: for name in config.syncfirst:
if name in localpkgs.keys(): if name in localpkgs.keys():
@ -101,5 +100,6 @@ def get_updates():
for pkg in localpkgs.values(): for pkg in localpkgs.values():
candidate = pyalpm.sync_newversion(pkg, handle.get_syncdbs()) candidate = pyalpm.sync_newversion(pkg, handle.get_syncdbs())
if candidate: if candidate:
result.append(candidate) if not candidate.name in _ignorepkgs:
result.append(candidate)
return do_syncfirst, result return do_syncfirst, result

128
po/fr.po
View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: pamac\n" "Project-Id-Version: pamac\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-03-31 18:55+0200\n" "POT-Creation-Date: 2013-04-10 16:13+0200\n"
"PO-Revision-Date: 2013-03-30 15:18+0100\n" "PO-Revision-Date: 2013-03-30 15:18+0100\n"
"Last-Translator: <elvirolo@gmail.com>\n" "Last-Translator: <elvirolo@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -17,64 +17,70 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: pamac-daemon.py:30 pamac/main.py:594 #: pamac-daemon.py:29 pamac/main.py:602
msgid "Preparing" msgid "Preparing"
msgstr "Préparation" msgstr "Préparation"
#: pamac-daemon.py:69 #: pamac-daemon.py:68
msgid "Checking dependencies" msgid "Checking dependencies"
msgstr "Vérification des dépendances" msgstr "Vérification des dépendances"
#: pamac-daemon.py:72 #: pamac-daemon.py:71
msgid "Checking file conflicts" msgid "Checking file conflicts"
msgstr "Analyse des conflits entre fichiers" msgstr "Analyse des conflits entre fichiers"
#: pamac-daemon.py:75 #: pamac-daemon.py:74
msgid "Resolving dependencies" msgid "Resolving dependencies"
msgstr "Résolution des dépendances" msgstr "Résolution des dépendances"
#: pamac-daemon.py:78 #: pamac-daemon.py:77
msgid "Checking inter conflicts" msgid "Checking inter conflicts"
msgstr "Recherche des conflits entre paquets" msgstr "Recherche des conflits entre paquets"
#: pamac-daemon.py:81 pamac/main.py:73 #: pamac-daemon.py:80 pamac/main.py:75
msgid "Installing" msgid "Installing"
msgstr "Installation" msgstr "Installation"
#: pamac-daemon.py:88 pamac/main.py:73 #: pamac-daemon.py:87 pamac/main.py:75
msgid "Removing" msgid "Removing"
msgstr "Désinstallation" msgstr "Désinstallation"
#: pamac-daemon.py:95 pamac/main.py:73 #: pamac-daemon.py:94 pamac/main.py:75
msgid "Upgrading" msgid "Upgrading"
msgstr "Mise à jour" msgstr "Mise à jour"
#: pamac-daemon.py:102 #: pamac-daemon.py:101
msgid "Checking integrity" msgid "Checking integrity"
msgstr "Vérification de l'intégrité des paquets" msgstr "Vérification de l'intégrité des paquets"
#: pamac-daemon.py:106 #: pamac-daemon.py:105
#, fuzzy
msgid "Loading packages files" msgid "Loading packages files"
msgstr "Chargement des fichiers des paquets" msgstr "Chargement des fichiers des paquets"
#: pamac-daemon.py:110 pamac/main.py:73 #: pamac-daemon.py:109 pamac/main.py:75
msgid "Configuring" msgid "Configuring"
msgstr "Configuration" msgstr "Configuration"
#: pamac-daemon.py:162 #: pamac-daemon.py:116
#, fuzzy
msgid "Checking keys in keyring"
msgstr "Vérification des clés dans le trousseau"
#: pamac-daemon.py:165
msgid "Downloading {size}" msgid "Downloading {size}"
msgstr "Téléchargement de {size}" msgstr "Téléchargement de {size}"
#: pamac-daemon.py:167 pamac/main.py:504 #: pamac-daemon.py:170 pamac/main.py:512
msgid "Refreshing" msgid "Refreshing"
msgstr "Actualisation" msgstr "Actualisation"
#: pamac-daemon.py:270 pamac-daemon.py:378 pamac-daemon.py:386 #: pamac-daemon.py:289 pamac-daemon.py:397 pamac-daemon.py:405
#: pamac-daemon.py:408 #: pamac-daemon.py:427
msgid "Authentication failed" msgid "Authentication failed"
msgstr "L'authentification a échoué" msgstr "L'authentification a échoué"
#: pamac-daemon.py:374 #: pamac-daemon.py:393
msgid "Transaction successfully finished" msgid "Transaction successfully finished"
msgstr "Transaction terminée avec succès" msgstr "Transaction terminée avec succès"
@ -102,143 +108,147 @@ msgstr "Exécuter pamac-manager"
msgid "Quit" msgid "Quit"
msgstr "Quitter" msgstr "Quitter"
#: pamac/main.py:110 pamac/main.py:923 #: pamac/main.py:112 pamac/main.py:947
msgid "Installed" msgid "Installed"
msgstr "Installé" msgstr "Installé"
#: pamac/main.py:110 pamac/main.py:925 #: pamac/main.py:112 pamac/main.py:949
msgid "Uninstalled" msgid "Uninstalled"
msgstr "Non installé" msgstr "Non installé"
#: pamac/main.py:110 pamac/main.py:927 #: pamac/main.py:112 pamac/main.py:951
msgid "Orphans" msgid "Orphans"
msgstr "Orphelins" msgstr "Orphelins"
#: pamac/main.py:110 pamac/main.py:428 pamac/main.py:929 #: pamac/main.py:112 pamac/main.py:430 pamac/main.py:953
msgid "To install" msgid "To install"
msgstr "À installer" msgstr "À installer"
#: pamac/main.py:110 pamac/main.py:408 pamac/main.py:931 #: pamac/main.py:112 pamac/main.py:410 pamac/main.py:955
msgid "To remove" msgid "To remove"
msgstr "À désinstaller" msgstr "À désinstaller"
#: pamac/main.py:129 pamac/main.py:939 #: pamac/main.py:131 pamac/main.py:963
msgid "local" msgid "local"
msgstr "locaux" msgstr "locaux"
#: pamac/main.py:295 #: pamac/main.py:297
msgid "No package found" msgid "No package found"
msgstr "Aucun paquet trouvé" msgstr "Aucun paquet trouvé"
#: pamac/main.py:346 #: pamac/main.py:348
msgid "Licenses" msgid "Licenses"
msgstr "Licences" msgstr "Licences"
#: pamac/main.py:351 #: pamac/main.py:353
msgid "Depends On" msgid "Depends On"
msgstr "Dépend de" msgstr "Dépend de"
#: pamac/main.py:353 #: pamac/main.py:355
msgid "Optional Deps" msgid "Optional Deps"
msgstr "Dépendances opt." msgstr "Dépendances opt."
#: pamac/main.py:356 #: pamac/main.py:358
msgid "Required By" msgid "Required By"
msgstr "Requis par" msgstr "Requis par"
#: pamac/main.py:358 #: pamac/main.py:360
msgid "Provides" msgid "Provides"
msgstr "Fournit" msgstr "Fournit"
#: pamac/main.py:360 #: pamac/main.py:362
msgid "Replaces" msgid "Replaces"
msgstr "Remplace" msgstr "Remplace"
#: pamac/main.py:362 #: pamac/main.py:364
msgid "Conflicts With" msgid "Conflicts With"
msgstr "Est conflit avec" msgstr "Est conflit avec"
#: pamac/main.py:367 #: pamac/main.py:369
msgid "Repository" msgid "Repository"
msgstr "Dépôt" msgstr "Dépôt"
#: pamac/main.py:369 gui/manager.glade:539 #: pamac/main.py:371 gui/manager.glade:539
msgid "Groups" msgid "Groups"
msgstr "Groupes" msgstr "Groupes"
#: pamac/main.py:371 #: pamac/main.py:373
msgid "Compressed Size" msgid "Compressed Size"
msgstr "Taille compressée" msgstr "Taille compressée"
#: pamac/main.py:372 #: pamac/main.py:374
msgid "Download Size" msgid "Download Size"
msgstr "Taille du téléchargement" msgstr "Taille du téléchargement"
#: pamac/main.py:374 #: pamac/main.py:376
msgid "Installed Size" msgid "Installed Size"
msgstr "Taille après installation" msgstr "Taille après installation"
#: pamac/main.py:375 #: pamac/main.py:377
msgid "Packager" msgid "Packager"
msgstr "Paqueteur" msgstr "Paqueteur"
#: pamac/main.py:379 #: pamac/main.py:381
msgid "Install Date" msgid "Install Date"
msgstr "Installé le" msgstr "Installé le"
#: pamac/main.py:381 #: pamac/main.py:383
msgid "Explicitly installed" msgid "Explicitly installed"
msgstr "Explicitement installé" msgstr "Explicitement installé"
#: pamac/main.py:383 #: pamac/main.py:385
msgid "Installed as a dependency for another package" msgid "Installed as a dependency for another package"
msgstr "Installé comme dépendance d'un autre paquet" msgstr "Installé comme dépendance d'un autre paquet"
#: pamac/main.py:385 #: pamac/main.py:387
msgid "Unknown" msgid "Unknown"
msgstr "Inconnu" msgstr "Inconnu"
#: pamac/main.py:386 #: pamac/main.py:388
msgid "Install Reason" msgid "Install Reason"
msgstr "Motif d'installation" msgstr "Motif d'installation"
#: pamac/main.py:391 #: pamac/main.py:393
msgid "Signatures" msgid "Signatures"
msgstr "Signatures" msgstr "Signatures"
#: pamac/main.py:395 #: pamac/main.py:397
msgid "Backup files" msgid "Backup files"
msgstr "Fichiers sauvegardés" msgstr "Fichiers sauvegardés"
#: pamac/main.py:405 #: pamac/main.py:407
msgid "<big><b>Transaction Summary</b></big>" msgid "<big><b>Transaction Summary</b></big>"
msgstr "<big><b>Résumé de la transaction</b></big>" msgstr "<big><b>Résumé de la transaction</b></big>"
#: pamac/main.py:419 pamac/main.py:528 #: pamac/main.py:421 pamac/main.py:536
msgid "<b>Total download size: </b>" msgid "<b>Total download size: </b>"
msgstr "<b>Taille totale du téléchargement: </b>" msgstr "<b>Taille totale du téléchargement: </b>"
#: pamac/main.py:435 #: pamac/main.py:437
msgid "To update" msgid "To update"
msgstr "À mettre à jour" msgstr "À mettre à jour"
#: pamac/main.py:520 pamac/main.py:1048 #: pamac/main.py:528 pamac/main.py:1072
msgid "<big><b>Your system is up-to-date</b></big>" msgid "<big><b>Your system is up-to-date</b></big>"
msgstr "<big><b>Votre système est à jour</b></big>" msgstr "<big><b>Votre système est à jour</b></big>"
#: pamac/main.py:530 #: pamac/main.py:538
msgid "<big><b>1 available update</b></big>" msgid "<big><b>1 available update</b></big>"
msgstr "<big><b>1 mise à jour disponible</b></big>" msgstr "<big><b>1 mise à jour disponible</b></big>"
#: pamac/main.py:532 #: pamac/main.py:540
msgid "<big><b>{number} available updates</b></big>" msgid "<big><b>{number} available updates</b></big>"
msgstr "<big><b>{number} mises à jour disponibles</b></big>" msgstr "<big><b>{number} mises à jour disponibles</b></big>"
#: pamac/main.py:691 pamac/main.py:761 #: pamac/main.py:699 pamac/main.py:785
msgid "{pkgname1} will be replaced by {pkgname2}" msgid "{pkgname1} will be replaced by {pkgname2}"
msgstr "{pkgname1} sera remplacé par {pkgname2}" msgstr "{pkgname1} sera remplacé par {pkgname2}"
#: pamac/main.py:708 pamac/main.py:742 #: pamac/main.py:710 pamac/main.py:729 pamac/main.py:752 pamac/main.py:771
msgid "{pkgname1} conflicts with {pkgname2}"
msgstr "{pkgname1} est en conflit avec {pkgname2}"
#: pamac/main.py:724 pamac/main.py:766
msgid "" msgid ""
"{pkgname1} conflicts with {pkgname2} but cannot be removed because it is " "{pkgname1} conflicts with {pkgname2} but cannot be removed because it is "
"needed by {pkgname3}" "needed by {pkgname3}"
@ -246,11 +256,7 @@ msgstr ""
"{pkgname1} est en conflit avec {pkgname2} mais ne peut pas être désinstallé " "{pkgname1} est en conflit avec {pkgname2} mais ne peut pas être désinstallé "
"car il est requis par {pkgname3}" "car il est requis par {pkgname3}"
#: pamac/main.py:713 pamac/main.py:747 #: pamac/main.py:739
msgid "{pkgname1} conflicts with {pkgname2}"
msgstr "{pkgname1} est en conflit avec {pkgname2}"
#: pamac/main.py:723
msgid "" msgid ""
"{pkgname1} conflicts with {pkgname2}\n" "{pkgname1} conflicts with {pkgname2}\n"
"None of them will be installed" "None of them will be installed"
@ -258,7 +264,7 @@ msgstr ""
"{pkgname1} est en conflit avec {pkgname2}\n" "{pkgname1} est en conflit avec {pkgname2}\n"
"Aucun d'entre eux ne sera installé" "Aucun d'entre eux ne sera installé"
#: pamac/main.py:782 #: pamac/main.py:806
msgid "" msgid ""
"<b>{pkgname} is provided by {number} packages.\n" "<b>{pkgname} is provided by {number} packages.\n"
"Please choose the one(s) you want to install:</b>" "Please choose the one(s) you want to install:</b>"
@ -266,15 +272,15 @@ msgstr ""
"<b>{pkgname} est fourni par {number} paquets.\n" "<b>{pkgname} est fourni par {number} paquets.\n"
"Veuillez choisir celui ou ceux que vous voulez installer:</b>" "Veuillez choisir celui ou ceux que vous voulez installer:</b>"
#: pamac/main.py:808 #: pamac/main.py:832
msgid "No package is selected" msgid "No package is selected"
msgstr "Aucun paquet n'est sélectionné" msgstr "Aucun paquet n'est sélectionné"
#: pamac/main.py:849 #: pamac/main.py:873
msgid "Nothing to do" msgid "Nothing to do"
msgstr "Rien à faire" msgstr "Rien à faire"
#: pamac/main.py:1032 #: pamac/main.py:1056
msgid "Pamac is already running" msgid "Pamac is already running"
msgstr "Pamac est déjà en cours d'exécution" msgstr "Pamac est déjà en cours d'exécution"