[interchange-cvs] interchange - heins modified 2 files
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Sun Feb 3 18:12:00 2002
User: heins
Date: 2002-02-03 23:11:57 GMT
Modified: lib/Vend Config.pm Control.pm
Log:
* Don't compile code definitions if only controlling Interchange.
* Add check to parse_require so requires won't fail when controlling
Interchange.
* Improve diagnostics on failed code definition compiles -- they
weren't showing up before unless you had $^W on.
Revision Changes Path
2.34 +15 -6 interchange/lib/Vend/Config.pm
rev 2.34, prev_rev 2.33
Index: Config.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Config.pm,v
retrieving revision 2.33
retrieving revision 2.34
diff -u -r2.33 -r2.34
--- Config.pm 3 Feb 2002 06:41:08 -0000 2.33
+++ Config.pm 3 Feb 2002 23:11:57 -0000 2.34
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
-# $Id: Config.pm,v 2.33 2002/02/03 06:41:08 mheins Exp $
+# $Id: Config.pm,v 2.34 2002/02/03 23:11:57 mheins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -44,7 +44,7 @@
use Vend::Parse;
use Vend::Util;
-$VERSION = substr(q$Revision: 2.33 $, 10);
+$VERSION = substr(q$Revision: 2.34 $, 10);
my %CDname;
@@ -959,6 +959,7 @@
sub get_system_code {
return if $CodeDest;
+ return if $Vend::ControllingInterchange;
# defined means don't go here anymore
$SystemCodeDone = '';
@@ -1531,6 +1532,7 @@
my($var, $val, $warn, $cap) = @_;
return if $Vend::ExternalProgram;
+ return if $Vend::ControllingInterchange;
my $carptype;
my $error_message;
@@ -3274,6 +3276,7 @@
return $c;
}
}
+ local($^W) = 1;
my $fail;
{
local $SIG{'__WARN__'} = sub {$fail .= "@_";};
@@ -3283,7 +3286,7 @@
die $@ if $@;
};
}
- if($@ or $fail) {
+ if($@) {
config_warn(
"UserTag '%s' subroutine failed compilation:\n\n\t%s",
$tag,
@@ -3291,12 +3294,18 @@
);
return $c;
}
- else {
+ elsif($fail) {
config_warn(
- "UserTag '%s' code is not a subroutine reference",
+ "Warning while compiling UserTag '%s':\n\n\t%s",
$tag,
- ) unless ref($sub) =~ /CODE/;
+ $fail,
+ );
+ return $c;
}
+ config_warn(
+ "UserTag '%s' code is not a subroutine reference",
+ $tag,
+ ) unless ref($sub) eq 'CODE';
$c->{$p}{$tag} = $sub;
$c->{Order}{$tag} = []
2.1 +2 -1 interchange/lib/Vend/Control.pm
rev 2.1, prev_rev 2.0
Index: Control.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Control.pm,v
retrieving revision 2.0
retrieving revision 2.1
diff -u -r2.0 -r2.1
--- Control.pm 18 Jul 2001 02:23:13 -0000 2.0
+++ Control.pm 3 Feb 2002 23:11:57 -0000 2.1
@@ -1,6 +1,6 @@
# Vend::Control - Routines that alter the running Interchange daemon
#
-# $Id: Control.pm,v 2.0 2001/07/18 02:23:13 jon Exp $
+# $Id: Control.pm,v 2.1 2002/02/03 23:11:57 mheins Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -66,6 +66,7 @@
sub control_interchange {
my ($mode, $sig, $restart) = @_;
+ $Vend::ControllingInterchange = 1;
unless(-f $Global::PIDfile) {
warn errmsg(
"The Interchange server was not running (%s).\n",