From 739889d1ff3730b4d23ed7e5eb16c398d4140b4b Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sat, 26 May 2018 18:19:18 +0000 Subject: [PATCH] commandref_static: for debug only (add rebuild option) git-svn-id: https://svn.fhem.de/fhem/trunk@16781 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/commandref_static.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/commandref_static.pl b/fhem/contrib/commandref_static.pl index f6ccef9ce..928fb79e9 100755 --- a/fhem/contrib/commandref_static.pl +++ b/fhem/contrib/commandref_static.pl @@ -9,6 +9,8 @@ sub _cref_search; sub _cref_read; sub _cref_write; +my $rebuild = (defined($ARGV[0]) && lc($ARGV[0]) eq "rebuild") ? 1 : 0; + my $protVersion=1; my @lang = ("EN", "DE"); my $modDir = "FHEM"; @@ -20,6 +22,7 @@ for my $lang (@lang) { my $cmdref = "docs/commandref_frame$sfx.html"; my $outpath = "docs/cref$sfx"; + unlink glob "$outpath/*" if $rebuild; mkdir $outpath unless (-e $outpath); open(FH, $cmdref) || die("Cant open $cmdref: $!\n"); @@ -72,7 +75,7 @@ for my $lang (@lang) { next if($fName !~ m/^\d\d_(.*)\.pm$/); my $mName = $1; my $ts = (stat("$modDir/$fName"))[9]; - if($protVersion != $fileVersion || + if($protVersion != $fileVersion || $rebuild || !$modData{$mName} || !$modData{$mName}{ts} || $modData{$mName}{ts}<$ts) { #print "Checking $fName for $lang short description\n";