From 1844ed751b5218f7c74c519391f52fd0c4c0ec36 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 15 Mar 2011 08:07:34 +0000 Subject: [PATCH] patch: update to 2.6.1 --- patch/.footprint | 7 +++---- patch/.md5sum | 6 +++++- patch/Pkgfile | 16 +++++++++++----- patch/patch-2.6.1-strnlen.patch | 24 ++++++++++++++++++++++++ patch/safe-read.m4 | 18 ++++++++++++++++++ patch/strnlen.c | 31 +++++++++++++++++++++++++++++++ patch/strnlen.m4 | 31 +++++++++++++++++++++++++++++++ 7 files changed, 123 insertions(+), 10 deletions(-) create mode 100644 patch/patch-2.6.1-strnlen.patch create mode 100644 patch/safe-read.m4 create mode 100644 patch/strnlen.c create mode 100644 patch/strnlen.m4 diff --git a/patch/.footprint b/patch/.footprint index 21758de..b8675f2 100644 --- a/patch/.footprint +++ b/patch/.footprint @@ -1,7 +1,6 @@ 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 diff --git a/patch/.md5sum b/patch/.md5sum index 424036b..248824c 100644 --- a/patch/.md5sum +++ b/patch/.md5sum @@ -1 +1,5 @@ -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 diff --git a/patch/Pkgfile b/patch/Pkgfile index 0f7b191..d2184a0 100644 --- a/patch/Pkgfile +++ b/patch/Pkgfile @@ -5,17 +5,23 @@ # 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 } diff --git a/patch/patch-2.6.1-strnlen.patch b/patch/patch-2.6.1-strnlen.patch new file mode 100644 index 0000000..aa60686 --- /dev/null +++ b/patch/patch-2.6.1-strnlen.patch @@ -0,0 +1,24 @@ +--- 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 \ diff --git a/patch/safe-read.m4 b/patch/safe-read.m4 new file mode 100644 index 0000000..7a89d0a --- /dev/null +++ b/patch/safe-read.m4 @@ -0,0 +1,18 @@ +# 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]) +]) diff --git a/patch/strnlen.c b/patch/strnlen.c new file mode 100644 index 0000000..d346d32 --- /dev/null +++ b/patch/strnlen.c @@ -0,0 +1,31 @@ +/* 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 + +#include + +/* 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; +} diff --git a/patch/strnlen.m4 b/patch/strnlen.m4 new file mode 100644 index 0000000..b3787de --- /dev/null +++ b/patch/strnlen.m4 @@ -0,0 +1,31 @@ +# 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 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], [:]) -- 2.26.2