Fix failure to extract kernel patch when srcdest is set in Arch (#218)

This commit is contained in:
Michael Ciociola 2021-04-06 17:29:29 -04:00 committed by GitHub
parent 273ab6d286
commit aef234558d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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