Scripts: cleanup

This commit is contained in:
Shahram Najm 2021-12-12 14:06:36 +00:00
parent 201443c6ac
commit 32c66d0832
1 changed files with 44 additions and 46 deletions

View File

@ -9,9 +9,10 @@ use DBI;
my $basedir = dirname($0);
my $db="param";
my $host="grib-param-db-test.ecmwf.int";
my $user="ecmwf_ro";
my $pass="ecmwf_ro";
my $host = $ENV{'PARAM_DB_HOST'} || 'unknown';
my $user = $ENV{'PARAM_DB_USER'} || 'unknown';
my $pass = $ENV{'PARAM_DB_PASS'} || 'unknown';
my $filename; my $filebase; my $out; my $conceptDir;
my $query; my $q; my $qh;
@ -56,7 +57,7 @@ EOF
mkpath($filebase);
print TAR "grib$edition$conceptDir/$key.def\n";
system("cp -f $filebase/$key.def $filebase/$key.def.orig");
#system("cp -f $filebase/$key.def $filebase/$key.def.orig");
open($out,"> $filebase/$key.def")
or die "unable to open $filebase/$key.def";
print $out "# Automatically generated by $0, do not edit\n";
@ -135,8 +136,7 @@ EOF
# or die ("unable to copy $filebase/$key.def");
print TAR "grib$edition$conceptDir/$key.def\n";
system("cp -f $filebase/$key.def $filebase/$key.def.orig");
#system("p4 edit $filebase/$key.def");
#system("cp -f $filebase/$key.def $filebase/$key.def.orig");
open($out,"> $filebase/$key.def")
or die "unable to open $filebase/$key.def";
print $out "# Automatically generated by $0, do not edit\n";
@ -195,7 +195,6 @@ sub create_paramId_def {
copy("$filebase/paramId.def","$filebase/paramId.def.bkp")
or die ("unable to copy $filebase/paramId.def");
system("p4 edit $filebase/paramId.def");
open($out,"> $filebase/paramId.def")
or die "unable to open $filebase/paramId.def";
print $out "# Automatically generated by $0, do not edit\n";
@ -238,7 +237,6 @@ sub create_def_old {
copy("$filebase/$key.def","$filebase/$key.def.bkp")
or die ("unable to copy $filebase/$key.def");
system("p4 edit $filebase/$key.def");
open($out,"> $filebase/$key.def")
or die "unable to open $filebase/$key.def";
print $out "# Automatically generated by $0, do not edit\n";