[interchange-cvs] interchange - jon modified lib/Vend/Config.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Jan 29 14:29:45 EST 2007


User:      jon
Date:      2007-01-29 19:29:45 GMT
Modified:  lib/Vend Config.pm
Log:
Add directive to prepend a directory to Perl's @INC path for module loading,
in interchange.cfg, such as:

Require PerlInclude /path/to/custom/lib/dir

or relative to Interchange root:

Require PerlInclude custom/lib

(Also allowed is "Require Include" ... akin to "Require PerlModule" and
"Require Module".)

Patch supplied by Max Cohan <max at endpoint.com> and tested in production
for a long time now. Thanks, Max!

Revision  Changes    Path
2.211     +15 -2     interchange/lib/Vend/Config.pm


rev 2.211, prev_rev 2.210
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.210
retrieving revision 2.211
diff -u -u -r2.210 -r2.211
--- Config.pm	21 Nov 2006 22:32:12 -0000	2.210
+++ Config.pm	29 Jan 2007 19:29:45 -0000	2.211
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.210 2006/11/21 22:32:12 racke Exp $
+# $Id: Config.pm,v 2.211 2007/01/29 19:29:45 jon 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.210 $, 10);
+$VERSION = substr(q$Revision: 2.211 $, 10);
 
 my %CDname;
 my %CPname;
@@ -2718,6 +2718,19 @@
 				return $found;
 			}
 		};
+	}
+	elsif ($val =~ s/^(?:perl)?include\s+//i) {
+		my $path = Vend::File::make_absolute_file($val, 1);
+		$require = {};
+		$name = 'Perl include path';
+		$testsub =
+			sub {
+				if (-d $path) {
+					unshift @INC, $path;
+					return 1;
+				}
+				return 0;
+			};
 	}
 	my @requires = grep /\S/, split /\s+/, $val;
 








More information about the interchange-cvs mailing list