This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to apply a Patch with TortoiseSVN

0

Hi

How can I apply a Patch to Wireshark using TortoiseSVN application?

asked 08 Mar '13, 14:39

steve21's gravatar image

steve21
11557
accept rate: 0%


One Answer:

0

Not really a Wireshark question.

Anyway a patch file modifies the source code of an application not the binary. You'll need to get a Wireshark development environment setup first, check you can build an unmodified version, then apply the patch and rebuild.

To apply the patch with Tortoise, right click on the top level directory and from the Tortoise menu select "Apply patch", then select the patch file.

answered 08 Mar '13, 14:54

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Hi

Thanks for your answer. Still I could not apply it. Do you know any other method to apply it?

1) I have Download the wireshark source code and compile with Microsoft Visual Studio nmake -f Makefile.nmake setup nmake -f Makefile.nmake all 2) Checkout the following patch file from our SVN repositoy and try to apply the Patch using Tortoise SVN. 3) Finally I compile the wireshark source code using the command 'nmake -f Makefile.nmake all' 4) Run wireshark from the directory wireshark/wireshark-gtk2 using the command 'wireshark.exe'

(08 Mar '13, 15:21) steve21

So presumably

2) Checkout the following patch file from our SVN repositoy and try to apply the Patch using Tortoise SVN.

failed, if you "could not apply [the patch]". What happened when you tried it? Did Tortoise report an error? If so, what was the error?

(08 Mar '13, 15:29) Guy Harris ♦♦

I am not so sure but when I apply it, I see 3 TortoiseUdiff windows with message 'Rejected patch hunks for 'packet-gprscdr.c'

(Converted to a comment in keeping with the convention for using ask.wireshark.org. Please see the FAQ).

(08 Mar '13, 15:38) steve21

"rejected patch hunks..." means just that. At least some parts (hunks) of the patch didn't apply cleanly to the source file.

This usually happens because the source file has changed somehow (in the lines affected by the patch) since the patch was made.

Patch matches lines around the patch before applying the patch.

So: If you want to fix things manually, you'll need to use an editor to examine the patch file and the source file, determine which patches (if any) did get applied, see why the others didn't get applied, and then update the source file as needed with the un-applied patch hunks.

(08 Mar '13, 18:11) Bill Meier ♦♦

packet-gprscdr.c is a generated dissector perhaps you should patch or add the asn1 files you presumably changed and regenerate the dissector with asn2wrs or if possibly offer the changes to GPL Wireshark to have them included.

(09 Mar '13, 00:17) Anders ♦