opkg: fix find logic introduced by previous commit

SVN-Revision: 34203
This commit is contained in:
Jo-Philipp Wich 2012-11-15 20:53:51 +00:00
parent ede4e23677
commit 24b102fc3c

View File

@ -9,17 +9,17 @@
{ {
int i; int i;
pkg_vec_t *available; pkg_vec_t *available;
@@ -612,6 +612,9 @@ opkg_list_cmd(int argc, char **argv) @@ -610,7 +610,8 @@ opkg_list_cmd(int argc, char **argv)
for (i=0; i < available->len; i++) {
pkg = available->pkgs[i];
/* if we have package name or pattern and pkg does not match, then skip it */ /* if we have package name or pattern and pkg does not match, then skip it */
if (pkg_name && fnmatch(pkg_name, pkg->name, conf->nocase)) - if (pkg_name && fnmatch(pkg_name, pkg->name, conf->nocase))
+ if (pkg_name && fnmatch(pkg_name, pkg->name, conf->nocase) &&
+ (!use_desc || !pkg->description || fnmatch(pkg_name, pkg->description, conf->nocase)))
continue; continue;
+ if (pkg_name && use_desc && pkg->description &&
+ fnmatch(pkg_name, pkg->description, conf->nocase))
+ continue;
print_pkg(pkg); print_pkg(pkg);
} }
pkg_vec_free(available); @@ -619,6 +620,18 @@ opkg_list_cmd(int argc, char **argv)
@@ -619,6 +622,18 @@ opkg_list_cmd(int argc, char **argv)
return 0; return 0;
} }
@ -38,7 +38,7 @@
static int static int
opkg_list_installed_cmd(int argc, char **argv) opkg_list_installed_cmd(int argc, char **argv)
@@ -1262,6 +1277,7 @@ static opkg_cmd_t cmds[] = { @@ -1262,6 +1275,7 @@ static opkg_cmd_t cmds[] = {
{"configure", 0, (opkg_cmd_fun_t)opkg_configure_cmd, PFM_DESCRIPTION|PFM_SOURCE}, {"configure", 0, (opkg_cmd_fun_t)opkg_configure_cmd, PFM_DESCRIPTION|PFM_SOURCE},
{"files", 1, (opkg_cmd_fun_t)opkg_files_cmd, PFM_DESCRIPTION|PFM_SOURCE}, {"files", 1, (opkg_cmd_fun_t)opkg_files_cmd, PFM_DESCRIPTION|PFM_SOURCE},
{"search", 1, (opkg_cmd_fun_t)opkg_search_cmd, PFM_DESCRIPTION|PFM_SOURCE}, {"search", 1, (opkg_cmd_fun_t)opkg_search_cmd, PFM_DESCRIPTION|PFM_SOURCE},