in reply to How to patch modules with CPAN patch releases

Point one: patch wants to reach its patches from standard input by default, not from a file you give it on the command line.

Point two: the patch files themselves contain the paths of the files to be patched:

diff --git a/Makefile.PL b/Makefile.PL index 26ab13e..b966faa 100644 --- a/Makefile.PL # original file name +++ b/Makefile.PL # name of modified file

(comments added by me).

The filnames are a/Makefile.PL and b/Makefile.PL. But if your Makefile.PL is in the current directory, you need to tell patch to strip the a/ and b/ prefix. That's just one directory level each, so you need the -p1 option.

In summary, in the directory that contains the code, to have patch modify the files in-place, run:

patch -p1 < file-with-the-patches.diff

Replies are listed 'Best First'.
Re^2: How to patch modules with CPAN patch releases
by Anonymous Monk on May 27, 2012 at 14:03 UTC
    Thanks folks for taking the time out of your day to answer my question. I have noted your answers, (--dry-run will forever remain in my brain ;) but, sadly I am still getting error(s) :

    With # patch -p1 < patchname.patch

    patching file Makefile.PL
    Assertion failed: hunk, file .\src\patch\2.5.9\patch-2.5.9-src\patch.c, line 354
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.

    I am not sure how to proceed...

        Sadly, time is against me to chase up a patch for patch.

        But, its happy days because I was able to install Net::Pcap on activestate Perl after adding the bribes.org repository.

        I now have some code in place grabbing the packets from the network as desired, and with the help of the Net::Pcap tutorial on this site :)

        Again, thank you folks for you help, I move forward with my developments.
        Have a nice day !