forked from cromer/pamac-classic
fix 2 bugs and autosyncfirst pamac
This commit is contained in:
parent
caca63de0e
commit
1bcbcc3c81
@ -26,7 +26,7 @@ def install(pkgnames):
|
||||
if not pkgname in transaction.localpkgs.keys():
|
||||
transaction.to_add.append(pkgname)
|
||||
pkg_to_install.append(transaction.syncpkgs[pkgname])
|
||||
main.check_conflicts(pkg_to_install)
|
||||
main.check_conflicts('normal', pkg_to_install)
|
||||
if transaction.to_add:
|
||||
if transaction.init_transaction(noconflicts = True, needed =True):
|
||||
for pkgname in transaction.to_add:
|
||||
|
@ -192,3 +192,5 @@ if 'HoldPkg' in pacman_conf.options:
|
||||
holdpkg = pacman_conf.options['HoldPkg']
|
||||
if 'SyncFirst' in pacman_conf.options:
|
||||
syncfirst = pacman_conf.options['SyncFirst']
|
||||
if not 'pamac' in syncfirst:
|
||||
syncfirst.append('pamac')
|
||||
|
@ -432,9 +432,9 @@ def check_conflicts(mode, pkg_list):
|
||||
error = ''
|
||||
pkgs = transaction.handle.get_localdb().search('linux3')
|
||||
installed_linux = []
|
||||
for i in pkgs:
|
||||
if len(i.name) == 7:
|
||||
installed_linux.append(i.name)
|
||||
for item in pkgs:
|
||||
if len(item.name) == 7:
|
||||
installed_linux.append(item.name)
|
||||
for to_install in transaction.to_add:
|
||||
if 'linux3' in to_install:
|
||||
if len(to_install) == 7:
|
||||
@ -517,13 +517,15 @@ def check_conflicts(mode, pkg_list):
|
||||
provide = pyalpm.find_satisfier(transaction.localpkgs.values(), conflict)
|
||||
if provide:
|
||||
if provide.name != pkg.name:
|
||||
new_provide = pyalpm.find_satisfier([transaction.syncpkgs[provide.name]], conflict)
|
||||
if new_provide:
|
||||
required = pkg.compute_requiredby()
|
||||
if required:
|
||||
str_required = ''
|
||||
for i in required:
|
||||
for item in required:
|
||||
if str_required:
|
||||
str_required += ', '
|
||||
str_required += i
|
||||
str_required += item
|
||||
if error:
|
||||
error += '\n'
|
||||
error += '{} conflicts with {} but cannot be removed because it is needed by {}'.format(provide.name, pkg.name, str_required)
|
||||
@ -548,13 +550,15 @@ def check_conflicts(mode, pkg_list):
|
||||
provide = pyalpm.find_satisfier(depends[0], conflict)
|
||||
if provide:
|
||||
if provide.name != pkg.name:
|
||||
new_provide = pyalpm.find_satisfier([transaction.syncpkgs[pkg.name]], conflict)
|
||||
if new_provide:
|
||||
required = pkg.compute_requiredby()
|
||||
if required:
|
||||
str_required = ''
|
||||
for i in required:
|
||||
for item in required:
|
||||
if str_required:
|
||||
str_required += ', '
|
||||
str_required += i
|
||||
str_required += item
|
||||
if error:
|
||||
error += '\n'
|
||||
error += '{} conflicts with {} but cannot be removed because it is needed by {}'.format(provide.name, pkg.name, str_required)
|
||||
|
Loading…
Reference in New Issue
Block a user