Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565336 - eutils.eclass: epatch: failed to apply patch when using --dry-run and multiple hunks against the same file
Summary: eutils.eclass: epatch: failed to apply patch when using --dry-run and multipl...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-10 07:53 UTC by Perfect Gentleman
Modified: 2015-11-11 02:37 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Perfect Gentleman 2015-11-10 07:53:40 UTC
epatch failed to patch media-libs/freetype with https://github.com/bohoomil/fontconfig-ultimate/blob/master/freetype/02-upstream-2015.11.08.patch

patch.out - https://bpaste.net/show/87a872c50511

patch -p1 -i /home/my_user/overlay/media-libs/freetype/files/02-upstream-2015.11.08.patch - works.

patch -p1 -g0 -E --no-backup-if-mismatch < '/home/my_user/overlay/media-libs/freetype/files/02-upstream-2015.11.08.patch' - works too.
Comment 1 Felix Janda 2015-11-10 18:49:25 UTC
I think this might be a bug in sys-apps/patch. 'patch -p1 --dry-run'
fails while 'patch -p1' succeeds (on freetype-2.6.1).
Comment 2 Felix Janda 2015-11-10 19:08:01 UTC
The problem seems to be that the patch patches "ChangeLog" multiple
times and these patches on depend on each other. Without --dry-run
patch applies the patches one after each other and everything works.
With --dry-run patch sees whether the first patch applies. Next, it
checks whether the second patch applies _to the original file_, to
which the second patch might not apply after all. Another thing to note
is that patch is also not able to reverse (option -R) these kind of
patches.

Either such patches are invalid or these are bugs in patch.
Comment 3 Perfect Gentleman 2015-11-10 19:19:13 UTC
did you read patch.out?
there is "patch -p1 -g0 -E --no-backup-if-mismatch < '/home/my_user/overlay/media-libs/freetype/files/02-upstream-2015.11.08.patch'" which didn't work for epatch, but it works itself.
Comment 4 Felix Janda 2015-11-10 21:29:50 UTC
epatch first uses internally in addition the "--dry-run" and "-f"
options but does not tell you about that in patch.out.
Comment 5 SpanKY gentoo-dev 2015-11-11 02:37:46 UTC
i've clarified the log here:
http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bb3a73979d7023e7425b9a0acc1324070044278

but in the end, epatch requires patches pass --dry-run mode, and your patch does not do that (because it modifies the same file multiple times).