From 7d9abe56e20c50babc47599b05b1f9f66d82a04e Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 11 Feb 2018 15:07:41 +0000 Subject: [PATCH] zwavealliance.images.parse: Delete unused images git-svn-id: https://svn.fhem.de/fhem/trunk@16152 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/zwavealliance.images.parse | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fhem/contrib/zwavealliance.images.parse b/fhem/contrib/zwavealliance.images.parse index b2052a28a..e6a773cf8 100644 --- a/fhem/contrib/zwavealliance.images.parse +++ b/fhem/contrib/zwavealliance.images.parse @@ -5,7 +5,7 @@ # Usage: zwavealliance.images.parse downloaddir # Downloaddir is filled with the following script: # i=1 -# while test $i -lt 2680 +# while test $i -lt 3000 # do # echo $i # wget -O $i -q http://products.z-wavealliance.org/products/$i/XML @@ -30,7 +30,7 @@ for my $fn (sort { $a <=> $b } @files) { while(my $l = ) { chomp($l); - $em = empty if($l =~ m,

Oh no ... we encountered an error!

,); + $em = 'empty' if($l =~ m,

Oh no ... we encountered an error!

,); $bn = $1 if($l =~ m,(.*),); $mi = $1 if($l =~ m,0x(....),); $pti = $1 if($l =~ m,0x(....),); @@ -39,16 +39,16 @@ for my $fn (sort { $a <=> $b } @files) { } close(FH); - if($mi eq '' && $pti eq '' && $pi eq '' && -s $path eq 4880) { - printf "DELETE empty $path\n"; - next; - } if($em eq 'empty') { - printf "Empty for $fn\n"; + printf "No data for $fn, deleting the file\n"; + # in the hope that somebody will fix the file + unlink("$ARGV[0]/$fn"); next; } if($mi eq '' || $pti eq '' || $pi eq '') { - printf "Missing parameters for $fn: $bn/$mi/$pti/$pi\n"; + printf "Missing parameters for $fn: Brand:$bn, ManufId:$mi, ProductType:$pti, ProductId:$pi, deleting the file\n"; + # in the hope that somebody will fix the file + unlink("$ARGV[0]/$fn"); next; } printf OF "%s-%s-%s,%s,%s,%s\n", $mi,$pti,$pi,$fn,$pic,$bn;