Bug 1298110

Summary: patch: **** Only garbage was found in the patch input.
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: redhat-bugzilla, 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: 2016-01-13 14:18:52 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:
Bug Depends On:    
Bug Blocks: 1245310    
Attachments:
Description Flags
purple-url-handler
none
purple-url-handler.new
none
tmp.patch none

Description Jan Synacek 2016-01-13 09:22:23 UTC
Created attachment 1114342 [details]
purple-url-handler

Description of problem:
See steps to reproduce. I'm not sure if this is a bug in diffutils or patch...


Version-Release number of selected component (if applicable):
diffutils-3.3-12.fc23.x86_64
patch-2.7.5-2.fc23.x86_64


Steps to Reproduce:
1. diff purple-url-handler purple-url-handler.new  > tmp.patch
2. patch < tmp.patch
patch: **** Only garbage was found in the patch input.


Actual results:
Error.


Expected results:
Patch works.


Additional info:
It doesn't matter if the unified format is used or not. Also, the behavior is the same on RHEL-7.2 with diffutils-3.3-4.el7.x86_64 and patch-2.7.1-8.el7.x86_64.

Comment 1 Jan Synacek 2016-01-13 09:22:51 UTC
Created attachment 1114343 [details]
purple-url-handler.new

Comment 2 Jan Synacek 2016-01-13 09:23:34 UTC
Created attachment 1114344 [details]
tmp.patch

tmp.patch as it came out on my machine, in case it's needed.

Comment 3 Jan Synacek 2016-01-13 09:26:31 UTC
As bizzare as this may sound, I can't fix https://bugzilla.redhat.com/show_bug.cgi?id=1245310 because of this.

Comment 4 Tim Waugh 2016-01-13 12:48:32 UTC
Is there a reason you're not using diff's -u switch to specify that you want 'unified' format output?

When using diff with no options and two files are arguments, you'll get 'normal' format diff output with no filename header. This means you'll need to tell patch which file to apply the diff to. For example:

diff purple-url-handler purple-url-handler.new  > tmp.patch
patch purple-url-handler < tmp.patch

Comment 5 Jan Synacek 2016-01-13 14:18:52 UTC
Well, the problem seems to be between the chair and the machine... The patch works fine if applied manually, it just doesn't work when I'm building an rpm using fedpkg... Anyway, this is not a patch/diffutils bug. Sorry for the noise.