4b5c6080c2
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/flex#9adf2296f3603e2ee68328283ad625d080ae1c2a
23 lines
653 B
Bash
Executable File
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
|