LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2010, 08:45 PM   #1
snowweb
Member
 
Registered: May 2008
Distribution: Ubuntu12, CentOS6
Posts: 61

Rep: Reputation: 0
Error trying to patch source code


I'm running spamassassin and want to install the fuzzyocr module for it. One of the dependencies of fuzzyocr is 'giflib' but according to the fuzzyocr page, it needs to be patched before I install it, with a patch which they supply on the fuzzyocr download page. I've tried to install the patch and get the following error. I'm wondering if anyone can tell me what I'm doing wrong please?

Code:
[root@s1 giflib-4.1.6]# patch --ignore-whitespace --input=/root/downloads/giftext-segfault.patch
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
--------------------------
|*** giftext.c.orig 2006-08-21 15:41:47.000000000 -0400
|--- giftext.c 2006-08-21 15:41:55.000000000 -0400
--------------------------
File to patch: /giflib-temp/giflib-4.1.6/util/giftext.c
patching file /giflib-temp/giflib-4.1.6/util/giftext.c
Hunk #1 FAILED at 135.
1 out of 1 hunk FAILED -- saving rejects to file /giflib-temp/giflib-4.1.6/util/giftext.c.rej

To find the file to patch, I just looked through the files to find one called giftext.c or giftext.c.orig. I found giftext.c a directory lower, so specified that.

What did I do wrong please?

Regards,

Peter
 
Old 05-15-2010, 08:52 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Perhaps you should have used the -p or --strip option?
 
0 members found this post helpful.
Old 05-15-2010, 09:36 PM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,256

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Try either -Np1 or -Np0 instead. I find these normally work.
Looks like:
Code:
patch -Np1 /path/to/patch
 
1 members found this post helpful.
Old 05-16-2010, 01:05 AM   #4
snowweb
Member
 
Registered: May 2008
Distribution: Ubuntu12, CentOS6
Posts: 61

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by grail View Post
Try either -Np1 or -Np0 instead. I find these normally work.
Looks like:
Code:
patch -Np1 /path/to/patch
Thanks Grail. Here's the output:

Code:
[root@s1 giflib-4.1.6]# patch -Np1 < /root/downloads/giftext-segfault.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|*** giftext.c.orig    2006-08-21 15:41:47.000000000 -0400
|--- giftext.c    2006-08-21 15:41:55.000000000 -0400
--------------------------
File to patch: /giflib-temp/giflib-4.1.6/util/giftext.c
patching file /giflib-temp/giflib-4.1.6/util/giftext.c
Hunk #1 FAILED at 135.
1 out of 1 hunk FAILED -- saving rejects to file /giflib-temp/giflib-4.1.6/util/giftext.c.rej

[root@s1 giflib-4.1.6]# patch -p < /root/downloads/giftext-segfault.patch
patch: option requires an argument -- p
I appreciate your help Grail.

peter
 
  


Reply

Tags
patch


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Is government open source code we can patch? LXer Syndicated Linux News 0 04-29-2008 06:50 AM
Error while installing firefox 2 source code karthi26 Linux - Newbie 5 07-20-2007 10:52 PM
Slack 11.0 patch source code freetype-2.3.4 acummings Slackware 9 04-22-2007 11:51 AM
Source-code error in Tripwire when building Ephracis Linux - Software 2 02-24-2005 01:02 PM
Applying patch to source code dax_neoburn Linux - Software 2 10-02-2003 09:38 PM


All times are GMT -5. The time now is 05:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration