[gavia-ms-commit] r1275 - in trunk/MetaScheduling/Adapter/gpt-packages: gavia_mds_classad_extractor globus_gram_job_manager_setup_gavia globus_scheduler_event_generator_gavia_setup
commit at globus.org
commit at globus.org
Tue Jul 7 10:16:48 CDT 2009
Author: andre
Date: 2009-07-07 10:16:47 -0500 (Tue, 07 Jul 2009)
New Revision: 1275
Modified:
trunk/MetaScheduling/Adapter/gpt-packages/gavia_mds_classad_extractor/setup-gavia-mds-classad-extractor.pl
trunk/MetaScheduling/Adapter/gpt-packages/globus_gram_job_manager_setup_gavia/setup-globus-job-manager-gavia.pl
trunk/MetaScheduling/Adapter/gpt-packages/globus_scheduler_event_generator_gavia_setup/setup-seg-gavia.pl
Log:
Bugfix 6792; Existing configuration files will not be overwritten anymore.
Modified: trunk/MetaScheduling/Adapter/gpt-packages/gavia_mds_classad_extractor/setup-gavia-mds-classad-extractor.pl
===================================================================
--- trunk/MetaScheduling/Adapter/gpt-packages/gavia_mds_classad_extractor/setup-gavia-mds-classad-extractor.pl 2009-07-06 16:17:31 UTC (rev 1274)
+++ trunk/MetaScheduling/Adapter/gpt-packages/gavia_mds_classad_extractor/setup-gavia-mds-classad-extractor.pl 2009-07-07 15:16:47 UTC (rev 1275)
@@ -37,17 +37,33 @@
}
# Install the xslt file in $GLOBUS_LOCATION/etc/gavia_mds_classad_extractor
-print "Installing gavia-mds-classad-extractor.xslt\n";
-copy("./gavia-mds-classad-extractor.xslt", "$globusdir/etc/gavia_mds_classad_extractor") or die "File cannot be copied.";
+install_file("./gavia-mds-classad-extractor.xslt", "$globusdir/etc/gavia_mds_classad_extractor/gavia-mds-classad-extractor.xslt");
# Install application configuration file in $GLOBUS_LOCATION/etc/gavia_mds_classad_extractor
-print "Installing gavia-mds-classad-extractor-config.xml\n";
-copy("./gavia-mds-classad-extractor-config.xml", "$globusdir/etc/gavia_mds_classad_extractor") or die "File cannot be copied.";
+install_file("./gavia-mds-classad-extractor-config.xml", "$globusdir/etc/gavia_mds_classad_extractor/gavia-mds-classad-extractor-config.xml");
# Install the trigger registration file in $GLOBUS_LOCATION/etc/globus_wsrf_mds_trigger
-print "Installing trigger registration file\n";
-copy("./gavia-mds-classad-extractor-trigger-registration.xml", "$globusdir/etc/globus_wsrf_mds_trigger") or die "File cannot be copied.";
+install_file("./gavia-mds-classad-extractor-trigger-registration.xml", "$globusdir/etc/globus_wsrf_mds_trigger/gavia-mds-classad-extractor-trigger-registration.xml");
$metadata->finish();
+
+sub install_file
+{
+ # This function is used to simply check if a file already exist
+ # before installing it. If the file already exist, then a
+ # message will be printed and the file with not be overwritten.
+
+ my($source_file, $target_file) = @_;
+ if(-e "$target_file")
+ {
+ print "$target_file already exist; keeping existing version\n";
+ }
+ else
+ {
+ print "Installing $target_file\n";
+ copy("$source_file", "$target_file") or die "File cannot be copied.";
+ }
+}
+
Modified: trunk/MetaScheduling/Adapter/gpt-packages/globus_gram_job_manager_setup_gavia/setup-globus-job-manager-gavia.pl
===================================================================
--- trunk/MetaScheduling/Adapter/gpt-packages/globus_gram_job_manager_setup_gavia/setup-globus-job-manager-gavia.pl 2009-07-06 16:17:31 UTC (rev 1274)
+++ trunk/MetaScheduling/Adapter/gpt-packages/globus_gram_job_manager_setup_gavia/setup-globus-job-manager-gavia.pl 2009-07-07 15:16:47 UTC (rev 1275)
@@ -49,8 +49,7 @@
chomp($gavia_jm_config);
# Install the job manager config file in $GLOBUS_LOCATION/etc
-print "Installing ./gavia_job_manager_adapter.xml";
-copy("./gavia_job_manager_adapter.xml", "$globusdir/etc/gavia_job_manager_adapter.xml") or die "File cannot be copied.";
+install_file("./gavia_job_manager_adapter.xml", "$globusdir/etc/gavia_job_manager_adapter.xml");
# Create service
$cmd = "$libexecdir/globus-job-manager-service -add -m gavia -s \"$name\"";
@@ -83,3 +82,21 @@
" [-help]\n";
exit 1;
}
+
+sub install_file
+{
+ # This function is used to simply check if a file already exist
+ # before installing it. If the file already exist, then a
+ # message will be printed and the file with not be overwritten.
+
+ my($source_file, $target_file) = @_;
+ if(-e "$target_file")
+ {
+ print "$target_file already exist; keeping existing version\n";
+ }
+ else
+ {
+ print "Installing $target_file\n";
+ copy("$source_file", "$target_file") or die "File cannot be copied.";
+ }
+}
Modified: trunk/MetaScheduling/Adapter/gpt-packages/globus_scheduler_event_generator_gavia_setup/setup-seg-gavia.pl
===================================================================
--- trunk/MetaScheduling/Adapter/gpt-packages/globus_scheduler_event_generator_gavia_setup/setup-seg-gavia.pl 2009-07-06 16:17:31 UTC (rev 1274)
+++ trunk/MetaScheduling/Adapter/gpt-packages/globus_scheduler_event_generator_gavia_setup/setup-seg-gavia.pl 2009-07-07 15:16:47 UTC (rev 1275)
@@ -46,11 +46,19 @@
my $globusdir = $ENV{GLOBUS_LOCATION};
my $libexecdir = "$globusdir/libexec";
-local(*FP);
-open(FP, ">$globusdir/etc/globus-gavia.conf");
-print FP "log_path=$path\n";
-close(FP);
+if(-e "$globusdir/etc/globus-gavia.conf")
+{
+ print "$globusdir/etc/globus-gavia.conf already exist; keeping existing version\n";
+}
+else
+{
+ print "Creating $globusdir/etc/globus-gavia.conf\n";
+ local(*FP);
+ open(FP, ">$globusdir/etc/globus-gavia.conf");
+ print FP "log_path=$path\n";
+ close(FP);
+}
$metadata->finish();
More information about the gavia-ms-commit
mailing list