Patches handling in the grimoire
This page is a draft to establish the improvements we want to bring in patches handling.
Indeed a discussion was started about this in the middle of may 2006 on the ML, but nothing was eventually decided. This document first gives the points people agrees on and then those who should still be discussed.
Work on libpatch might be used to complete this task :
http://wiki.sourcemage.org/libpatch
http://bugs.sourcemage.org/show_bug.cgi?id=7296
People agrees on
a directory patches in the spell dir would hold ALL the patches
Comments in patches should be defined, for example
***START OF DIFF FILE***
## Description: What does this patch do
## BugUrl: Url to the upstream filed bug about the patch
## Author: Author of the patch
## Type: [enh|fix|sec|other]
THE_PATCH
***END OF DIFF FILE***
If possible ALL patches should be applied in PRE_BUILD
Final evolution of this would be automatic patching in PRE_BUILD using default_pre_build, of course with a possibility to override the default behaviour to handle particular cases.
People doesn't agree on
The filename
Two solutions were proposed here :
The filename gives informations about the order it should be applied, as well as the patchlevel.
an example: 001-2-mypatch.diff
arbitrary: SEQ-P-NAME.diff
SEQ: sequential number from 000-999
Patches that should be applied in PRE_BUILD go from 001 to 899
Patches that can't be applied in PRE_BUILD go from 900 to 999
000 is reserved for now
Other ranges might be added as well I doubt we will ever have 1000 patches in a spell
P: patchlevel
NAME: a name for the patch
The filename is kept as simple as it is now, only a simple name. The informations for applying are stored in the patch comments. Dependencies would be used instead of sequential numbers to handle patches addition or removal. A group optional field would allow the user to switch on/off set of patches.
## Depends: patch1
## Depends: patch2
## Group: arbitrary_group
## Special: [BUILD|INSTALL|POST_INSTALL|etc...]
## Patchlevel: 3
Special field defaults to PRE_BUILD.
