Create and apply patch file

Sorry for all these dumb questions.

buildrpm, when applying a patch, always asks which file to patch.

This is what I did:

tar xzvf source.tar.gz
cd sourcedir
cp addons/vtk/ addons/vtk/vtkmesh.friends
vi addons/vtk/
diff -Naur addons/vtk/ addons/vtk/ > ~/rpmbuild/SOURCES/vtkmeshGetTupleValue.patch

In the SPEC file:

Patch0:         vtkmeshGetTupleValue.patch
%autosetup -n %{PROJECT}-%{commit}

Then when I invoke rpmbuild, I get

+ /usr/bin/cat /root/rpmbuild/SOURCES/vtkmeshGetTupleValue.patch
+ /usr/bin/patch -s --fuzz=0 --no-backup-if-mismatch
The text leading up to this was:
|--- addons/vtk/    2019-09-13 17:21:42.394198089 +0000
|+++ addons/vtk/    2019-09-13 17:23:13.352018728 +0000
File to patch: 

If I put the file name, I get

Reversed (or previously applied) patch detected!  Assume -R? [n] 

Where is my fault?

You’ve got your diff args backwards, the modified file should be the second argument.

1 Like

Uh :relaxed: you are right.

1 Like