On Fri, 2010-06-18 at 17:30 +0000, Kristis Makris wrote:
> Michal,
> 
> On Fri, 2010-06-18 at 08:54 +0200, Michal Kašpar wrote:
> > +    unshift @INC, 
> > $self->installation_directory()."/lib/x86_64-linux-thread-multi";
> 
> Why x86_64-linux-thread-multi ? We can't just hardcode this in Scmbug.

I don't know. But without this line, it just didn't work. I'm not a perl
programmer and I tried it being quite desperate while trying to get this
working. It seems to me, there are architecture specific libraries and
there must be a way to include this in a generic way.
I got it. According to this
http://servers.digitaldaze.com/extensions/perl/modules.html architecture
specific files are added automatically when using use lib but not
unshift:

The architecture specific directories are being searched by perl
automatically Each time you want to use modules in that path you should
add the following line to your scripts:

        use lib qw(/usr/home/USERNAME/usr/local/lib/perl5 
        /usr/home/USERNAME/usr/local/lib/perl5/site_perl);

You don't have to put it into a BEGIN block; the lib.pm module takes
care of that for you. It also adds the architecture specific
directories.

You also can use a BEGIN block to include your installed modules:

        BEGIN { unshift @INC, qw(/usr/home/USERNAME/usr/local/lib/perl5 
        /usr/home/USERNAME/usr/local/lib/perl5/site_perl); }

However, the use lib construct seems to be cleaner and the unshift
@INC construct doesn't automatically add the architecture specific
directories to the @INC array.

So I tried to delete the arch specific line and changed
    if ($self->is_version_latest()) {
        unshift @INC, $self->installation_directory() . "/lib";
    }

to
    if ($self->is_version_latest()) {
        use lib qw(my_path_to_bugzilla/lib);
    }

and it started to work. But if I tried to switch the constant in use lib
for $self->install... I ran into
http://www.perlmonks.org/?node_id=285370 and this is where my perl
skills end for now. But maybe if someone more gifted tries, the result
might be better.

> It is still not clear to me how this directory, and even
> "/lib" (although we do include it) must be included. Clearly, if this

Well. I didn't notice /lib directory inclusion was added since I made
this patch and if I delete the line from my patch, it works still just
fine.

-- 
Michal Kašpar

_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to