Marcel Telka
2023-10-06 4cc3ef1531d56f9989593d611567935779d62275
tools/python-integrate-project: do not pollute source dir with the 'patches' symlink

1 files modified
16 ■■■■■ changed files
tools/python-integrate-project 16 ●●●●● patch | view | raw | blame | history
tools/python-integrate-project
@@ -262,23 +262,21 @@
! $GMAKE prep > /dev/null 2>&1 && printf "FATAL: 'gmake prep' failed!\n" >&2 && exit 1
git checkout patches > /dev/null 2>&1
mkdir -p patches
# see make-rules/prep-patch.mk
PATCHES=$(find patches -type f -name '*.patch*' 2>/dev/null | LC_COLLATE=C sort)
PATCHES=$($GMAKE print-value-PATCHES)
SOURCE_DIR=$($GMAKE print-value-SOURCE_DIR)
cd "$SOURCE_DIR"
ln -s ../patches .
for p in $PATCHES ; do
    quilt import --quiltrc /dev/null "$p" > /dev/null 2>&1
    QUILT_PATCHES=../patches quilt import --quiltrc /dev/null "../$p" > /dev/null 2>&1
    (($? == 1)) && printf 'FATAL: failed to import old patch %s!\n' "$p" && exit 1
    quilt push --quiltrc /dev/null -q > /dev/null 2>&1
    QUILT_PATCHES=../patches quilt push --quiltrc /dev/null -q > /dev/null 2>&1
    (($? == 1)) && printf 'FATAL: failed to apply old patch %s!\n' "$p" && exit 1
    quilt refresh --quiltrc /dev/null -p 1 --no-timestamps --no-index > /dev/null 2>&1
    QUILT_PATCHES=../patches quilt refresh --quiltrc /dev/null -p 1 --no-timestamps --no-index > /dev/null 2>&1
    (($? == 1)) && printf 'FATAL: failed to refresh old patch %s!\n' "$p" && exit 1
done
touch patches/series
quilt pop --quiltrc /dev/null -a -q > /dev/null 2>&1
touch ../patches/series
QUILT_PATCHES=../patches quilt pop --quiltrc /dev/null -a -q > /dev/null 2>&1
(($? == 1)) && printf 'FATAL: failed to remove patches!\n' && exit 1
rm -f patches/series
rm -f ../patches/series
cd "$DIR"
for p in $PATCHES ; do
    quilt import --quiltrc /dev/null -p 0 "$p" > /dev/null 2>&1