summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-30 02:46:56 +0000
committerJason Woodward2005-01-30 02:46:56 +0000
commit2d35f125b2d9e0d071abc79040142b327cbdc414 (patch)
treefcab69deab7fb6e8f4f6c5e498b4b6c2680824cc /src
parentb0a3918f479e60ddba4483c7222331a091c2f368 (diff)
downloadslapt-get-2d35f125b2d9e0d071abc79040142b327cbdc414.tar.gz
fixed bug in search, installed packages did not show up when searching by package location
Diffstat (limited to 'src')
-rw-r--r--src/action.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/action.c b/src/action.c
index ad47689..29b3766 100644
--- a/src/action.c
+++ b/src/action.c
@@ -247,48 +247,30 @@ void pkg_action_search(const char *pattern){
struct pkg_list *pkgs = NULL;
struct pkg_list *installed_pkgs = NULL;
struct pkg_list *matches = NULL;
- struct pkg_list *imatches = NULL;
/* read in pkg data */
pkgs = get_available_pkgs();
installed_pkgs = get_installed_pkgs();
- /* save the searches for available and installed */
matches = search_pkg_list(pkgs,pattern);
- imatches = search_pkg_list(installed_pkgs,pattern);
-
- /* show installed packages in search */
- for(i=0;i<imatches->pkg_count;i++){
- char *short_description = gen_short_pkg_description(imatches->pkgs[i]);
- printf("%s %s [inst=%s]: %s\n",
- imatches->pkgs[i]->name,
- imatches->pkgs[i]->version,
- _("yes"),
- short_description
- );
- free(short_description);
- }
for(i = 0; i < matches->pkg_count; i++){
- char *short_description = NULL;
-
- /* did we already show it in the installed loop? */
- if( get_exact_pkg(imatches,matches->pkgs[i]->name,matches->pkgs[i]->version) != NULL )
- continue;
-
- short_description = gen_short_pkg_description(matches->pkgs[i]);
+ char *short_description = gen_short_pkg_description(matches->pkgs[i]);
printf("%s %s [inst=%s]: %s\n",
matches->pkgs[i]->name,
matches->pkgs[i]->version,
- _("no"),
+ ( get_exact_pkg( installed_pkgs,
+ matches->pkgs[i]->name,matches->pkgs[i]->version)
+ != NULL )
+ ? _("yes")
+ : _("no"),
short_description
);
free(short_description);
}
free_pkg_list(matches);
- free_pkg_list(imatches);
free_pkg_list(pkgs);
free_pkg_list(installed_pkgs);