summaryrefslogtreecommitdiff
path: root/core/patch
diff options
context:
space:
mode:
authorMichał Masłowski <mtjm@mtjm.eu>2013-01-12 13:04:54 +0100
committerMichał Masłowski <mtjm@mtjm.eu>2013-01-12 13:04:54 +0100
commit24633b6f6af8dc77ca77224448d226d8e99c9ce1 (patch)
tree0e862445be6a105957104f94f7e4f2668e1fdbba /core/patch
parentd28ed89b1e41f7e71045a5c2e898aa3b369eda47 (diff)
parent8c2563c3c13cb7a279544f6926cbdd2eb902cc9a (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts: community/cdemu-daemon/PKGBUILD community/chmsee/PKGBUILD community/fceux/PKGBUILD community/ginac/PKGBUILD community/gstreamermm/PKGBUILD community/gtksourceviewmm/PKGBUILD community/lgi/PKGBUILD community/libmirage/PKGBUILD core/gawk/PKGBUILD core/gettext/PKGBUILD extra/enca/PKGBUILD extra/gnutls/PKGBUILD extra/hdf5/PKGBUILD extra/kdebase/PKGBUILD extra/libass/PKGBUILD extra/libdiscid/PKGBUILD extra/libxcomposite/PKGBUILD extra/libxdamage/PKGBUILD extra/maxima/PKGBUILD extra/nx/PKGBUILD extra/opencv/PKGBUILD extra/pidgin/PKGBUILD extra/redland/PKGBUILD extra/sharutils/PKGBUILD extra/soundtouch/PKGBUILD extra/sqlite/PKGBUILD extra/twisted/PKGBUILD libre/dpkg/PKGBUILD
Diffstat (limited to 'core/patch')
-rw-r--r--core/patch/PKGBUILD17
-rw-r--r--core/patch/patch-2.7.1-initialize-data-structures-early-enough.patch81
2 files changed, 94 insertions, 4 deletions
diff --git a/core/patch/PKGBUILD b/core/patch/PKGBUILD
index d2852c447..8174e80eb 100644
--- a/core/patch/PKGBUILD
+++ b/core/patch/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 167281 2012-09-29 22:30:14Z allan $
+# $Id: PKGBUILD 174021 2013-01-01 15:15:16Z foutrelis $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>
pkgname=patch
pkgver=2.7.1
-pkgrel=1
+pkgrel=2
pkgdesc="A utility to apply patch files to original sources"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.gnu.org/software/patch/patch.html"
@@ -13,12 +13,21 @@ groups=('base-devel')
depends=('glibc')
makedepends=('ed')
optdepends=('ed: for patch -e functionality')
-source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig})
+source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
+ patch-2.7.1-initialize-data-structures-early-enough.patch)
md5sums=('e9ae5393426d3ad783a300a338c09b72'
- 'b12189e0de3cb2af25268441647ec517')
+ 'b12189e0de3cb2af25268441647ec517'
+ 'dc6367a7cd49933d4006c246789e98da')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
+
+ # Fix segfault on non-numeric strip-count
+ # (also segfaults on nonexistent directory passed to -d)
+ # http://savannah.gnu.org/bugs/?37500
+ patch -Np1 -i \
+ $srcdir/patch-2.7.1-initialize-data-structures-early-enough.patch
+
./configure --prefix=/usr
make
}
diff --git a/core/patch/patch-2.7.1-initialize-data-structures-early-enough.patch b/core/patch/patch-2.7.1-initialize-data-structures-early-enough.patch
new file mode 100644
index 000000000..046edc3d4
--- /dev/null
+++ b/core/patch/patch-2.7.1-initialize-data-structures-early-enough.patch
@@ -0,0 +1,81 @@
+From 291ec175812b7ba291d124e4cf2fbf9efec590c8 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@linbit.com>
+Date: Thu, 4 Oct 2012 12:33:09 +0200
+Subject: [PATCH] Initialize data structures early enough
+
+* src/patch.c (main): Initialize data structures early enough, before error
+paths can access them.
+* tests/bad-usage: Test bad command line usage.
+* tests/Makefile.am (TESTS): Add bad-usage here.
+---
+ src/patch.c | 8 ++++----
+ tests/Makefile.am | 1 +
+ tests/bad-usage | 18 ++++++++++++++++++
+ 3 files changed, 23 insertions(+), 4 deletions(-)
+ create mode 100644 tests/bad-usage
+
+diff --git a/src/patch.c b/src/patch.c
+index 828943b..0255fbb 100644
+--- a/src/patch.c
++++ b/src/patch.c
+@@ -150,6 +150,10 @@ main (int argc, char **argv)
+ else if ((version_control = getenv ("VERSION_CONTROL")))
+ version_control_context = "$VERSION_CONTROL";
+
++ init_backup_hash_table ();
++ init_files_to_delete ();
++ init_files_to_output ();
++
+ /* parse switches */
+ Argc = argc;
+ Argv = argv;
+@@ -162,10 +166,6 @@ main (int argc, char **argv)
+ if (make_backups | backup_if_mismatch)
+ backup_type = get_version (version_control_context, version_control);
+
+- init_backup_hash_table ();
+- init_files_to_delete ();
+- init_files_to_output ();
+-
+ init_output (&outstate);
+ if (outfile)
+ outstate.ofp = open_outfile (outfile);
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 02fc6de..5cea52d 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -20,6 +20,7 @@ TESTS = \
+ asymmetric-hunks \
+ backup-prefix-suffix \
+ bad-filenames \
++ bad-usage \
+ concat-git-diff \
+ copy-rename \
+ corrupt-reject-files \
+diff --git a/tests/bad-usage b/tests/bad-usage
+new file mode 100644
+index 0000000..022eeda
+--- /dev/null
++++ b/tests/bad-usage
+@@ -0,0 +1,18 @@
++# Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc.
++#
++# Copying and distribution of this file, with or without modification,
++# in any medium, are permitted without royalty provided the copyright
++# notice and this notice are preserved.
++
++. $srcdir/test-lib.sh
++
++require_cat
++use_local_patch
++use_tmpdir
++
++# ==============================================================
++
++check 'patch -px || echo "status: $?"' <<EOF
++$PATCH: **** strip count x is not a number
++status: 2
++EOF
+--
+1.8.0.3
+