1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Handle sync target + ignore properly

Rather than say we can't find the target after saying "No, I guess I don't
want to install this", we should make sure the ignored status gets passed
all the way through. This fixes FS#19866.

Pactest is also included that failed before due to the fact that we normally
treat an unfound package as a reason to exit with a non-zero status.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2010-06-20 15:15:05 -05:00
parent 7fc50d7950
commit 6c00ca8f23
2 changed files with 15 additions and 1 deletions

View File

@ -291,7 +291,11 @@ int _alpm_sync_target(alpm_list_t *dbs_sync, char *target)
}
if(!found) {
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
/* pass through any 'found but ignored' errors */
if(pm_errno != PM_ERR_PKG_IGNORED) {
pm_errno = PM_ERR_PKG_NOT_FOUND;
}
return(-1);
}
return(0);

View File

@ -0,0 +1,10 @@
self.description = "Sync with target in ignore list and say no"
pkg = pmpkg("package1")
self.addpkg2db("sync", pkg)
self.option["IgnorePkg"] = ["package1"]
self.args = "--ask=1 -S %s" % pkg.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=package1")