﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
31	patch doesn't work properly	dbanet		"I recently wanted to apply a diff file to {{{openssl}}} sources, and found that the {{{patch}}} build from the netlabs RPM repo fails, while a build from Paul Smedley (same version) manages to apply the diff without any problem.

I've zipped both {{{patch}}} binaries, the diff file and {{{openssl}}} sources, attached ({{{patch_test.zip}}}).

{{{
[C:\tmp]md test

[C:\tmp]cd test

[C:\tmp\test]unzip -qq ..\patch_test.zip

[C:\tmp\test]
}}}

Here goes the {{{patch}}} from netlabs RPM:

{{{
[C:\tmp\test].\patch_rpm.exe -p0 <openssl-1.0.0n-os2-20140807.diff
patching file openssl-1.0.0n/Configure
Hunk #1 FAILED at 567.
Hunk #2 FAILED at 588.
Hunk #3 FAILED at 1303.
3 out of 3 hunks FAILED -- saving rejects to file openssl-1.0.0n/Configure.rej
patching file openssl-1.0.0n/apps/openssl.c
Hunk #1 FAILED at 110.
Hunk #2 FAILED at 284.
2 out of 2 hunks FAILED -- saving rejects to file openssl-1.0.0n/apps/openssl.c.rej
patching file openssl-1.0.0n/crypto/LPdir_unix.c
Hunk #1 FAILED at 102.
1 out of 1 hunk FAILED -- saving rejects to file openssl-1.0.0n/crypto/LPdir_unix.c.rej
patching file openssl-1.0.0n/crypto/o_dir.c
Hunk #1 FAILED at 70.
1 out of 1 hunk FAILED -- saving rejects to file openssl-1.0.0n/crypto/o_dir.c.rej
patching file openssl-1.0.0n/crypto/perlasm/x86asm.pl
Hunk #1 FAILED at 167.
Hunk #2 FAILED at 189.
2 out of 2 hunks FAILED -- saving rejects to file openssl-1.0.0n/crypto/perlasm/x86asm.pl.rej
patching file openssl-1.0.0n/crypto/perlasm/x86gas.pl
Hunk #1 FAILED at 152.
1 out of 1 hunk FAILED -- saving rejects to file openssl-1.0.0n/crypto/perlasm/x86gas.pl.rej
patching file openssl-1.0.0n/crypto/rand/rand_os2.c
Hunk #1 FAILED at 65.
Hunk #2 FAILED at 78.
Hunk #3 FAILED at 119.
3 out of 3 hunks FAILED -- saving rejects to file openssl-1.0.0n/crypto/rand/rand_os2.c.rej
patching file openssl-1.0.0n/e_os.h
Hunk #1 FAILED at 635.
Hunk #2 FAILED at 693.
Hunk #3 FAILED at 704.
3 out of 3 hunks FAILED -- saving rejects to file openssl-1.0.0n/e_os.h.rej
patching file openssl-1.0.0n/os2/OS2-EMX.cmd
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file openssl-1.0.0n/os2/OS2-EMX.cmd.rej
patching file openssl-1.0.0n/os2/OS2-KNIX.cmd
patching file openssl-1.0.0n/util/mk1mf.pl
Hunk #1 FAILED at 74.
Hunk #2 FAILED at 208.
Hunk #3 FAILED at 518.
Hunk #4 FAILED at 1053.
4 out of 4 hunks FAILED -- saving rejects to file openssl-1.0.0n/util/mk1mf.pl.rej
patching file openssl-1.0.0n/util/mkdef.pl
Hunk #1 FAILED at 75.
Hunk #2 FAILED at 150.
Hunk #3 FAILED at 218.
Hunk #4 FAILED at 1261.
Hunk #5 FAILED at 1279.
Hunk #6 FAILED at 1293.
Hunk #7 FAILED at 1322.
7 out of 7 hunks FAILED -- saving rejects to file openssl-1.0.0n/util/mkdef.pl.rej
patching file openssl-1.0.0n/util/mklink.pl
Hunk #1 FAILED at 52.
1 out of 1 hunk FAILED -- saving rejects to file openssl-1.0.0n/util/mklink.pl.rej
patching file openssl-1.0.0n/util/pl/OS2-EMX.pl
Hunk #1 FAILED at 4.
Hunk #2 FAILED at 12.
Hunk #3 FAILED at 25.
Hunk #4 FAILED at 50.
Hunk #5 FAILED at 88.
5 out of 5 hunks FAILED -- saving rejects to file openssl-1.0.0n/util/pl/OS2-EMX.pl.rej
}}}

Didn't work out...

{{{
[C:\tmp\test]rm -rf *

[C:\tmp\test]unzip -qq ..\patch_test.zip

[C:\tmp\test]
}}}

Here goes Paul's build:

{{{
[C:\tmp\test].\patch_paul.exe -p0 <openssl-1.0.0n-os2-20140807.diff
patching file openssl-1.0.0n/Configure
patching file openssl-1.0.0n/apps/openssl.c
patching file openssl-1.0.0n/crypto/LPdir_unix.c
patching file openssl-1.0.0n/crypto/o_dir.c
patching file openssl-1.0.0n/crypto/perlasm/x86asm.pl
patching file openssl-1.0.0n/crypto/perlasm/x86gas.pl
patching file openssl-1.0.0n/crypto/rand/rand_os2.c
patching file openssl-1.0.0n/e_os.h
patching file openssl-1.0.0n/os2/OS2-EMX.cmd
patching file openssl-1.0.0n/os2/OS2-KNIX.cmd
patching file openssl-1.0.0n/util/mk1mf.pl
patching file openssl-1.0.0n/util/mkdef.pl
patching file openssl-1.0.0n/util/mklink.pl
patching file openssl-1.0.0n/util/pl/OS2-EMX.pl
}}}

Perfect.

I suggest simply replacing the binary from the RPM package with Paul's build.

The exact RPM package I've tried to use is...

{{{
[C:\]yum list installed | grep patch
patch.i386                           2.6.1-4.oc00                   installed
}}}"	enhancement	closed	major		*none			invalid		
