summaryrefslogtreecommitdiff
path: root/testing/grep
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-04-26 00:01:31 +0000
committerroot <root@rshg054.dnsready.net>2012-04-26 00:01:31 +0000
commit00e1a2f0886e471d594c22dc14fc9d80ce5098c4 (patch)
treeb8c721e8b8050ead04f92a5051e4bee881defa9b /testing/grep
parent98bf2ac3fdd6f7bcb6ce45c932fc13c07fecc03f (diff)
Thu Apr 26 00:01:31 UTC 2012
Diffstat (limited to 'testing/grep')
-rw-r--r--testing/grep/PKGBUILD37
-rw-r--r--testing/grep/grep-2.11-exclude-dir-crash.patch44
-rw-r--r--testing/grep/grep.install21
3 files changed, 102 insertions, 0 deletions
diff --git a/testing/grep/PKGBUILD b/testing/grep/PKGBUILD
new file mode 100644
index 000000000..bb3622721
--- /dev/null
+++ b/testing/grep/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 157149 2012-04-25 02:48:51Z allan $
+# Maintainer: Allan McRae <allan@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
+
+pkgname=grep
+pkgver=2.12
+pkgrel=1
+pkgdesc="A string search utility"
+arch=('i686' 'x86_64')
+license=('GPL3')
+url="http://www.gnu.org/software/grep/grep.html"
+groups=('base')
+depends=('glibc' 'pcre' 'sh')
+makedepends=('texinfo')
+install=${pkgname}.install
+source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz{,.sig})
+md5sums=('8d2f0346d08b13c18afb81f0e8aa1e2f'
+ '7a25f2ece647b8637f4ae1de474712e7')
+
+build() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ ./configure --prefix=/usr --without-included-regex
+ make
+}
+
+check() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make check
+}
+
+package() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR=${pkgdir} install
+
+ install -dm755 ${pkgdir}/bin
+ ln -s /usr/bin/grep ${pkgdir}/bin/grep
+}
diff --git a/testing/grep/grep-2.11-exclude-dir-crash.patch b/testing/grep/grep-2.11-exclude-dir-crash.patch
new file mode 100644
index 000000000..6b1731768
--- /dev/null
+++ b/testing/grep/grep-2.11-exclude-dir-crash.patch
@@ -0,0 +1,44 @@
+From 12c957f786b12a4dd116f9c40a715d671d17fa16 Mon Sep 17 00:00:00 2001
+From: Allan McRae <allan@archlinux.org>
+Date: Mon, 12 Mar 2012 09:28:01 +0100
+Subject: [PATCH] grep: fix segfault with -r --exclude-dir and no file operand
+
+* src/main.c (grepdir): Don't invoke excluded_file_name on NULL.
+* NEWS (Bug fixes): Mention it.
+---
+ NEWS | 5 +++++
+ src/main.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index d0a63d5..d4d70f5 100644
+--- a/NEWS
++++ b/NEWS
+@@ -2,6 +2,11 @@ GNU grep NEWS -*- outline -*-
+
+ * Noteworthy changes in release ?.? (????-??-??) [?]
+
++** Bug fixes
++
++ grep no longer segfaults with -r --exclude-dir and no file operand.
++ I.e., ":|grep -r --exclude-dir=D PAT" would segfault.
++
+
+ * Noteworthy changes in release 2.11 (2012-03-02) [stable]
+
+diff --git a/src/main.c b/src/main.c
+index 2f6c761..f4f1235 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -1361,7 +1361,7 @@ grepdir (char const *dir, struct stats const *stats)
+ struct stats const *ancestor;
+ char *name_space;
+ int status = 1;
+- if (excluded_directory_patterns
++ if (dir && excluded_directory_patterns
+ && excluded_file_name (excluded_directory_patterns, dir))
+ return 1;
+
+--
+1.7.9.3
+
diff --git a/testing/grep/grep.install b/testing/grep/grep.install
new file mode 100644
index 000000000..7cd31301f
--- /dev/null
+++ b/testing/grep/grep.install
@@ -0,0 +1,21 @@
+infodir=usr/share/info
+filelist=(grep.info)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+