flex/quilt-patch.sh
Arjun Shankar c0c5e9ed4b Rebase to 2.6.4 (#1389575)
This patch rebases flex to upstream version 2.6.4 and thus drops all
backported upstream patches that the package has been carrying so far.

One exception is flex-2.6.0-yyless.patch which has no equivalent upstream.
I could not track the origin of this patch because flex development moved
from SourceForge to GitHub and in the process, sourceforge bug tracker
content has been lost. However, RHBZ #1281976 seems to suggest that this
patch was included in order to fix a libreswan build failure caused by a
flex integer comparison type mismatch bug. I dropped flex-2.6.0-yyless.patch
and confirmed that the Fedora libreswan package corresponding to
libreswan-3.25 builds successfully despite this patch being dropped.

Additionally, flex-2.6.4 FTBFS because it uses reallocarray but does not
define _GNU_SOURCE leading to a missing prototype for reallocarray. This
commit also includes the upstream patch that fixes this. The patch modifies
configure.ac, which necessitates executing autoreconf at build time and thus
a corresponding set of new build dependencies.
2018-09-03 18:37:45 +02:00

23 lines
653 B
Bash
Executable File

#!/bin/bash
# Patches are in the current directory.
export QUILT_PATCHES=$PWD
# Extract source file name from sources file,
# and assume it's the same name as the directory.
source=`awk -F '[() ]+' '/^[A-Z0-9]+ /{print $2}; /^[0-9a-f]+ /{print $2}' sources`
srcdir=${source%.tar.gz}
if [ "$1" == "-f" ] && [ -d "$srcdir" ]; then
echo Cleaning up $srcdir
rm -rf $srcdir
fi
if [ -d "$srcdir" ]; then
# Don't overwrite existing source directory.
echo "ERROR: Source directory $srcdir already exists. Use -f to force cleanup step."
exit 1
fi
tar xvf $source
echo "Entering $srcdir"
pushd $srcdir
# Apply all patches.
quilt push -a
popd