diff mbox

[pacman-dev] Show install status during file search

Message ID 20180611201756.8044-1-morganamilo@gmail.com
State Superseded, archived
Headers show

Commit Message

morganamilo June 11, 2018, 8:17 p.m. UTC
When doing "pacman -Fs", show the "[installed: version]"
message just like "pacman -Ss".

Signed-off-by: morganamilo <morganamilo@gmail.com>
---
 src/pacman/files.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Allan McRae Aug. 10, 2018, 2:58 a.m. UTC | #1
On 12/06/18 06:17, morganamilo wrote:
> When doing "pacman -Fs", show the "[installed: version]"
> message just like "pacman -Ss".
> 
> Signed-off-by: morganamilo <morganamilo@gmail.com>
> ---


Something not quite right here.   Note I have pacman-git installed.

allan@kamala ~/arch/code/pacman (patchqueue)
$ ./src/pacman/pacman -Fs pacman
core/pacman 5.1.1-1
    usr/bin/pacman

    usr/share/bash-completion/completions/pacman
extra/xscreensaver 5.39-1
    usr/lib/xscreensaver/pacman

allan@kamala ~/arch/code/pacman (patchqueue)
$ pacman -Fs pacman
core/pacman 5.1.1-1
    usr/bin/pacman
    usr/share/bash-completion/completions/pacman
extra/xscreensaver 5.39-1
    usr/lib/xscreensaver/pacman




>  src/pacman/files.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pacman/files.c b/src/pacman/files.c
> index d7fc5446..65e6ad26 100644
> --- a/src/pacman/files.c
> +++ b/src/pacman/files.c
> @@ -101,6 +101,7 @@ static int files_fileowner(alpm_list_t *syncs, alpm_list_t *targets) {
>  
>  static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
>  	int ret = 0;
> +	alpm_db_t *db_local = alpm_get_localdb(config->handle);
>  	alpm_list_t *t;
>  	const colstr_t *colstr = &config->colstr;
>  
> @@ -157,13 +158,15 @@ static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
>  						printf("%s/%s\n", alpm_db_get_name(repo), alpm_pkg_get_name(pkg));
>  					} else {
>  						alpm_list_t *ml;
> -						printf("%s%s/%s%s %s%s%s\n", colstr->repo, alpm_db_get_name(repo),
> +						printf("%s%s/%s%s %s%s%s", colstr->repo, alpm_db_get_name(repo),
>  							colstr->title, alpm_pkg_get_name(pkg),
>  							colstr->version, alpm_pkg_get_version(pkg), colstr->nocolor);
>  
> +						print_installed(db_local, pkg);
> +
>  						for(ml = match; ml; ml = alpm_list_next(ml)) {
>  							c = ml->data;
> -							printf("    %s\n", c);
> +							printf("\n    %s\n", c);
>  						}
>  					}
>  					alpm_list_free(match);
>
diff mbox

Patch

diff --git a/src/pacman/files.c b/src/pacman/files.c
index d7fc5446..65e6ad26 100644
--- a/src/pacman/files.c
+++ b/src/pacman/files.c
@@ -101,6 +101,7 @@  static int files_fileowner(alpm_list_t *syncs, alpm_list_t *targets) {
 
 static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
 	int ret = 0;
+	alpm_db_t *db_local = alpm_get_localdb(config->handle);
 	alpm_list_t *t;
 	const colstr_t *colstr = &config->colstr;
 
@@ -157,13 +158,15 @@  static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
 						printf("%s/%s\n", alpm_db_get_name(repo), alpm_pkg_get_name(pkg));
 					} else {
 						alpm_list_t *ml;
-						printf("%s%s/%s%s %s%s%s\n", colstr->repo, alpm_db_get_name(repo),
+						printf("%s%s/%s%s %s%s%s", colstr->repo, alpm_db_get_name(repo),
 							colstr->title, alpm_pkg_get_name(pkg),
 							colstr->version, alpm_pkg_get_version(pkg), colstr->nocolor);
 
+						print_installed(db_local, pkg);
+
 						for(ml = match; ml; ml = alpm_list_next(ml)) {
 							c = ml->data;
-							printf("    %s\n", c);
+							printf("\n    %s\n", c);
 						}
 					}
 					alpm_list_free(match);