2012-11-15 22:17:49 +02:00
|
|
|
--- a/libopkg/opkg_cmd.c
|
|
|
|
+++ b/libopkg/opkg_cmd.c
|
|
|
|
@@ -594,7 +594,7 @@ opkg_download_cmd(int argc, char **argv)
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
-opkg_list_cmd(int argc, char **argv)
|
|
|
|
+opkg_list_find_cmd(int argc, char **argv, int use_desc)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
pkg_vec_t *available;
|
2012-11-15 22:53:51 +02:00
|
|
|
@@ -610,7 +610,8 @@ opkg_list_cmd(int argc, char **argv)
|
|
|
|
for (i=0; i < available->len; i++) {
|
|
|
|
pkg = available->pkgs[i];
|
2012-11-15 22:17:49 +02:00
|
|
|
/* if we have package name or pattern and pkg does not match, then skip it */
|
2012-11-15 22:53:51 +02:00
|
|
|
- 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)))
|
2012-11-15 22:17:49 +02:00
|
|
|
continue;
|
|
|
|
print_pkg(pkg);
|
|
|
|
}
|
2012-11-15 22:53:51 +02:00
|
|
|
@@ -619,6 +620,18 @@ opkg_list_cmd(int argc, char **argv)
|
2012-11-15 22:17:49 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+opkg_list_cmd(int argc, char **argv)
|
|
|
|
+{
|
|
|
|
+ return opkg_list_find_cmd(argc, argv, 0);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
+opkg_find_cmd(int argc, char **argv)
|
|
|
|
+{
|
|
|
|
+ return opkg_list_find_cmd(argc, argv, 1);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
static int
|
|
|
|
opkg_list_installed_cmd(int argc, char **argv)
|
2012-11-15 22:53:51 +02:00
|
|
|
@@ -1262,6 +1275,7 @@ static opkg_cmd_t cmds[] = {
|
2012-11-15 22:17:49 +02:00
|
|
|
{"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},
|
|
|
|
{"search", 1, (opkg_cmd_fun_t)opkg_search_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
|
|
|
+ {"find", 1, (opkg_cmd_fun_t)opkg_find_cmd, PFM_SOURCE},
|
|
|
|
{"download", 1, (opkg_cmd_fun_t)opkg_download_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
|
|
|
{"compare_versions", 1, (opkg_cmd_fun_t)opkg_compare_versions_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
|
|
|
{"compare-versions", 1, (opkg_cmd_fun_t)opkg_compare_versions_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
|
|
|
--- a/src/opkg-cl.c
|
|
|
|
+++ b/src/opkg-cl.c
|
|
|
|
@@ -246,6 +246,7 @@ usage()
|
|
|
|
printf("\tlist-changed-conffiles List user modified configuration files\n");
|
|
|
|
printf("\tfiles <pkg> List files belonging to <pkg>\n");
|
|
|
|
printf("\tsearch <file|regexp> List package providing <file>\n");
|
|
|
|
+ printf("\tfind <regexp> List packages whose name or description matches <regexp>\n");
|
|
|
|
printf("\tinfo [pkg|regexp] Display all info for <pkg>\n");
|
|
|
|
printf("\tstatus [pkg|regexp] Display all status for <pkg>\n");
|
|
|
|
printf("\tdownload <pkg> Download <pkg> to current directory\n");
|