problem with math/algotutor

Hi.

I've installed math/algotutor but when I run:

% algotutor

This error message will be shown:

Code:
Can't locate utilalgo in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.8/algotutor /usr/local/lib/perl5/5.14.2/BSDPAN /usr/local/lib/perl5/site_perl/5.14.2/mach /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/5.14.2/mach /usr/local/lib/perl5/5.14.2 . /usr/local/bin/) at /usr/local/bin/algotutor line 28.

This is line 28 of /usr/local/bin/algotutor (it is a perl script):

Code:
require "utilalgo";

That file is here:
Code:
[CMD]% find /usr/local/ -name utilalgo[/CMD]
/usr/local/lib/perl5/site_perl/5.14.2/algotutor/utilalgo

How can I fix it?
 
bkouhi said:
Code:
Can't locate utilalgo in @INC (@INC contains: /usr/local/lib/perl5/site_perl/[u]5.8.8[/u]/algotutor /usr/local/lib/perl5/5.14.2/BSDPAN /usr/local/lib/perl5/site_perl/5.14.2/mach /usr/local/lib/perl5/site_perl/5.14.2 /usr/local/lib/perl5/5.14.2/mach /usr/local/lib/perl5/5.14.2 . /usr/local/bin/) at /usr/local/bin/algotutor line 28.
[snip]
Code:
[CMD]% find /usr/local/ -name utilalgo[/CMD]
/usr/local/lib/perl5/site_perl/[u]5.14.2[/u]/algotutor/utilalgo
See the underlines. If you're lucky, you can fix it by simply adding the actual path to utilalgo to the script's @INC. If not, you could use symlinks as a workaround until it gets fixed properly.

In any case, please verify that both Perl and math/algotutor are up to date and notify the port maintainer if the discrepancy persists.
 
Thanks. That works. I found this line in the /usr/local/bin/algotutor:

Code:
use lib '/usr/local/lib/perl5/site_perl/[U]5.8.8[/U]/algotutor';

And then changed it to:
Code:
use lib '/usr/local/lib/perl5/site_perl/[U]5.14.2[/U]/algotutor';

And now it works. My ports are up to date and I don't have anything special in my make.conf, so I will send a PR for this.
 
There's definitely something peculiar with this port, but given my limited experience with ports I can't say for sure if this is an oddity or not.

But if you check out the patches which will be applied to this port (see file/patch-algotutor) then this immediately stands out for me:

Code:
 use strict;
 use Getopt::Std;
-use lib '/usr/share/perl5/algotutor';
+use lib '!!PREFIX!!/lib/perl5/site_perl/5.8.8/algotutor';
I would have expected some dynamic variable to be used instead of a hard coded version.
 
ShelLuser said:
Code:
 use strict;
 use Getopt::Std;
-use lib '/usr/share/perl5/algotutor';
+use lib '!!PREFIX!!/lib/perl5/site_perl/5.8.8/algotutor';
Ick, I don't like the looks of that. I'd expect something like this:
Code:
 use strict;
 use Getopt::Std;
-use lib '/usr/share/perl5/algotutor';
+use lib '!!PREFIX!!/share/perl5/algotutor';
 
fonz said:
Ick, I don't like the looks of that. I'd expect something like this:

Code:
 use strict][/quote]

If I'm not wrong, this port is installed into [FILE]${SITE_PERL}[/FILE] (which is [FILE]/usr/local/lib/perl5/site_perl/5.14.2[/FILE] by default) because it's not a [url=cpan.org]cpan.org[/url] project. Its homepage is [url=http://www.cyut.edu.tw/~ckhung/p/algotutor]http://www.cyut.edu.tw/~ckhung/p/algotutor/[/url], for this reason it should be installed into [FILE]${SITE_PERL}[/FILE]. (Sorry, I don't know how to say this in English :( I hope that you got what I mean).
 
bkouhi said:
because it's not a cpan.org project.
[snip]
for this reason it should be installed into ${SITE_PERL}.
Fair enough. However, that does bring us back to @ShelLuser's point: the patch in /usr/ports/math/algotutor/files/ has a specific (and old, as it turns out) version of Perl hardcoded in it, where a variable or some other dynamic construct probably makes more sense.
 
Last edited by a moderator:
Yes, the perl version is hard coded in that file, but I fixed this by the patch included in my PR. (6th post)
 
Back
Top