jb1277976_,
A patch looks like, its two hunks from my /etc/portage/patches/media-gfx/iscan-2.30.4.2/fixfunctiontypes.patch.
Code: Select all
--- a/backend/model-info.c_orig 2021-11-13 15:58:38.353143768 +0000
+++ b/backend/model-info.c 2021-11-13 16:05:35.995828068 +0000
@@ -301,7 +301,9 @@
*
* \return \c true if commands have been modified, \c false otherwise
*/
-bool
+
+/* Drop the bool here, to match the header bool */
+
model_info_customise_commands (const void *self, EpsonCmd cmd)
{
bool customised = false;
@@ -665,7 +667,7 @@
return false;
}
-bool
+/* Drop the bool here to match the hacck to the .h file bool */
model_info_has_lock_commands (const void *self)
{
_model_info_t *self_ = NULL;
It contains a header, naming the file to be patched
Code: Select all
--- a/backend/model-info.c_orig 2021-11-13 15:58:38.353143768 +0000
+++ b/backend/model-info.c 2021-11-13 16:05:35.995828068 +0000
A location in the file to apply the hunk
That says that the 7 lines at line 301 will be 9 lines after the hunk is applied.
Then there is three lines of context
Code: Select all
*
* \return \c true if commands have been modified, \c false otherwise
*/
The hunk will be rejected if they are not found,
Then the change.
Code: Select all
-bool
+
+/* Drop the bool here, to match the header bool */
+
Remove one line and add three, so nett effect is to add two lines, as the location says.
Lastly there is three lines of context after the change.
Code: Select all
model_info_customise_commands (const void *self, EpsonCmd cmd)
{
bool customised = false;
The hunk will be rejected if that isn't found too.
My example above shows a further hunk.
Knowing the above, the ordering of patches is critical. Another patch max have changed the contexts for this patch.
It may try to use the changes above for its own context.
Patching another area of the file so the the location is not correct will make patch emit a warning about an offset but the patch will still apply.