From aef234558d765b547c2e4721dcc2cdb8a7b75354 Mon Sep 17 00:00:00 2001 From: Michael Ciociola <549853+Spoons@users.noreply.github.com> Date: Tue, 6 Apr 2021 17:29:29 -0400 Subject: [PATCH] Fix failure to extract kernel patch when srcdest is set in Arch (#218) --- linux-tkg-config/prepare | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index 6afbfbf..c9f8bf5 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -349,7 +349,11 @@ _tkg_srcprep() { if [ "$_sub" != "0" ] && [[ "$_sub" != rc* ]]; then msg2 "Patching from $_basekernel to $pkgver" if [ ! -e "$srcdir/patch-${pkgver}" ]; then - ( cd "$_where" && xz -dk patch-${pkgver}.xz && mv "$_where"/patch-${pkgver} "$srcdir"/ ) + if [ -e "$srcdir/patch-${pkgver}.xz" ]; then + xz -dk "$(readlink -f "$srcdir/patch-${pkgver}.xz")" --stdout > "$srcdir/patch-${pkgver}" + else + ( cd "$_where" && xz -dk patch-${pkgver}.xz && mv "$_where"/patch-${pkgver} "$srcdir"/ ) + fi fi tkgpatch="$srcdir/patch-${pkgver}" && _tkg_patcher fi