From 809596d594dc76c62a13f7930fc86dc93627806c Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 21 Feb 2015 21:06:28 +0000 Subject: [PATCH] 98_update.pm: call commandref_join.pl if exists (Forum #33916) git-svn-id: https://svn.fhem.de/fhem/trunk@8060 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_update.pm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index c64ca3fa0..f3200a21c 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -149,6 +149,14 @@ doUpdate($$) $lh{$l[3]}{LEN} = $l[2]; } + my ($canJoin, $needJoin); + my $cj = "$root/contrib/commandref_join.pl"; + if(-f $cj && + -f "$root/docs/commandref_frame.html" && + -w "$root/docs/commandref.html") { + $canJoin = 1; + } + my @excl = split(" ", AttrVal("global", "exclude_from_update", "")); my @rl = upd_getChanges($root, $basePath); @@ -197,8 +205,12 @@ doUpdate($$) uLog 1, "List of new / modified files since last update:" if($arg eq "check" && $nChanged == 0); - uLog 1, "$r[0] $fName"; $nChanged++; + if($fName =~ m,docs/commandref(_..)?.html, && $canJoin) { + $needJoin = 1; + next; + } + uLog 1, "$r[0] $fName"; next if($arg eq "check"); my $remFile = upd_getUrl("$basePath/$fName"); @@ -237,6 +249,13 @@ doUpdate($$) "FHEM/$ctrlFileName", $remCtrlFile)); } + if($canJoin && $needJoin) { + chdir($root); + uLog(1, "Calling $^X $cj, this may take a while"); + my $ret = `$^X $cj`; + uLog(1, $ret) if($ret); + } + uLog(1, ""); uLog 1, 'update finished, "shutdown restart" is needed to activate the changes.';