aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2004-11-28 03:30:10 +0000
committerJason Woodward2004-11-28 03:30:10 +0000
commitf597bad0f9808e222776dcc8caa482a05fcaee95 (patch)
tree99c52ff251d92e1e6185fd523f08bc6463703976
parent94255d5ec48497a2149c0f5890e5a6757cb680e0 (diff)
downloadslapt-get-f597bad0f9808e222776dcc8caa482a05fcaee95.tar.gz
make --search show installed packages that aren't present in available package list from current sources
-rw-r--r--ChangeLog4
-rw-r--r--src/action.c17
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ae073a..b08e2c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
-0.9.9e Nov 26, 2004
+0.9.9e Nov 27, 2004
+ * make --search show installed packages that aren't present in available
+ package list from current sources
* updated typedefs
* renamed transaction to transaction_t for clarity
* fixed bug in add_deps_to_trans() where check for exclude was catching
diff --git a/src/action.c b/src/action.c
index 831d422..a1a41f2 100644
--- a/src/action.c
+++ b/src/action.c
@@ -250,12 +250,27 @@ 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();
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++){
+ /* only if they didn't already show up from the available packages */
+ if( get_exact_pkg(matches,imatches->pkgs[i]->name,imatches->pkgs[i]->version) == NULL ){
+ /* no package description parsed from installed pkg at the moment */
+ printf("%s %s [inst=%s]\n",
+ imatches->pkgs[i]->name,
+ imatches->pkgs[i]->version,
+ _("yes")
+ );
+ }
+ }
for(i = 0; i < matches->pkg_count; i++){
int bool_installed = 0;
@@ -280,6 +295,8 @@ void pkg_action_search(const char *pattern){
/* free_pkg_list(matches) */
free(matches->pkgs);
free(matches);
+ free(imatches->pkgs);
+ free(imatches);
free_pkg_list(pkgs);
free_pkg_list(installed_pkgs);