diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-11-15 20:17:49 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-11-15 20:17:49 +0000 |
commit | ede4e23677a2a05ac9b87c4db1a4d35920c3e607 (patch) | |
tree | f2e4a621817d9080ab0e8f50b37c435d40e290e8 /package/opkg/patches/060-add-find-command.patch | |
parent | 485f9573f8ee85fbc1878901550d9887c0e18627 (diff) | |
download | upstream-ede4e23677a2a05ac9b87c4db1a4d35920c3e607.tar.gz upstream-ede4e23677a2a05ac9b87c4db1a4d35920c3e607.tar.bz2 upstream-ede4e23677a2a05ac9b87c4db1a4d35920c3e607.zip |
opkg: various additions - only wrap package descriptions when outputting to a tty, simplifies parsing descriptions with external utils - introduce -i (--nocase) flag which makes all matching operations case insensitive - introduce "find" command which searches package names and descriptions (e.g. opkg -i find "*autoconfig*")
SVN-Revision: 34202
Diffstat (limited to 'package/opkg/patches/060-add-find-command.patch')
-rw-r--r-- | package/opkg/patches/060-add-find-command.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/package/opkg/patches/060-add-find-command.patch b/package/opkg/patches/060-add-find-command.patch new file mode 100644 index 0000000000..219df10187 --- /dev/null +++ b/package/opkg/patches/060-add-find-command.patch @@ -0,0 +1,58 @@ +--- 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; +@@ -612,6 +612,9 @@ opkg_list_cmd(int argc, char **argv) + /* 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)) + continue; ++ if (pkg_name && use_desc && pkg->description && ++ fnmatch(pkg_name, pkg->description, conf->nocase)) ++ continue; + print_pkg(pkg); + } + pkg_vec_free(available); +@@ -619,6 +622,18 @@ opkg_list_cmd(int argc, char **argv) + 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) +@@ -1262,6 +1277,7 @@ static opkg_cmd_t cmds[] = { + {"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"); |