Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

let rpm %patch not use default --fuzz=0 option

Tags:

rpm

I got error as following in el6 machine:

Patch #4 (test.patch):
+ /bin/cat /path/to/test.patch
+ /usr/bin/patch -s -p0 --fuzz=0
1 out of 4 hunks FAILED -- saving rejects to file ***
1 out of 1 hunk FAILED -- saving rejects to file ***
error: Bad exit status from /var/tmp/rpm-tmp.YeRtKr (%prep)

However, I can apply the patch file with commond as following:

/usr/bin/patch -s -p0 < /path/to/test.patch.

I note that rpm set --fuzz=0 by default. Is there some way to let rpm not set --fuzz=0 option?

like image 997
xiaochen Avatar asked Jan 17 '26 22:01

xiaochen


1 Answers

From the Fedora project wiki:

Try to ensure that your patch match the context exactly. The default "fuzz" value is "0", requiring matches to be exact. You can work around this by adding %global _default_patch_fuzz 2 to revert to the value found in older versions of RPM in Fedora, but it is generally recommended to avoid doing this.

like image 177
willb Avatar answered Jan 21 '26 00:01

willb