Bug 1083407

Summary: Patch does not recognize bad patch, says the patching succeeded, but file is not patched
Product: [Fedora] Fedora Reporter: Jan Kaluža <jkaluza>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-09 17:30:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer none

Description Jan Kaluža 2014-04-02 08:01:29 UTC
Created attachment 881659 [details]
reproducer

If the patch does not contain following header:
--- a/src/file.h
+++ b/src/file.h

patching looks like this, but the file is not patched:

$ patch -p1 < file-5.11-maxmime.patch ; echo $?
patching file src/file.h
0

This can cause problems during rpmbuild when the broken patch looks like the proper one, but files are not patched in the end.

Comment 1 Jaroslav Reznik 2015-03-03 15:39:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Tim Waugh 2015-03-09 17:30:10 UTC
In general, hand-edited patches will always cause issues like this because damage cannot always be detected.

In this particular case, I agree it's unexpected.