Fix handling of ignored packages
Noted in FS#23342. When the user attempts to install an ignored package and answers no when asked whether to install it, pacman bails out with: "error: target not found: packagename" This is because satisfiers are not found for the package and execution continues to process_group(), where the package is treated as a group (which does not exist). In addition, test ignore006.py is updated with PACMAN_RETCODE=0 since saying no to installing an ignored package should not be considered an error. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f6716ae94a
commit
58df372be6
2 changed files with 8 additions and 1 deletions
|
@ -663,6 +663,13 @@ static int process_targname(alpm_list_t *dblist, char *targname)
|
||||||
{
|
{
|
||||||
pmpkg_t *pkg = alpm_find_dbs_satisfier(dblist, targname);
|
pmpkg_t *pkg = alpm_find_dbs_satisfier(dblist, targname);
|
||||||
|
|
||||||
|
/* #FS23342 - skip ignored packages when user says no */
|
||||||
|
if(pm_errno == PM_ERR_PKG_IGNORED) {
|
||||||
|
pm_printf(PM_LOG_WARNING, _("skipping target: %s\n"), targname);
|
||||||
|
pm_errno = 0;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
if(pkg) {
|
if(pkg) {
|
||||||
return(process_pkg(pkg));
|
return(process_pkg(pkg));
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,5 @@ self.addpkg2db("sync", pkg)
|
||||||
self.option["IgnorePkg"] = ["package1"]
|
self.option["IgnorePkg"] = ["package1"]
|
||||||
self.args = "--ask=1 -S %s" % pkg.name
|
self.args = "--ask=1 -S %s" % pkg.name
|
||||||
|
|
||||||
self.addrule("PACMAN_RETCODE=1")
|
self.addrule("PACMAN_RETCODE=0")
|
||||||
self.addrule("!PKG_EXIST=package1")
|
self.addrule("!PKG_EXIST=package1")
|
||||||
|
|
Loading…
Add table
Reference in a new issue