Hi Yavor,

That doesn't work either. I get the feeling we're trying to solve the
wrong problem here. I'm going back to the original issue.

I start with the *untouched* Scmbug 0.26.22 RPMs. The *only* line I add
to /usr/share/scmbug/lib/Scmbug/Daemon/Bugzilla.pm is at line 145:

    print STDOUT Dumper( @INC );

Then trying to run the scmbug daemon I get the following output:

$ /usr/bin/perl /usr/sbin/scmbug_daemon.pl /etc/scmbug/daemon.conf
$VAR1 = '/srv/bugzilla-3.4.10/lib';
$VAR2 = '/srv/bugzilla-3.4.10';
$VAR3 = '/usr/share/scmbug/lib';
$VAR4 = '/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi';
$VAR5 = '/usr/lib/perl5/5.10.0';
$VAR6 = '/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi';
$VAR7 = '/usr/lib/perl5/site_perl/5.10.0';
$VAR8 = '/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi';
$VAR9 = '/usr/lib/perl5/vendor_perl/5.10.0';
$VAR10 = '/usr/lib/perl5/vendor_perl';
$VAR11 = '.';

The paths to my Bugzilla installation are clearly there: $VAR1 and
$VAR2. However, the activity.log file shows:

2011/03/09 13:26:20 Scmbug WARN> 
Daemon.pm:81:Scmbug::Daemon::Daemon::read_configuration - Read configuration 
file '/etc/scmbug/daemon.conf'
2011/03/09 13:26:20 Scmbug ERROR> 
Daemon.pm:114:Scmbug::Daemon::Daemon::read_configuration -
*******************************************
**
**
** Scmbug error 79: Package 'Bugzilla' not found in installation directory 
'/srv/bugzilla-3.4.10'.
Initialization of bug-tracking system 'Bugzilla' version '3.4.10' failed. This 
could be due to an unsupported version of this system, or misconfiguration.
**
**
*******************************************

This is the issue and this issue should be solved! 

One solution -- set PERL5LIB in /etc/init.d/scmbug-server -- was already
suggested by Thorsten and works. Personally I can happily live with that
solution. However, Kristis rejected it as not being a "real" solution,
because it contains a hard-coded path in scmbug-server. So, the quest is
now for the "real" solution!


Cheers,
Marcel Loose.


