mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-10 11:35:00 -05:00
72c0ab5c51
I divided resolvedeps into 2 functions. The new _alpm_resolvedep function will resolve one dependency, for example the 'foo>=1.0-1' dependency. It can be useful in sync_addtarget refactoring. The resolvedeps parameters were changed, to be coherent with recursedeps: * the target-list is an alpm_list* instead of alpm_list**. This is OK, because alpm_list_add == alpm_list_add_last * syncpkg param was removed. list contains the to-be-installed packages, resolvedeps will add the required dependencies into this list * trans param was removed, it was used in QUESTION() only, which can be used on the main (handle->trans) transaction only (because the front-end cannot access our pseudo-transactions at all!). The patch fixes some wrong dynamic pmdepmissing_t usage. I did a behavior change (and sync1003.py was modified accordingly), which needs some explanation: The old resolvedeps didn't elect packages from 'remove' list. I've dropped this because I don't want that 2nd excluding list param. In fact, in real life, we ~never need this rule. Resolvedeps is called before checkconflicts, so only -Su's %REPLACES% packages are sitting in 'remove' list. This means, that we have the replacement packages in our target list. Usually "foo replaces bar" means, that bar isn't in our repos any more, so resolvedeps *cannot* elect it; but usually it won't try it at all, because foo is in the target list, and it is expected to satisfy 'bar>=1.0-1'-like dependencies too. Since checkdeps and checkconflicts is done after resolvedeps, this cannot cause any harm. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
22 lines
516 B
Python
22 lines
516 B
Python
self.description = "Induced removal would break dependency"
|
|
|
|
sp1 = pmpkg("pkg1", "1.0-2")
|
|
sp1.replaces = [ "pkg2" ]
|
|
self.addpkg2db("sync", sp1)
|
|
|
|
lp2 = pmpkg("pkg2", "1.0-1")
|
|
self.addpkg2db("local", lp2)
|
|
|
|
lp3 = pmpkg("pkg3", "1.0-1")
|
|
lp3.depends = [ "pkg2=1.0" ]
|
|
self.addpkg2db("local", lp3)
|
|
|
|
self.args = "-Su"
|
|
|
|
self.addrule("PACMAN_RETCODE=1")
|
|
self.addrule("!PKG_EXIST=pkg1")
|
|
self.addrule("PKG_EXIST=pkg2")
|
|
self.addrule("PKG_EXIST=pkg3")
|
|
self.addrule("PKG_VERSION=pkg2|1.0-1")
|
|
self.addrule("PKG_VERSION=pkg3|1.0-1")
|