[Mageia-dev] rpm macro help! %apply_patches
Colin Guthrie
mageia at colin.guthr.ie
Thu Dec 1 14:25:47 CET 2011
'Twas brillig, and Pascal Terjan at 01/12/11 10:41 did gyre and gimble:
> On Thu, Dec 1, 2011 at 10:28, Colin Guthrie <mageia at colin.guthr.ie> wrote:
>> 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 }
Incidentally, the approach taken in Fedora is a bit different:
The do the following in the spec:
git init
git config user.email "devel at redhat.com"
git config user.name "Fedora SPEC"
git add .
git commit -a -q -m "%{version} baseline."
git am -p1 %{patches}
On the face of it this is a bit ugly, but the reason to do this is that
it allow patches that deal with renames and file mode changes to be
applied too.
So perhaps we should have a %git_apply_patches macro that does the above
too?
Col
--
Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the Mageia-dev
mailing list