[Mageia-dev] rpm macro help! %apply_patches

Pascal Terjan pterjan at gmail.com
Thu Dec 1 11:41:44 CET 2011


On Thu, Dec 1, 2011 at 10:28, Colin Guthrie <mageia at colin.guthr.ie> wrote:
> 'Twas brillig, and Pascal Terjan at 01/12/11 10:19 did gyre and gimble:
>> On Thu, Dec 1, 2011 at 09:58, Colin Guthrie <mageia at colin.guthr.ie> wrote:
>>> Hi,
>>>
>>> There are times when the backup files from patches applied with
>>> %apply_patches get in the way. It would be nice to be able to disable
>>> backup file generation. e.g. with %apply_patches -n
>>>
>>> Can someone with the appropriate skills do this? I can't remember who
>>> wrote this macro (I wrote the very crappy initial version of it and
>>> someone else made it awesome!), but I have a feeling it was pterjan or
>>> Annsi (or maybe it was pixel before he left...?). Anyway, it's a super
>>> useful macro, but it would be really nice if it could avoid the backups.
>>
>> I think it was pixel
>
> Yeah, I think I remember now. It was a "parting gift" before he left :)
>
>>> Or another suggestion..... who actually uses these backup files? Perhaps
>>> they can just be dropped completely?
>>
>> I use them when updating patches
>
> OK, so a more graceful way is needed to deal with the situation when the
> patches are problematic (i.e. a dump installer just installing all the
> files it finds.
>
> My work around is just a simple:
>  find -name "*.[0-9][0-9][0-9][0-9]" -delete
> but it could be too greedy in some circumstances.
>
> So I guess an rpmmacro guru is needed.

I think we can have an option quite easily but I don't want to learn lua :)

%apply_patches %{lua: keys = {}; for i, p in ipairs(patches) do
print(rpm.expand("%{_patch} -s -p1 -b --suffix " ..
string.format(".%04d", patches_num[p]) .. "
--fuzz=%{_default_patch_fuzz} -i " .. p .. "\\n")) end }


More information about the Mageia-dev mailing list