From e2268d59a61d292b8b8c802ce0709d3f6a6d8441 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 2 May 2010 16:18:05 +0200 Subject: [PATCH] new package: - add package grep, we need an full featured grep for upcoming pm-utils --- packages/sysutils/busybox/install | 3 ++ packages/sysutils/grep/build | 14 +++++++ packages/sysutils/grep/install | 6 +++ .../grep/patches/10-grep_fix-0.1.diff | 42 +++++++++++++++++++ packages/sysutils/grep/url | 1 + 5 files changed, 66 insertions(+) create mode 100755 packages/sysutils/grep/build create mode 100755 packages/sysutils/grep/install create mode 100644 packages/sysutils/grep/patches/10-grep_fix-0.1.diff create mode 100644 packages/sysutils/grep/url diff --git a/packages/sysutils/busybox/install b/packages/sysutils/busybox/install index 3fdc1919e3..c625bf2074 100755 --- a/packages/sysutils/busybox/install +++ b/packages/sysutils/busybox/install @@ -55,3 +55,6 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`" mkdir -p $INSTALL/etc/network cp $PKG_DIR/config/interfaces $INSTALL/etc/network + +# we need an full-featured grep for pm-utils, so we install this :-( + $SCRIPTS/install grep diff --git a/packages/sysutils/grep/build b/packages/sysutils/grep/build new file mode 100755 index 0000000000..05c6f139e4 --- /dev/null +++ b/packages/sysutils/grep/build @@ -0,0 +1,14 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +cd $PKG_BUILD +./configure --host=$TARGET_NAME \ + --build=$HOST_NAME \ + --prefix=/usr \ + --enable-shared \ + --disable-static \ + +make \ No newline at end of file diff --git a/packages/sysutils/grep/install b/packages/sysutils/grep/install new file mode 100755 index 0000000000..fda81c3a2a --- /dev/null +++ b/packages/sysutils/grep/install @@ -0,0 +1,6 @@ +#!/bin/sh + +. config/options + +mkdir -p $INSTALL/usr/bin + cp -P $PKG_BUILD/src/grep $INSTALL/usr/bin diff --git a/packages/sysutils/grep/patches/10-grep_fix-0.1.diff b/packages/sysutils/grep/patches/10-grep_fix-0.1.diff new file mode 100644 index 0000000000..3e60903ddd --- /dev/null +++ b/packages/sysutils/grep/patches/10-grep_fix-0.1.diff @@ -0,0 +1,42 @@ +Hi Nelson, + +Thanks for the report. +I debated whether to add an entry to NEWS, but opted not to, +since it is unlikely that anyone will see the result of this fix. + +Here's the patch: + +From 651d212abe771d2a32db746895ae28dd434527b6 Mon Sep 17 00:00:00 2001 +From: Jim Meyering redhat.com> +Date: Wed, 7 Apr 2010 13:36:02 +0200 +Subject: [PATCH] grep: make kwset's obstack use xmalloc, not malloc + +This insidious bug could make grep fail to diagnose a failed malloc, +and then proceed to dereference the resulting NULL pointer. +Note that this bug was unlikely ever to cause real trouble; without +the fix, grep would segfault upon OOM, now it exits with a diagnostic. +* src/kwset.c (malloc) [GREP]: Define without the "(s)" macro +parameter, so that unadorned uses of malloc are also mapped to xmalloc. +One such use is in the expansion of obstack_init. +Report and patch by Nelson H. F. Beebe, in +http://thread.gmane.org/gmane.comp.gnu.grep.bugs/2995 +--- + src/kwset.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/kwset.c b/src/kwset.c +index 050562e..995be79 100644 +--- a/src/kwset.c ++++ b/src/kwset.c +@@ -40,7 +40,7 @@ + #ifdef GREP + # include "xalloc.h" + # undef malloc +-# define malloc(s) xmalloc(s) ++# define malloc xmalloc + #endif + + #define NCHAR (UCHAR_MAX + 1) +-- +1.7.1.rc0.212.gbd88f + diff --git a/packages/sysutils/grep/url b/packages/sysutils/grep/url new file mode 100644 index 0000000000..37b71ebbd5 --- /dev/null +++ b/packages/sysutils/grep/url @@ -0,0 +1 @@ +ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/grep/grep-2.6.3.tar.gz \ No newline at end of file