Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

There is a patch fix for perl module net::ssh2 it fixes a seg fault error that happens on some machines.

It's located here: https://rt.cpan.org/Public/Bug/Display.html?id=36614

I downloaded the patch but i'm not sure how to apply it. I removed the module i previously installed, went to the build folder and did

patch ssh2.xs < p1

it asked me if the patch was in reverse. I wasn't sure so i hit yes. IT says patch succeed then tells me ok. modules installed. I don't think either the patch worked or i'm moving my patched version in correctly. I feel that way because i still get the seg fault and everyone say this fixes it. Can someone guide me here?

share|improve this question
    
We can't guide you because we don't know what you did after running patch. Copy-paste the exact commands that you ran and the output from these commands. –  Gilles Dec 30 '11 at 21:53
    
hi @Arian, how did this go for you? –  Nikhil Mulley Jan 14 '12 at 10:44
    
After reading more about net:ssh2 i decided to use a different library that was more compatible with different archs. –  Arian Jan 21 '12 at 16:45
add comment

2 Answers

Proper patch invocation will looks like:

patch -p1 < net-ssh2-0.18-perl5.10.patch

You have do this in the directory, where is file SSH2.xs.

share|improve this answer
    
can you explain the "p1" parameter? –  Arian Dec 29 '11 at 17:14
    
I checked man patch but it still doesn't make sense to me. –  Arian Dec 29 '11 at 17:55
    
@Arian Regarding -p1, see When patching what's the difference between arguments -p0 and -p1? –  Gilles Dec 30 '11 at 21:52
    
@Arian It's about a directory part in diff header. In this case you can see in diff header this string: Net-SSH-0.18.orig/SSH2.xs. If you use -p1 parametr, patch utility will strip from this string leading directory and you will get a /SSH2.xs, which you want patch. With -p0 parameter will patch don't strip from this string nothing. –  Jan Marek Jan 2 '12 at 7:58
add comment

Direct excerpt from gnu patch manpage:

   -p<num>  or  --strip=num
      Strip the smallest prefix containing num leading slashes from each file name found in the patch file.  A sequence of  one  or  more  adjacent
      slashes  is  counted  as  a single slash.  This controls how file names found in the patch file are treated, in case you keep your files in a
      different directory than the person who sent out the patch.  For example, supposing the file name in the patch file was

         /u/howard/src/blurfl/blurfl.c

      setting -p0 gives the entire file name unmodified, -p1 gives

         u/howard/src/blurfl/blurfl.c

      without the leading slash, -p4 gives

         blurfl/blurfl.c

      and not specifying -p at all just gives you blurfl.c.  Whatever you end up with is looked for either in the current directory, or the  direc-
      tory specified by the -d option.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.