drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/patch
-drwxr-xr-x root/root usr/share/
-drwxr-xr-x root/root usr/share/man/
-drwxr-xr-x root/root usr/share/man/man1/
--rw-r--r-- root/root usr/share/man/man1/patch.1.gz
+drwxr-xr-x root/root usr/man/
+drwxr-xr-x root/root usr/man/man1/
+-rw-r--r-- root/root usr/man/man1/patch.1.gz
-bc71d33c35004db3768465bcaf9ed23c patch-2.6.tar.gz
+afa193f8c358c5b0a520851bdf45d539 patch-2.6.1-strnlen.patch
+057d78436e858c3ed086a544f5e1fe7e patch-2.6.1.tar.xz
+617cc0a45b47a515ea3ae415e4f13072 safe-read.m4
+8520b59d8a70df0af8b1395df76c9aaf strnlen.c
+192cc9a1273d7d32cf953a8bee88aebc strnlen.m4
# Depends on:
name=patch
-version=2.6
+version=2.6.1
release=1
-source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz)
+source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.xz
+ $name-$version-strnlen.patch
+ strnlen.c strnlen.m4 safe-read.m4)
build() {
cd $name-$version
+ patch -p1 -i $SRC/$name-$version-strnlen.patch
+ cp $SRC/*.m4 gl/m4/
+ cp $SRC/strnlen.c gl/lib/
./configure --build=$CHOST \
--host=$CTARGET \
- --prefix=/usr
+ --prefix=/usr \
+ --mandir=/usr/man
- make
- make prefix=$PKG/usr install
+ make
+ make DESTDIR=$PKG install
}
--- /dev/null
+--- patch-2.6.1.orig/Makefile.in 2011-02-18 12:55:01.000000000 +0000
++++ patch-2.6.1/Makefile.in 2011-02-18 12:59:29.000000000 +0000
+@@ -91,6 +91,7 @@
+ gl/lib/stripslash.c \
+ gl/lib/strncasecmp.c \
+ gl/lib/strndup.c \
++ gl/lib/strnlen.c \
+ gl/lib/xmalloc.c \
+ gl/lib/xstrndup.c
+
+@@ -302,11 +303,13 @@
+ gl/m4/quote.m4 \
+ gl/m4/realloc.m4 \
+ gl/m4/rename.m4 \
++ gl/m4/safe-read.m4 \
+ gl/m4/safe-write.m4 \
+ gl/m4/ssize_t.m4 \
+ gl/m4/stdbool.m4 \
+ gl/m4/strcase.m4 \
+ gl/m4/strndup.m4 \
++ gl/m4/strnlen.m4 \
+ gl/m4/unlocked-io.m4 \
+ gl/m4/utimbuf.m4 \
+ gl/m4/xalloc.m4 \
--- /dev/null
+# safe-read.m4 serial 5
+dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SAFE_READ],
+[
+ AC_LIBOBJ([safe-read])
+
+ gl_PREREQ_SAFE_READ
+])
+
+# Prerequisites of lib/safe-read.c.
+AC_DEFUN([gl_PREREQ_SAFE_READ],
+[
+ AC_REQUIRE([gt_TYPE_SSIZE_T])
+])
--- /dev/null
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+#include <string.h>
+
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
--- /dev/null
+# strnlen.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2007, 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRNLEN],
+[
+ dnl Persuade glibc <string.h> to declare strnlen().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([strnlen])
+ if test $ac_cv_have_decl_strnlen = no; then
+ HAVE_DECL_STRNLEN=0
+ fi
+
+ AC_FUNC_STRNLEN
+ if test $ac_cv_func_strnlen_working = no; then
+ # This is necessary because automake-1.6.1 doesn't understand
+ # that the above use of AC_FUNC_STRNLEN means we may have to use
+ # lib/strnlen.c.
+ AC_LIBOBJ([strnlen])
+ AC_DEFINE([strnlen], [rpl_strnlen],
+ [Define to rpl_strnlen if the replacement function should be used.])
+ gl_PREREQ_STRNLEN
+ fi
+])
+
+# Prerequisites of lib/strnlen.c.
+AC_DEFUN([gl_PREREQ_STRNLEN], [:])