From f2f6eefe9ca1ce3bfd86d865929f9750a4c29ecb Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 16 May 2018 18:23:58 +0200 Subject: [PATCH] bugfix wezzy Distrie --- 42_AptToDate.pm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/42_AptToDate.pm b/42_AptToDate.pm index 834b0ed..a14eff4 100644 --- a/42_AptToDate.pm +++ b/42_AptToDate.pm @@ -49,7 +49,7 @@ eval "use JSON;1" or $missingModul .= "JSON "; -my $version = "0.0.62"; +my $version = "0.0.64"; @@ -457,6 +457,7 @@ sub AptToDate_GetDistribution() { if(open(DISTRI, ") { + chomp($line); Log3 'AptToDate', 4, "Sub AptToDate_GetDistribution - $line"; if($line =~ m#^(.*)="?(.*)"$#i or $line =~ m#^(.*)=([a-z]+)$#i) { @@ -465,15 +466,15 @@ sub AptToDate_GetDistribution() { } } - close(APT); + close(DISTRI); } else { - die Log3 'Update', 2, "Couldn't use APT: $!"; - #die "Couldn't use APT: $!\n"; - $update->{error} = 'Couldn\'t use APT: '.$; + die Log3 'Update', 2, "Couldn't use DISTRI: $!"; + #die "Couldn't use DISTRI: $!\n"; + $update->{error} = 'Couldn\'t use DISTRI: '.$; } - if(open(APT, "echo n | locale 2>&1 |")) { - while(my $line = ) { + if(open(LOCALE, "locale 2>&1 |")) { + while(my $line = ) { chomp($line); Log3 'AptToDate', 4, "Sub AptToDate_GetDistribution - $line"; @@ -482,12 +483,12 @@ sub AptToDate_GetDistribution() { Log3 'Update', 4, "Language Daten erhalten" } } - - close(APT); + + close(LOCALE); } else { - die Log3 'Update', 2, "Couldn't use APT: $!"; + die Log3 'Update', 2, "Couldn't use LOCALE: $!"; #die "Couldn't use APT: $!\n"; - $update->{error} = 'Couldn\'t use APT: '.$; + $update->{error} = 'Couldn\'t use LOCALE: '.$; } return $update;