Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hunk rejected at patch -R(everse) when restoring [WON'T FIX]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 4071

PostPosted: Wed May 07, 2025 10:28 pm    Post subject: Hunk rejected at patch -R(everse) when restoring [WON'T FIX] Reply with quote

I'm flavoring kernel branches for additional features through a patch set file expected to be resilient to minor upgrade.
Once kernel is build and installed, patch set file is reversely applied.

This process has been successful for years on a monthly occurrence basis.

EDIT: when reversing, for whatever reason it just failed for one hunk which is reported as
Code:
patching file kernel/sysctl.c
Unreversed patch detected!  Ignore -R? [n]

EDIT: I'm quite surprised reverse patching fails to restore from successfully patched file and currently bisecting for details....

Maybe some users have some experience to share in this respect?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "


Last edited by CaptainBlood on Thu May 08, 2025 12:01 pm; edited 5 times in total
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 4071

PostPosted: Wed May 07, 2025 11:18 pm    Post subject: Reply with quote

patch hunk is
Code:
@@ -150,6 +150,10 @@ static const int cap_last_cap = CAP_LAST_CAP;
 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
 #endif
 
+# inserted block start
+#
+#
+# inserted block end
 #ifdef CONFIG_INOTIFY_USER
 #include <linux/inotify.h>
 #endif
@@ -283,6 +287,15 @@ static struct ctl_table sysctl_base_table[] = {

It so happens that patch is applied despite 3 heading lines are missing. i.e patch [-R] -p1< /absolute/path/to/file.patch


Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 4071

PostPosted: Thu May 08, 2025 1:18 am    Post subject: Reply with quote

man page:
Code:
       patch usually produces the correct results, even when it has to do a lot
       of  guessing.   However,  the  results are guaranteed to be correct only
       when the patch is applied to exactly the same version of the  file  that
       the patch was generated from.
I should have known from the start...

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2373

PostPosted: Thu May 08, 2025 9:46 am    Post subject: Reply with quote

You can disable fuzz:
Quote:

-F num or --fuzz=num
Set the maximum fuzz factor. This option only applies to diffs that have context, and causes patch to ignore up to that many lines of context in looking for places to install
a hunk. Note that a larger fuzz factor increases the odds of a faulty patch. The default fuzz factor is 2. A fuzz factor greater than or equal to the number of lines of
context in the context diff, ordinarily 3, ignores all context.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum