Bug 625420 - patch creates .orig backup file
Summary: patch creates .orig backup file
Alias: None
Product: Fedora
Classification: Fedora
Component: patch (Show other bugs)
(Show other bugs)
Version: 13
Hardware: All Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-19 11:35 UTC by Jiri Popelka
Modified: 2010-08-20 16:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-08-20 16:16:10 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch with files to patch (11.93 KB, application/x-bzip2)
2010-08-19 11:35 UTC, Jiri Popelka
no flags Details

Description Jiri Popelka 2010-08-19 11:35:49 UTC
Created attachment 439655 [details]
patch with files to patch

Description of problem:

(01:00:42 PM) jpopelka: I have a patch that patches 2 files. When I apply it
(01:00:42 PM) jpopelka: patch -p1 --verbose --fuzz=0 <foomatic-db-device-ids-20100506.patch
(01:01:05 PM) jpopelka: it creates backup for one of the files with .orig suffix
(01:01:37 PM) twaugh: Only one?
(01:01:40 PM) jpopelka: only one
(01:01:41 PM) twaugh: What does 'lsdiff' say about the patch?
(01:02:07 PM) jpopelka: >lsdiff foomatic-db-device-ids-20100506.patch
(01:02:07 PM) jpopelka: foomatic-db-20100204/db/source/PPD/Ricoh/PS/Ricoh-Aficio_SP_C420DN_PS.ppd
(01:02:07 PM) jpopelka: foomatic-db-20100204/db/source/printer/HP-Color_LaserJet_2605dn.xml
(01:02:24 PM) jpopelka: it creates db/source/PPD/Ricoh/PS/Ricoh-Aficio_SP_C420DN_PS.ppd.orig
(01:03:15 PM) twaugh: There used to be a bug where if the same file was patched twice from the same input file, the .orig file would get overwritten the second time
(01:03:20 PM) twaugh: I wonder if the fix for that didn't work right

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. unpack the attached file (foomatic-db-20100819.tar.bz2)
2. cd foomatic-db-20100819
3. patch -p1 --verbose --fuzz=0 <foomatic-db-device-ids-20100506.patch
Actual results:
Backup file db/source/PPD/Ricoh/PS/Ricoh-Aficio_SP_C420DN_PS.ppd.orig is created.

Expected results:
No backup file created.

Comment 1 Tim Waugh 2010-08-20 16:16:10 UTC
Looks like intentional behaviour.  One of the patches required an offset of 1 line, whereas the other applied exactly.

          Back  up  a file if the patch does not match the file exactly and if
          backups are not otherwise requested.  This  is  the  default  unless
          patch is conforming to POSIX.

Note You need to log in before you can comment on or make changes to this bug.