in reply to How to patch this module?

Update: This is perhaps a long winded approach, but I think it helps to understand the process in full.

Download the module, extract the archive, then:

wget https://rt.cpan.org/Ticket/Attachment/1576496/841876/0001-Fix-a-p +ad-problem-with-Perl-5.21.4-on-threaded-build.patch marto@shemp ~/Devel-CallParser-0.002 $ patch -p1 < 0001-Fix-a-pad-prob +lem-with-Perl-5.21.4-on-threaded-build.patch patching file lib/Devel/CallParser.xs patching file t/pad2.t

Notice that the patch has created the new file you're looking for (you can see everything the patch does by reading it and following the logic). Then:

marto@shemp ~/Devel-CallParser-0.002 $ cpanm . --> Working on . Configuring Devel-CallParser-0.002 ... OK Building and testing Devel-CallParser-0.002 ... OK Successfully installed Devel-CallParser-0.002 1 distribution installed

Replies are listed 'Best First'.
Re^2: How to patch this module?
by ultranerds (Hermit) on Mar 28, 2017 at 09:39 UTC
    Ah you star - that did it. I missed the -p1 part from the query. I still get this though:
    patch -p1 < 0001-Fix-a-pad-problem-with-Perl-5.21.4-on-threaded-build. +patch can't find file to patch at input line 19 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From ba92f4cba247c91d100e05f2b83dd093055e462b Mon Sep 17 00:00:00 200 +1 |From: Niko Tyni <ntyni@debian.org> |Date: Fri, 25 Dec 2015 18:53:08 +0200 |Subject: [PATCH] Fix a pad problem with Perl >= 5.21.4 on threaded bu +ilds | |This broke at least the Kavorka and Moops distributions. | |Bug-Debian: https://bugs.debian.org/808826 |--- | lib/Devel/CallParser.xs | 10 +++++++--- | t/pad2.t | 15 +++++++++++++++ | 2 files changed, 22 insertions(+), 3 deletions(-) | create mode 100644 t/pad2.t | |diff --git a/lib/Devel/CallParser.xs b/lib/Devel/CallParser.xs |index 6643739..847742c 100644 |--- a/lib/Devel/CallParser.xs |+++ b/lib/Devel/CallParser.xs -------------------------- File to patch:

    UPDATE: Never mind, me being dumb! I was in the wrong directory, so it couldn't find the files ;)

      Can you show me the path you're doing this from, and an ls within the current working directory?

        YAY! I was finally able to install the module I needed:

        root@mail:~# cpanm Kavorka --> Working on Kavorka Fetching http://www.cpan.org/authors/id/T/TO/TOBYINK/Kavorka-0.037.tar +.gz ... OK Configuring Kavorka-0.037 ... OK Building and testing Kavorka-0.037 ... OK Successfully installed Kavorka-0.037 1 distribution installed
        ...and....
        root@mail:~# cpanm Net::Stripe --> Working on Net::Stripe Fetching http://www.cpan.org/authors/id/R/RC/RCONOVER/Net-Stripe-0.30. +tar.gz ... OK Configuring Net-Stripe-0.30 ... OK Building and testing Net-Stripe-0.30 ... OK Successfully installed Net-Stripe-0.30 1 distribution installed


        That was so painful! Thanks to everyone for walking me through how to sort it. I was loosing hair over that. Also good to learn how to apply patches, as I've never had to do that before

        Thanks again!