Hi,
Here's a patch for bric_apachectl, against version 1.4.5.
I got caught out by it because it told me it couldn't find the bricolage
libraries when the error was in fact elsewhere.
The changes are:
* The 'unshift(@INC, ...)' was potentially putting a whole set of
colon-separated paths in as a single item, which wouldn't work
(I've changed it to just add the new item)
* Made $_ local when it's set, just for neatness.
* Changed the string eval to a block eval so that it gets compiled
at compile time.
* Added $@ to the error message, so that the user gets more information
if it isn't the most likely thing (can't find the libraries).
--- bin/bric_apachectl.orig Mon Aug 19 00:50:23 2002
+++ bin/bric_apachectl Thu Nov 21 14:14:56 2002
@@ -45,20 +48,24 @@
$ENV{BRICOLAGE_ROOT} ||= "/usr/local/bricolage";
# use $BRICOLAGE_ROOT/lib if exists
- $_ = catdir($ENV{BRICOLAGE_ROOT}, "lib");
- unshift(@INC, $ENV{PERL5LIB} = defined $ENV{PERL5LIB} ?
- "$ENV{PERL5LIB}:$_" : $_)
- if -e $_;
+ local $_ = catdir($ENV{BRICOLAGE_ROOT}, "lib");
+ if (-e $_) {
+ $ENV{PERL5LIB} = defined $ENV{PERL5LIB} ? "$ENV{PERL5LIB}:$_" : $_;
+ unshift @INC, $_;
+ }
# make sure Bric is found
- eval "use Bric";
- die <<'END' if $@;
+ eval { require Bric; Bric->import };
+ die <<"END" if $@;
######################################################################
-Cannot locate Bricolage libraries. Please set the environment
+Cannot load Bricolage libraries. Please set the environment
variable BRICOLAGE_ROOT to the location of your Bricolage
installation or set the environment variable PERL5LIB to the
directory where Bricolage's libraries are installed.
+
+The specific error encountered was as follows:
+$@
######################################################################
END
--
Geoff Richards - GBdirect - http://development.gbdirect.co.uk/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general
Here's a patch for bric_apachectl, against version 1.4.5.
I got caught out by it because it told me it couldn't find the bricolage
libraries when the error was in fact elsewhere.
The changes are:
* The 'unshift(@INC, ...)' was potentially putting a whole set of
colon-separated paths in as a single item, which wouldn't work
(I've changed it to just add the new item)
* Made $_ local when it's set, just for neatness.
* Changed the string eval to a block eval so that it gets compiled
at compile time.
* Added $@ to the error message, so that the user gets more information
if it isn't the most likely thing (can't find the libraries).
--- bin/bric_apachectl.orig Mon Aug 19 00:50:23 2002
+++ bin/bric_apachectl Thu Nov 21 14:14:56 2002
@@ -45,20 +48,24 @@
$ENV{BRICOLAGE_ROOT} ||= "/usr/local/bricolage";
# use $BRICOLAGE_ROOT/lib if exists
- $_ = catdir($ENV{BRICOLAGE_ROOT}, "lib");
- unshift(@INC, $ENV{PERL5LIB} = defined $ENV{PERL5LIB} ?
- "$ENV{PERL5LIB}:$_" : $_)
- if -e $_;
+ local $_ = catdir($ENV{BRICOLAGE_ROOT}, "lib");
+ if (-e $_) {
+ $ENV{PERL5LIB} = defined $ENV{PERL5LIB} ? "$ENV{PERL5LIB}:$_" : $_;
+ unshift @INC, $_;
+ }
# make sure Bric is found
- eval "use Bric";
- die <<'END' if $@;
+ eval { require Bric; Bric->import };
+ die <<"END" if $@;
######################################################################
-Cannot locate Bricolage libraries. Please set the environment
+Cannot load Bricolage libraries. Please set the environment
variable BRICOLAGE_ROOT to the location of your Bricolage
installation or set the environment variable PERL5LIB to the
directory where Bricolage's libraries are installed.
+
+The specific error encountered was as follows:
+$@
######################################################################
END
--
Geoff Richards - GBdirect - http://development.gbdirect.co.uk/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general