FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-20-2010, 08:26 PM
Dan McGee
 
Default 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>
---
Candidate for maint, it should be pretty straightforward.

-Dan

lib/libalpm/sync.c | 6 +++++-
test/pacman/tests/ignore006.py | 10 ++++++++++
2 files changed, 15 insertions(+), 1 deletions(-)
create mode 100644 test/pacman/tests/ignore006.py

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 67afd39..68ee8dc 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -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);
diff --git a/test/pacman/tests/ignore006.py b/test/pacman/tests/ignore006.py
new file mode 100644
index 0000000..4c1c1ca
--- /dev/null
+++ b/test/pacman/tests/ignore006.py
@@ -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")
--
1.7.1
 
Old 06-21-2010, 01:56 AM
"Allan McRae"
 
Default Handle sync target + ignore properly

On 21/06/10 06:26, Dan McGee wrote:

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>
---
Candidate for maint, it should be pretty straightforward.



Looks good for maint to me:

> sudo ./src/pacman/pacman -S abs --ignore abs
Password:
:: abs is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n
warning: skipping target: abs
there is nothing to do

Allan
 

Thread Tools




All times are GMT. The time now is 09:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org