Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 293570 (patch-2.6) - sys-devel/patch-2.6 incompatible integration of -p# and -F3 (fuzz factor)
Summary: sys-devel/patch-2.6 incompatible integration of -p# and -F3 (fuzz factor)
Status: RESOLVED FIXED
Alias: patch-2.6
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords: Tracker
Depends on: 293248 293385 294841 295304 295306
Blocks: 387471
  Show dependency tree
 
Reported: 2009-11-18 03:30 UTC by Dawid Węgliński (RETIRED)
Modified: 2011-12-03 02:08 UTC (History)
17 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Cleared source tarball with relevant files (tripwire-2.3.1-2.tar.gz,6.00 KB, application/octet-stream)
2009-11-18 04:06 UTC, Dawid Węgliński (RETIRED)
Details
patch to apply (tripwire-friend-classes.patch,1.22 KB, patch)
2009-11-18 04:08 UTC, Dawid Węgliński (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Węgliński (RETIRED) gentoo-dev 2009-11-18 03:30:12 UTC
As long as my debug is correct, patch-2.6 introduced backward incompatible integration of -pnum and fuzz factor which may break epatch (see bug #293248) and other patching tools (may be bug #293385, but didn't checked it yet). For previous version of patch the priority was if target file exists not if the context is correct within fuzz scope, so for EPATCH_OPTS=-F3 epatch() run loop with -p{0..5} till target file was found. Currently fuzz is considered as more important and patch is applied on non existing files - -p1 isn't considered on patches with full headers (eg. pkg-ver/src/foo in ${S} env will apply patch on pkg-ver/pkg-ver/src/foo).
Comment 1 SpanKY gentoo-dev 2009-11-18 03:48:22 UTC
please post the actual files (source and patches) that exhibit behavior.  it's a lot easier to deal with attachments/tarballs in this bug than having to piece together things from random bugs/packages.
Comment 2 Dawid Węgliński (RETIRED) gentoo-dev 2009-11-18 04:06:17 UTC
Created attachment 210551 [details]
Cleared source tarball with relevant files
Comment 3 Dawid Węgliński (RETIRED) gentoo-dev 2009-11-18 04:08:17 UTC
Created attachment 210553 [details, diff]
patch to apply

Here you go.
Comment 4 SpanKY gentoo-dev 2009-11-18 05:07:31 UTC
and the exact dir and patch command to run ?
Comment 5 Dawid Węgliński (RETIRED) gentoo-dev 2009-11-18 05:30:44 UTC
If you unpack the tarball to /tmp/tripwire-2.3.1-2/ and go into try applying patch like follows:

cat /path/to/tripwire-friend-classes.patch | patch -p0 -F3

This will create /tmp/tripwire-2.3.1-2/tripwire-2.3.1-2-p1/src/foo files instead patching files inside /tmp/tripwire-2.3.1-2/src/ as expected from -p0 but patch-2.5.9 reports no file to patch. This way epatch() can run in a loop to -p1 and successfully apply.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-01 11:09:21 UTC
I've now masked patch-2.6 on behalf of QA.

The problem seem to be widespread, but what I'm worried about is not just the packages failing to build, but rather the other patches that might silently fail: a build failure is obvious enough, but what about crash fixes? Security fixes?

Given the implications, users shouldn't get this not even in ~arch.
Comment 7 SpanKY gentoo-dev 2009-12-01 19:42:48 UTC
any package that relies on an increased fuzz factor (-F#) is doing stupid crap in the first place.
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-01 19:51:50 UTC
have fun, you can see the games bugs already don't you? I'm afraid the fuzz factor is not the only problem there…
Comment 9 SpanKY gentoo-dev 2009-12-01 19:57:09 UTC
i never said this was only an issue for -F# users, just that people who force -F# manually to get a patch to apply should be making cleaner patches
Comment 10 parafin 2009-12-01 20:20:22 UTC
(In reply to comment #8)
> have fun, you can see the games bugs already don't you? I'm afraid the fuzz
> factor is not the only problem there…
> 

Is there other known problems with patch-2.6 which result in not applied patch?
Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-12-01 20:26:56 UTC
I'm afraid -F2 (the default) is also sometimes causing problem.
Comment 12 SpanKY gentoo-dev 2009-12-01 20:29:34 UTC
it all seems to be the same issue ... patch does not consider non-existent files when the fuzz factor equals or exceeds the number of contexts
Comment 13 Harris Landgarten 2009-12-02 04:29:06 UTC
Does this issue effect gentoo-sources?
Comment 14 Andrew Savchenko gentoo-dev 2009-12-08 21:54:27 UTC
(In reply to comment #13)
> Does this issue effect gentoo-sources?

In theory, yes. But number of patches is small so you can check youself if they applied properly for a kernel. I usually use vanilla kernels, so this problem is out of my interest.
Comment 15 SpanKY gentoo-dev 2010-01-01 07:00:55 UTC
patch-2.6.1 should fix this behavior