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

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Mar 2 10:55:43 EST 2006


User:      jon
Date:      2006-03-02 15:55:43 GMT
Modified:  lib/Vend Config.pm
Log:
Correct the default behavior of the new catalog RunDir directive. By the
time this code runs, it's already been expanded into an absolute path so
the checks for whether a user set it or not were not meaningful.

Revision  Changes    Path
2.200     +8 -9      interchange/lib/Vend/Config.pm


rev 2.200, prev_rev 2.199
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.199
retrieving revision 2.200
diff -u -u -r2.199 -r2.200
--- Config.pm	2 Mar 2006 12:27:31 -0000	2.199
+++ Config.pm	2 Mar 2006 15:55:42 -0000	2.200
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.199 2006/03/02 12:27:31 mheins Exp $
+# $Id: Config.pm,v 2.200 2006/03/02 15:55:42 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.199 $, 10);
+$VERSION = substr(q$Revision: 2.200 $, 10);
 
 my %CDname;
 my %CPname;
@@ -1392,7 +1392,7 @@
 
 sub config_named_catalog {
 	my ($cat_name, $source, $db_only, $dbconfig) = @_;
-	my ($g, $c, $dir);
+	my ($g, $c);
 
 	$g = $Global::Catalog{$cat_name};
 	unless (defined $g) {
@@ -1458,8 +1458,7 @@
 
 	if (defined $g->{base}) {
 		open_database(1);
-		$dir = $c->{RunDir} || '.';
-		dump_structure($c, "$dir/$g->{name}") if $Global::DumpStructure;
+		dump_structure($c, "$c->{RunDir}/$g->{name}") if $Global::DumpStructure;
 		return $c;
 	}
 
@@ -1482,15 +1481,15 @@
      	return undef;
     }
 
-	$dir = $c->{RunDir} || '.';
-	dump_structure($c, "$dir/$g->{name}") if $Global::DumpStructure;
+	dump_structure($c, "$c->{RunDir}/$g->{name}") if $Global::DumpStructure;
+
+    my $status_dir = ($C->{Source}{RunDir} ? $c->{RunDir} : $c->{ConfDir});
 
 	delete $c->{Source};
 
 	my $stime = scalar localtime();
 	writefile(">$Global::RunDir/status.$g->{name}", "$stime\n$g->{dir}\n");
-	$dir = $c->{RunDir} || $c->{ConfDir};
-	writefile(">$dir/status.$g->{name}", "$stime\n");
+	writefile(">$status_dir/status.$g->{name}", "$stime\n");
 
 	return $c;
 








More information about the interchange-cvs mailing list