summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-06 19:49:41 -0500
committerDan McGee <dan@archlinux.org>2008-04-06 19:49:41 -0500
commit404e0a0e10c1fbf9732f32a8c4bd466b026c34b1 (patch)
tree988e1184887b7458a8a93fa62a3e3b257df31691 /src
parent073bac794d7643fae21dacbe3d5c1585ce347bea (diff)
Add quiet printout to --owns functionality
If we specify -q/--quiet on an --owns operation, only print a matching package name rather than the verbose human-readable message. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/query.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 90ff3773..b40359ed 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -1,7 +1,7 @@
/*
* query.c
*
- * Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
+ * Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -119,8 +119,13 @@ static int query_fileowner(alpm_list_t *targets)
free(pdname);
if(ppath && strcmp(ppath, rpath) == 0) {
- printf(_("%s is owned by %s %s\n"), filename,
- alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ if (!config->quiet) {
+ printf(_("%s is owned by %s %s\n"), filename,
+ alpm_pkg_get_name(info), alpm_pkg_get_version(info));
+ } else {
+ printf("%s %s\n", alpm_pkg_get_name(info),
+ alpm_pkg_get_version(info));
+ }
found = 1;
}
free(ppath);