From 35c1df7baa58597be099a19c4c2e30b96f41f73a Mon Sep 17 00:00:00 2001 From: betateilchen Date: Sat, 4 Jun 2016 12:25:06 +0000 Subject: [PATCH] 55_GDS.pm: minor bugfix, use os-based unzip git-svn-id: https://svn.fhem.de/fhem/trunk@11609 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/GDS/55_GDS.pm | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/fhem/contrib/GDS/55_GDS.pm b/fhem/contrib/GDS/55_GDS.pm index 98102016e..2675706c4 100644 --- a/fhem/contrib/GDS/55_GDS.pm +++ b/fhem/contrib/GDS/55_GDS.pm @@ -38,7 +38,7 @@ use warnings; use feature qw/switch/; use Blocking; -use Archive::Extract; +#use Archive::Extract; use Net::FTP; use XML::Simple; @@ -1016,7 +1016,7 @@ sub decodeCAPData($$$){ while(($k, $v) = each %readings){ # skip update if no valid data is available next unless(defined($v)); - readingsBulkUpdate($hash, $k, latin1ToUtf8($v)); + readingsSingleUpdate($hash, $k, latin1ToUtf8($v),1); } # convert color value to hex @@ -1212,23 +1212,7 @@ sub _retrieveCAPDATA { } # unzip - my $zip; - eval { - $Archive::Extract::PREFER_BIN = 1; - $Archive::Extract::WARN = 0; - $zip = Archive::Extract->new( archive => $targetFile, type => 'zip' ); - my $ok = $zip->extract( to => $targetDir ); - Log3($name, 5, "GDS $name: error ".$zip->error()) unless $ok; - }; - -# my $zip; -# eval { -# $zip = Archive::Zip->new($targetFile); -# foreach my $member ($zip->members()) { -# my $fileName = $member->fileName(); -# $zip->extractMember($member,$targetDir."/".$fileName) == AZ_OK || Debug "unzip error: $member"; -# } -# }; + qx(unzip -o $targetFile -d $targetDir); # merge my ($countInfo,$cF) = _mergeCapFile($hash); @@ -1736,6 +1720,8 @@ sub getListForecastStations($) { # ################################################################################################### # +# 2016-06-05 changed use os based unzip for decoding capdata +# # 2016-03-29 changed remove all conditions code # # 2016-01-27 changed use setKeyValue/getKeyValue for username and password