1 |
commit: 8ccd45be3ade13b4bef748b7486a87b3d143afc1 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 9 10:40:07 2018 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 9 10:40:07 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=8ccd45be |
7 |
|
8 |
qsearch: avoid printing a trailing space, bug #672764 |
9 |
|
10 |
When --name-only is in effect, don't print the space separating the |
11 |
package and its description, for we won't print the latter. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/672764 |
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
qsearch.c | 9 ++++++--- |
17 |
1 file changed, 6 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/qsearch.c b/qsearch.c |
20 |
index 4fce4de..b75a4f7 100644 |
21 |
--- a/qsearch.c |
22 |
+++ b/qsearch.c |
23 |
@@ -1,9 +1,10 @@ |
24 |
/* |
25 |
- * Copyright 2005-2018 Gentoo Foundation |
26 |
+ * Copyright 2005-2018 Gentoo Authors |
27 |
* Distributed under the terms of the GNU General Public License v2 |
28 |
* |
29 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2014 Mike Frysinger - <vapier@g.o> |
31 |
+ * Copyright 2018- Fabian Groffen - <grobian@g.o |
32 |
*/ |
33 |
|
34 |
#ifdef APPLET_qsearch |
35 |
@@ -50,8 +51,9 @@ qsearch_ebuild_metadata(_q_unused_ int overlay_fd, const char *ebuild, const cha |
36 |
if (strcmp(pcache->atom->PN, last) != 0) { |
37 |
strncpy(last, pcache->atom->PN, LAST_BUF_SIZE); |
38 |
if (search_all || rematch(search_me, (search_desc ? pcache->DESCRIPTION : ebuild), REG_EXTENDED | REG_ICASE) == 0) |
39 |
- printf("%s%s/%s%s%s %s\n", BOLD, pcache->atom->CATEGORY, BLUE, |
40 |
+ printf("%s%s/%s%s%s%s%s\n", BOLD, pcache->atom->CATEGORY, BLUE, |
41 |
pcache->atom->PN, NORM, |
42 |
+ (show_name_only ? "" : " "), |
43 |
(show_name_only ? "" : |
44 |
(show_homepage ? pcache->HOMEPAGE : pcache->DESCRIPTION))); |
45 |
} |
46 |
@@ -121,8 +123,9 @@ qsearch_ebuild_ebuild(int overlay_fd, const char *ebuild, const char *search_me, |
47 |
|
48 |
if (show_it) { |
49 |
const char *pkg = basename(p); |
50 |
- printf("%s%s/%s%s%s %s\n", |
51 |
+ printf("%s%s/%s%s%s%s%s\n", |
52 |
BOLD, dirname(p), BLUE, pkg, NORM, |
53 |
+ (show_name_only ? "" : " "), |
54 |
(show_name_only ? "" : q ? : "<no DESCRIPTION found>")); |
55 |
} |