From 49bd84e9cc99e40de1d2187fe5957a833b131d3b Mon Sep 17 00:00:00 2001 From: Packit Service Date: Feb 02 2021 06:18:11 +0000 Subject: Apply patch 0001-Add-limits-to-autopatch-macro.patch patch_name: 0001-Add-limits-to-autopatch-macro.patch present_in_specfile: true location_in_specfile: 31 --- diff --git a/macros.in b/macros.in index d704417..9cb9190 100644 --- a/macros.in +++ b/macros.in @@ -1265,11 +1265,19 @@ else\ end} # Automatically apply all patches -%autopatch(vp:)\ +# -m Apply patches with number >= min only +# -M Apply patches with number <= max only +%autopatch(vp:m:M:)\ %{lua:\ local options = rpm.expand("%{!-v:-q} %{-p:-p%{-p*}} ")\ +local low_limit = tonumber(rpm.expand("%{-m:%{-m*}}"))\ +local high_limit = tonumber(rpm.expand("%{-M:%{-M*}}"))\ for i, p in ipairs(patches) do\ - print(rpm.expand("%apply_patch -m %{basename:"..p.."} "..options..p.." "..i.."\\n"))\ + local inum = patch_nums[i]\ + if ((not low_limit or inum>=low_limit) and (not high_limit or inum<=high_limit)) \ + then\ + print(rpm.expand("%apply_patch -m %{basename:"..p.."} "..options..p.." "..i.."\\n")) \ + end\ end} # One macro to (optionally) do it all.