mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
libalpm: Fix installing update of a replaced package
During a sysupgrade, if a package is replaced by another, and an update for the former package is found (on another repo) the replaced package would be re-installed. Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
a98bb96b43
commit
1b39653e96
@ -396,6 +396,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
alpm_pkg_t *spkg = i->data;
|
alpm_pkg_t *spkg = i->data;
|
||||||
for(j = spkg->removes; j; j = j->next) {
|
for(j = spkg->removes; j; j = j->next) {
|
||||||
remove = alpm_list_add(remove, j->data);
|
remove = alpm_list_add(remove, j->data);
|
||||||
|
/* do not re-install a (replaced) package even if an update is available */
|
||||||
|
trans->add = alpm_list_remove(trans->add, j->data, _alpm_pkg_cmp, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
18
test/pacman/tests/sync1104.py
Normal file
18
test/pacman/tests/sync1104.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
self.description = "Don't update (reinstall) a replaced package"
|
||||||
|
|
||||||
|
lp = pmpkg("old", "1-1")
|
||||||
|
self.addpkg2db("local", lp)
|
||||||
|
|
||||||
|
p1 = pmpkg("new")
|
||||||
|
p1.provides = ["old"]
|
||||||
|
p1.replaces = ["old"]
|
||||||
|
self.addpkg2db("sync1", p1)
|
||||||
|
|
||||||
|
p2 = pmpkg("old", "1-2")
|
||||||
|
self.addpkg2db("sync2", p2)
|
||||||
|
|
||||||
|
self.args = "-Su"
|
||||||
|
|
||||||
|
self.addrule("PACMAN_RETCODE=0")
|
||||||
|
self.addrule("!PKG_EXIST=old")
|
||||||
|
self.addrule("PKG_EXIST=new")
|
Loading…
x
Reference in New Issue
Block a user