[Rpm-maint] [rpm-software-management/rpm] Improve "git am" support. (#854)

Panu Matilainen notifications at github.com
Wed Oct 9 11:30:59 UTC 2019


pmatilai commented on this pull request.



> +  }\
+  %%{!?__scm_apply_patches_%{__scm}:\
+     %%{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\
+            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\
+     }\
+  }\
+}

This *huge* %{expand:...} with all those escaped %'s is a bit unwieldy. %{expand:...} is better limited to the smallest possible scope because those expansions and escapes add up (see eg #313 for context).

Also makes me wonder if it'd be saner to handle this by making __scm_apply_patches_SCM mandatory for all and just point all the other SCM's to the generic %{lua:} bit (call it __scm_apply_patches_gen or whatever). 

Dunno, but this construct does make me feel uneasy.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/854#pullrequestreview-299342982
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191009/a30f04fb/attachment.html>


More information about the Rpm-maint mailing list