map { push @new_tracks, $_ if not exists $track_hash{ $_->{ 'track' } } } @tracks;
- Maasha::Common::error( qq(track not found in config file: "$options->{ 'config_file' }") ) if scalar @tracks == scalar @new_tracks;
+ print STDERR qq(WARNING: track not found in config file: "$options->{ 'config_file' }"\n) if scalar @tracks == scalar @new_tracks;
+
+ rename "$options->{ 'config_file' }", "$options->{ 'config_file' }~";
+
+ $fh_out = Maasha::Common::write_open( $options->{ 'config_file' } );
+
+ map { Maasha::UCSC::ucsc_config_put_entry( $_, $fh_out ) } @new_tracks;
+
+ close $fh_out;
# ---- locate track in database ----
}
else
{
- Maasha::Common::error qq(table "$track" not found in database "$options->{ 'database' }");
+ print STDERR qq(WARNING: table "$track" not found in database "$options->{ 'database' }\n");
}
}
- rename "$options->{ 'config_file' }", "$options->{ 'config_file' }~";
-
- $fh_out = Maasha::Common::write_open( $options->{ 'config_file' } );
-
- map { Maasha::UCSC::ucsc_config_put_entry( $_, $fh_out ) } @new_tracks;
-
- close $fh_out;
-
Maasha::SQL::disconnect( $dbh );
}
while ( $line = <$fh> )
{
- if ( $line =~ /^# date: (.+)/ ) {
+ if ( $line =~ /Track added by 'upload_to_ucsc' (\S+) (\S+)/) {
+ $record{ 'date' } = $1;
+ $record{ 'time' } = $2;
+ } elsif ( $line =~ /^# date: (.+)/ ) {
$record{ 'date' } = $1;
} elsif ( $line =~ /^# time: (.+)/ ) {
$record{ 'time' } = $1;
print $fh_out "\n# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n";
- map { print $fh_out "# $record->{ $_ }\n" if exists $record->{ $_ } } qw( date time database );
+ map { print $fh_out "# $_: $record->{ $_ }\n" if exists $record->{ $_ } } qw( date time database );
map { print $fh_out "$_ $record->{ $_ }\n" if exists $record->{ $_ } } qw( track
name
description