summaryrefslogtreecommitdiffstats
path: root/source/a/patch/patch.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/patch/patch.SlackBuild')
-rwxr-xr-xsource/a/patch/patch.SlackBuild32
1 files changed, 24 insertions, 8 deletions
diff --git a/source/a/patch/patch.SlackBuild b/source/a/patch/patch.SlackBuild
index 28880a276..8ee0d50a0 100755
--- a/source/a/patch/patch.SlackBuild
+++ b/source/a/patch/patch.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2005-2009, 2010, 2012, 2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2009, 2010, 2012, 2015, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,9 +20,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=patch
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-3}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -34,7 +36,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
TMP=${TMP:-/tmp}
PKG=$TMP/package-patch
@@ -53,7 +62,7 @@ fi
cd $TMP
rm -rf patch-${VERSION}
-tar xvf $CWD/patch-${VERSION}.tar.xz || exit 1
+tar xvf $CWD/patch-${VERSION}.tar.?z || exit 1
cd patch-${VERSION} || exit 1
chown -R root:root .
@@ -63,14 +72,21 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Patch CVE-2018-1000156, arbitrary shell command execution by (obsolete)
+# ed patch format:
+zcat $CWD/0001-Refuse-to-apply-ed-scripts-by-default.patch.gz | patch -p1 --verbose || exit 1
+
+# This avoids failure in tests/ expecting an old automake:
+autoreconf -vif
+
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--mandir=/usr/man \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
make -j4 || make || exit 1
-make install DESTDIR=$PKG
+make install DESTDIR=$PKG || exit 1
# Strip everything for good measure:
( cd $PKG