2015-07-07 18:04:07 +00:00
|
|
|
#!/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.
|
2017-01-02 12:32:40 +00:00
|
|
|
source=`awk -F '[() ]+' '/^[A-Z0-9]+ /{print $2}; /^[0-9a-f]+ /{print $2}' sources`
|
2018-08-14 02:43:08 +00:00
|
|
|
srcdir=${source%.tar.xz}
|
2015-09-17 16:24:49 +00:00
|
|
|
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
|
2018-08-14 02:43:08 +00:00
|
|
|
tar Jxvf $source
|
2015-07-07 18:04:07 +00:00
|
|
|
echo "Entering $srcdir"
|
|
|
|
pushd $srcdir
|
|
|
|
# Apply all patches.
|
|
|
|
quilt push -a
|
|
|
|
popd
|