LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-04-2010, 07:50 AM   #1
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
pgm2txt script error


I have compiled both gocr and subtitleripper from slackbuilds.org and I am running into a problem with one of the scripts run from subtitleripper: pgm2txt. The error is:

Code:
andrew@skamandros~/Desktop/Labyrinth/subtitles$ pgm2txt -f en fauno
/usr/bin/pgm2txt: line 165: unexpected EOF while looking for matching `"'
/usr/bin/pgm2txt: line 179: syntax error: unexpected end of file
Support for this program is not available and development has ceased a while ago so I have had a look at the script itself and I cannot see the error in syntax. Has anybody had some experience with this script and can perhaps see the error?

Andrew
 
Old 10-04-2010, 11:41 AM   #2
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 14.2, slackware 13.1
Posts: 371

Rep: Reputation: 54
Perhaps the error is in the en or fauno files (whichever is a file)?
That is my best guess
 
Old 10-04-2010, 12:30 PM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The error does seem to be coming from the script itself, but there is nothing obviously wrong with it. I don't have gocr, etc set up, so I can't really test it well. On the subtitleripper site, it says that pgm2txt is included in transcode. Do you have transcode installed?
 
Old 10-04-2010, 09:42 PM   #4
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Original Poster
Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Thank you janhe and gnashley for your suggestions, the puzzling part of this problem was that as gnashley pointed out the script itself in the tarball was fine. It was only when I examined the installed script /usr/bin/pgm2txt that I noticed that in fact this script had been mangled during the installation with errors from line 111, where the path to PATH_TO_LANGUAGE_FILTER had been slammed in destroying the if statement.

I cannot yet see where this has happened during installation but I simply took the 'clean' script from the tarball, made the required configuration changes, fixed the 'IMAGE_VIWER' typo and copied it to /usr/bin, the program now works beautifully. Now to investigate what needs to be altered in the slackbuilds script which needs some obvious adjustments, can anybody see the culprit? Mind you I am a little chuffed that I have just now produced my first srt file courtesy of subtitle2pgm, pgm2txt and srttool .

Edit: The error is in here:

Code:
EXECUTE_PROCESS(
	INPUT_FILE pgm2txt
	OUTPUT_FILE pgm2txt.new
	COMMAND sed s|PATH_TO_LANGUAGE_FILTER.*|PATH_TO_LANGUAGE_FILTER=@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/subtitleripper|
)

EXECUTE_PROCESS(
	COMMAND mv pgm2txt.new pgm2txt
)
where sed makes the first necessary change and then the second and third changes that destroy the script. How to make sed just match the first?

Edit again: Too easy! There is an extra fix in there for the path to the filter files

Code:
COMMAND sed s|^PATH_TO_LANGUAGE_FILTER.*|PATH_TO_LANGUAGE_FILTER=@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/subtitleripper/|

Andrew

Last edited by andrew.46; 10-04-2010 at 10:30 PM.
 
  


Reply



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
why am getting error ksh: syntax error: `fi' unexpected while running script deb4you Linux - Newbie 4 09-06-2008 08:37 AM
bash script read error and awk ouptut error whited Programming 4 10-16-2007 07:05 PM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 09:10 PM
error when tying to run python script(bash error?) shanenin Programming 5 01-10-2006 10:01 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:35 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
Open Source Consulting | Domain Registration