Use git apply

This commit is contained in:
eabdullin 2025-04-08 15:12:12 +03:00
parent 2cd1b53c98
commit 5546f0516c

View File

@ -1882,28 +1882,6 @@ cd ..
###
%build
patch_command='git apply'
ApplyPatch()
{
local patch=$1
shift
if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
exit 1
fi
if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; then
if [ "${patch:0:8}" != "patch-%{kversion}." ] ; then
echo "ERROR: Patch $patch not listed as a source patch in specfile"
exit 1
fi
fi 2>/dev/null
case "$patch" in
*.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*.xz) unxz < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;;
esac
}
rm -rf %{buildroot_unstripped} || true
mkdir -p %{buildroot_unstripped}
@ -2722,7 +2700,7 @@ BuildKernel %make_target %kernel_image %{_use_vdso}
%endif
%if %{with_ppc_kvm}
ApplyPatch ppc64le-kvm-support.patch
git apply $RPM_SOURCE_DIR/ppc64le-kvm-support.patch
BuildKernel %make_target %kernel_image %{_use_vdso} kvm
%endif