From bb9647c459e236eed28715ed3cc6ca387ba246f0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 15 Nov 2012 20:17:49 +0000 Subject: 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*") git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34202 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../040-wrap-descriptions-only-on-ttys.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch (limited to 'package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch') diff --git a/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch b/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch new file mode 100644 index 0000000000..95406687b6 --- /dev/null +++ b/package/opkg/patches/040-wrap-descriptions-only-on-ttys.patch @@ -0,0 +1,31 @@ +--- a/libopkg/pkg_parse.c ++++ b/libopkg/pkg_parse.c +@@ -20,6 +20,7 @@ + + #include + #include ++#include + + #include "pkg.h" + #include "opkg_utils.h" +@@ -239,10 +240,16 @@ pkg_parse_line(void *ptr, const char *li + + case ' ': + if ((mask & PFM_DESCRIPTION) && reading_description) { +- pkg->description = xrealloc(pkg->description, +- strlen(pkg->description) +- + 1 + strlen(line) + 1); +- strcat(pkg->description, "\n"); ++ if (isatty(1)) { ++ pkg->description = xrealloc(pkg->description, ++ strlen(pkg->description) ++ + 1 + strlen(line) + 1); ++ strcat(pkg->description, "\n"); ++ } else { ++ pkg->description = xrealloc(pkg->description, ++ strlen(pkg->description) ++ + 1 + strlen(line)); ++ } + strcat(pkg->description, (line)); + goto dont_reset_flags; + } else if ((mask & PFM_CONFFILES) && reading_conffiles) { -- cgit v1.2.3