[pacman-dev] [PATCH 2/2] Don't print an error for valid native/foreign options

Chirantan Ekbote chirantan.ekbote at gmail.com
Mon Oct 21 03:11:00 EDT 2013


We should print an error if both --native and --foreign are passed as
options to -Q.  Instead we are currently printing an error even if only
one of them is passed to -Q.

Signed-off-by: Chirantan Ekbote <chirantan.ekbote at gmail.com>
---
 src/pacman/pacman.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index f485692..5349517 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -600,7 +600,7 @@ static void checkargs_query(void)
 	}
 
 	invalid_opt(config->op_q_deps && config->op_q_explicit, "--deps", "--explicit");
-	invalid_opt(config->op_q_locality & (PKG_LOCALITY_NATIVE | PKG_LOCALITY_FOREIGN),
+	invalid_opt(!(config->op_q_locality ^ (PKG_LOCALITY_NATIVE | PKG_LOCALITY_FOREIGN)),
 			"--native", "--foreign");
 }
 
-- 
1.8.4.1



More information about the pacman-dev mailing list