Changeset 341 for obsdata/trunk


Ignore:
Timestamp:
03/26/14 05:07:44 (10 years ago)
Author:
nanardon
Message:

plusieurs correctif et améliorations

Location:
obsdata/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • obsdata/trunk/ObsData.pm

    r338 r341  
    1414my @loglevel = ( 'DEBUG', 'INFO', 'RESULT', 'WARNING', 'ERROR', 'FATAL', ); 
    1515 
    16 our $VERSION = "0.3.4"; 
     16our $VERSION = "0.3.3"; 
    1717our $CVSID   = q$Id$; 
    1818our $CVSREV  = ( q$Revision$ =~ /^Revision: (.*) $/ )[0]; 
  • obsdata/trunk/ObsData/Repository/Status.pm

    r336 r341  
    44use warnings; 
    55 
    6 use YAML; 
     6use YAML::Syck; 
    77use Config::IniFiles; 
    88 
     
    1616 
    1717    if ($self->{file} && -r $self->{file}) { 
    18         $self->{data} = YAML::LoadFile($self->{file}); 
     18        $self->{data} = YAML::Syck::LoadFile($self->{file}); 
    1919    } 
    2020 
     
    2727    my ($self, $output) = @_; 
    2828 
    29     YAML::DumpFile($output, $self->{data}); 
     29    if (open(my $handle, '>', $output . '.new')) { 
     30        print $handle YAML::Syck::Dump($self->{data}) or return; 
     31        close($handle); 
     32        unlink($output) or die "Can't unlink old file"; 
     33        rename($output . '.new', $output); 
     34    } else { 
     35        die "Can't open $output for wirting\n"; 
     36    } 
    3037} 
    3138 
Note: See TracChangeset for help on using the changeset viewer.