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

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Tue Mar 5 08:43:01 2002


User:      kwalsh
Date:      2002-03-05 13:42:43 GMT
Modified:  lib/Vend Config.pm
Log:
	* Added some UserTag duplication checks:

		-- A duplicated local or global usertag raises a fatal error.

		-- A local usertag that overrides a global usertag of the same
		   name raises a non-fatal warning.

Revision  Changes    Path
2.40      +18 -2     interchange/lib/Vend/Config.pm


rev 2.40, prev_rev 2.39
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -r2.39 -r2.40
--- Config.pm	18 Feb 2002 02:07:03 -0000	2.39
+++ Config.pm	5 Mar 2002 13:42:43 -0000	2.40
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.39 2002/02/18 02:07:03 mheins Exp $
+# $Id: Config.pm,v 2.40 2002/03/05 13:42:43 kwalsh 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.39 $, 10);
+$VERSION = substr(q$Revision: 2.40 $, 10);
 
 my %CDname;
 
@@ -3263,6 +3263,22 @@
 	}
 
 	if($p eq 'Routine' or $p eq 'PosRoutine') {
+		if (defined $c->{Source}->{$tag}->{$p}){
+			config_error(
+				errmsg(
+					"Duplicate usertag %s found",
+					$tag,
+				)
+			);
+		}
+		if (defined $C && defined $Global::UserTag->{Source}->{$tag}->{$p}){
+			config_warn(
+				errmsg(
+					"Local usertag %s overrides global definition",
+					$tag,
+				)
+			);
+		}
 
 		my $sub;
 		$c->{Source}->{$tag}->{$p} = $val;