On Wed, 2011-03-09 at 11:53 +0200, Yavor Nikolov wrote:
> Another thing to try - surround unshift stuff with BEGIN block:
> 
> BEGIN {
> $installation_directory = "....";
> use lib $installation_directory . "/lib";
> use lib $installation_directory;
> }
> 
> Yavor
> 
> On Wed, Mar 9, 2011 at 11:49, Yavor Nikolov <[email protected]>
> wrote:
>         Hi Marcel,
>         
>         * use lib seems to require hardcoded paths.
>         * I think there is something weird with your perl... What's
>         the output of "perl -V"?
>         * You can try with different perl setup (you can compile it
>         yourself or just install from some package to alternative
>         path).
>         
>         Regards,
>         Yavor
>         
>         
>         
>         On Wed, Mar 9, 2011 at 11:37, Marcel Loose <[email protected]>
>         wrote:
>                 Hi Yavor,
>                 
>                 I tried your code.
>                 
>                 Option 1 appears to work (using Bugzilla 3.6, that is,
>                 because 3.4
>                 doesn't have Bugzilla::Bug::is_open_state()).
>                 
>                 $ ./scmbug_test.pl
>                 status = UNCONFIRMED, is_open = 1
>                 status = NEW, is_open = 1
>                 status = ASSIGNED, is_open = 1
>                 status = REOPENED, is_open = 1
>                 status = RESOLVED, is_open = 0
>                 status = VERIFIED, is_open = 0
>                 status = CLOSED, is_open = 0
>                 end
>                 
>                 
>                 Option 2 doesn't work for me:
>                 
>                 Undefined subroutine
>                 &Bugzilla::Field::get_legal_field_values called
>                 at ./scmbug_test.pl line 22.
>                 
>                 
>                 However, when I change the hardcoded path in option 1
>                 with:
>                 
>                 use lib $installation_directory . "/lib";
>                 use lib $installation_directory;
>                 
>                 I get an error message comparable to the one I got
>                 when I tried
>                 Thorsten's first suggestion (use 'use lib' in
>                 Bugzilla.pm):
>                 
>                 Use of uninitialized value $installation_directory in
>                 concatenation (.)
>                 or string at ./scmbug_test.pl line 11.
>                 Empty compile time value given to use lib
>                 at ./scmbug_test.pl line 12
>                 Use of uninitialized value in require
>                 at /usr/lib/perl5/site_perl/5.10.0/DateTime/Locale/Base.pm 
> line 8.
>                 Undefined subroutine
>                 &Bugzilla::Field::get_legal_field_values called
>                 at ./scmbug_test.pl line 22.
>                 
>                 
>                 Now, I'm a Perl n00b, so I don't know how to get this
>                 to work, but it
>                 must somehow be possible to feed 'use lib' a
>                 "composed" path name,
>                 right?
>                 
>                 Cheers,
>                 Marcel.
>                 
>                 
>                 
>                 On Tue, 2011-03-08 at 15:14 +0200, Yavor Nikolov
>                 wrote:
>                 > Why don't you first test something simpler to see if
>                 Bugzilla
>                 > libraries are resolved successfully? E.g.:
>                 >
>                 > use warnings;
>                 > use strict;
>                 >
>                 > my $installation_directory = "/your/bugzilla-root";
>                 >
>                 > chdir( "$installation_directory" );
>                 >
>                 > ## Option 1 - "use lib"
>                 > #use lib "/your/bugzilla-root/lib";
>                 > #use lib "/your/bugzilla-root";
>                 >
>                 > ## Option 2 - "unshift @INC"
>                 > unshift @INC, $installation_directory . "/lib";
>                 > unshift @INC, $installation_directory;
>                 >
>                 > eval "use Bugzilla";
>                 >
>                 > sub print_bugzilla_statuses
>                 > {
>                 >         my $status_values =
>                 >
>                 Bugzilla::Field::get_legal_field_values( 'bug_status' );
>                 >
>                 >         foreach my $status ( @$status_values )
>                 >         {
>                 >                 my $is_open =
>                 Bugzilla::Bug::is_open_state( $status );
>                 >                 print( "status = $status, is_open =
>                 $is_open\n" );
>                 >         }
>                 > }
>                 >
>                 >
>                 > print_bugzilla_statuses();
>                 >
>                 > print( "end\n" );
>                 >
>                 >
>                 > Regards,
>                 > Yavor
>                 >
>                 >
>                 > On Tue, Mar 8, 2011 at 14:37, Marcel Loose
>                 <[email protected]> wrote:
>                 >         On Mon, 2011-03-07 at 19:00 +0100, Thorsten
>                 Schöning wrote:
>                 >         > Guten Tag Marcel Loose,
>                 >         > am Montag, 7. März 2011 um 18:14 schrieben
>                 Sie:
>                 >         >
>                 >         > > It does. See my mail from earlier today
>                 (10h13) in which I
>                 >         provided the
>                 >         > > output of both @INC and $self. However,
>                 I think
>                 >         Cwd::getcwd() will give
>                 >         > > you the current working directory, and
>                 that's not what
>                 >         you're after.
>                 >         >
>                 >         > The following is one line above the
>                 alternative and looks
>                 >         like the
>                 >         > current working directory is set,
>                 therefore I tried to use
>                 >         it, if
>                 >         > $self won#t work for some reason.
>                 >         >
>                 >         > chdir $self->installation_directory();
>                 >         >
>                 >         > Mit freundlichen Grüßen,
>                 >         >
>                 >         > Thorsten Schöning
>                 >         >
>                 >
>                 >
>                 >         Hi Thorsten,
>                 >
>                 >         If I recap:
>                 >
>                 >              * @INC does get set correctly (see my
>                 yesterday's mail
>                 >         from
>                 >                10:13), even in the untouched Scmbug
>                 0.26.22 code.
>                 >              * None of the changes you suggest seem
>                 to work.
>                 >
>                 >         That leaves the one solution the Kristis
>                 doesn't like:
>                 >
>                 >              * set environment variable PERL5LIB in
>                 scmbug-server
>                 >
>                 >         I guess this problem should be investigated
>                 further and maybe
>                 >         an issue
>                 >         should be opened for this in the Bug
>                 tracker. What do you
>                 >         think?
>                 >
>                 >         Cheers,
>                 >         Marcel.
>                 >
>                 >
>                 >
>                 >
>                 _______________________________________________
>                 >         scmbug-users mailing list
>                 >         [email protected]
>                 >
>                 http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
>                 >
>                 >
>                 
>                 
>                 
>                 
>         
>         
> 



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

Reply via email to