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

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Nov 14 20:08:03 EST 2005


User:      jon
Date:      2005-11-15 01:08:03 GMT
Modified:  lib/Vend Config.pm
Log:
Treat #include appropriately when writing file for DumpAllCfg.

Don't create a missing RunDir after each catalog include file is hit;
instead wait until entire catalog config is done (since RunDir may change).

Revision  Changes    Path
2.189     +11 -11    interchange/lib/Vend/Config.pm


rev 2.189, prev_rev 2.188
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.188
retrieving revision 2.189
diff -u -u -r2.188 -r2.189
--- Config.pm	7 Nov 2005 21:53:55 -0000	2.188
+++ Config.pm	15 Nov 2005 01:08:03 -0000	2.189
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.188 2005/11/07 21:53:55 jon Exp $
+# $Id: Config.pm,v 2.189 2005/11/15 01:08:03 jon Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -52,7 +52,7 @@
 use Vend::Data;
 use Vend::Cron;
 
-$VERSION = substr(q$Revision: 2.188 $, 10);
+$VERSION = substr(q$Revision: 2.189 $, 10);
 
 my %CDname;
 my %CPname;
@@ -1169,13 +1169,13 @@
 #print "seeking to $tellmark in $configfile, include is @include\n";
 	my ($ifdef, $begin_ifdef);
 	while(<CONFIG>) {
+		# Look for meta commands (ifdef, endif, include) after '#'?
+		my $leadinghash = $C->{ConfigParseComments} ? '#?' : '';
 		if($allcfg) {
 			print ALLCFG $_
-				unless /^#?include\s+/i;
+				unless /^${leadinghash}include\s+/i;
 		}
 		chomp;			# zap trailing newline,
-		# Look for meta commands (ifdef, endif, include) after '#'?
-		my $leadinghash = $C->{ConfigParseComments} ? '#?' : '';
 		if(/^\s*${leadinghash}endif\s*$/i) {
 #print "found $_\n";
 			undef $ifdef;
@@ -1296,17 +1296,17 @@
 		}
 	}
 
-	# We need to make this directory if it isn't already there....
-	if(! $existing and $C->{ScratchDir} and ! -e $C->{ScratchDir}) {
-		mkdir $C->{ScratchDir}, 0700
-			or die "Can't make temporary directory $C->{ScratchDir}: $!\n";
-	}
-
 	if(defined $ifdef) {
 		config_error("Failed to close #ifdef on line %s.", $begin_ifdef);
 	}
 
 } # end CONFIGLOOP
+
+	# We need to make this directory if it isn't already there....
+	if(! $existing and $C->{ScratchDir} and ! -e $C->{ScratchDir}) {
+		mkdir $C->{ScratchDir}, 0700
+			or die "Can't make temporary directory $C->{ScratchDir}: $!\n";
+	}
 
 	return $C if $existing;
 








More information about the interchange-cvs mailing list