[interchange-cvs] interchange - racke modified lib/Vend/Config.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Jun 23 16:17:59 EDT 2006
User: racke
Date: 2006-06-23 20:17:59 GMT
Modified: lib/Vend Config.pm
Log:
allow specification of one additional include directory for modules like
that:
Require module Vend::Swish /usr/lib/swish-e/perl
Revision Changes Path
2.206 +13 -2 interchange/lib/Vend/Config.pm
rev 2.206, prev_rev 2.205
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.205
retrieving revision 2.206
diff -u -r2.205 -r2.206
--- Config.pm 9 Apr 2006 23:27:53 -0000 2.205
+++ Config.pm 23 Jun 2006 20:17:58 -0000 2.206
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.205 2006/04/09 23:27:53 docelic Exp $
+# $Id: Config.pm,v 2.206 2006/06/23 20:17:58 racke Exp $
#
# Copyright (C) 2002-2006 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -54,7 +54,7 @@
use Vend::Data;
use Vend::Cron;
-$VERSION = substr(q$Revision: 2.205 $, 10);
+$VERSION = substr(q$Revision: 2.206 $, 10);
my %CDname;
my %CPname;
@@ -2627,11 +2627,16 @@
my $carptype;
my $error_message;
+ my $pathinfo;
if($val =~ s/\s+"(.*)"//s) {
$error_message = "\a\n\n$1\n";
}
+ if($val =~ s%\s+((/[\w-]+)+)%%) {
+ $pathinfo = $1;
+ }
+
if($cap) {
$carptype = sub { return; };
}
@@ -2689,7 +2694,13 @@
}
$module =~ /[^\w:]/ and return undef;
if(! $C or $Global::AllowGlobal->{$C->{CatalogName}}) {
+ if ($pathinfo) {
+ unshift(@INC, $pathinfo);
+ }
eval "require $module$oldtype;";
+ if ($pathinfo) {
+ shift(@INC);
+ }
::logGlobal("while eval'ing module %s got [%s]", $module, $@) if ($@);
return ! $@;
}
More information about the interchange-cvs
mailing list