]> git.donarmstrong.com Git - biopieces.git/commitdiff
fix date and time in ucsc config
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 11 Nov 2008 06:37:05 +0000 (06:37 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 11 Nov 2008 06:37:05 +0000 (06:37 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@305 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/UCSC.pm

index d9a9341e7317ac1693c4d7181c4628372ec1ad76..adb8c9333e155030bba3740e2570b2287b1e1530 100644 (file)
@@ -923,7 +923,7 @@ sub ucsc_config_get_entry
             $record{ 'date' } = $1;
         } elsif ( $line =~ /^# time: (.+)/ ) {
             $record{ 'time' } = $1;
-        } elsif ( $line =~ /^# database: (.+)/ ) {
+        } elsif ( $line =~ /^# (?:database:|Database) (.+)/ ) {
             $record{ 'database' } = $1;
         } elsif ( $line =~ /^#/ ) {
             # skip
@@ -957,6 +957,11 @@ sub ucsc_config_put_entry
 
     $fh_out ||= \*STDOUT;
 
+    ( $date, $time ) = split " ", Maasha::Common::time_stamp();
+
+    $record->{ "date" } ||= $date;
+    $record->{ "time" } ||= $time;
+
     print $fh_out "\n# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n";
 
     map { print $fh_out "# $record->{ $_ }\n" if exists $record->{ $_ } } qw( date time database );