From 6ddf1e6ff9e80bf6f5ed064fc149771365c9036d Mon Sep 17 00:00:00 2001 From: mfr69bs Date: Sat, 24 Nov 2012 12:46:23 +0000 Subject: [PATCH] saving the statefile before an update git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2180 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 3 +++ FHEM/98_update.pm | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGED b/CHANGED index 0d68a0af0..f4526fff3 100644 --- a/CHANGED +++ b/CHANGED @@ -19,6 +19,9 @@ - change: FHEMWEB added "Associated with" to detail-screen (Uli) - change: FHEMWEB added ETag headers (Matthias) - change: FHEMWEB devStateIcon added + - change: 98_update.pm due a (probable) bug in perl, modules are no longer + loading automatically. A restart is required now! (M. Fischer) + - feature: 98_update.pm saves the statefile before an update (M. Fischer) - 2012-10-28 (5.3) - feature: added functions trim, ltrim, rtrim, UntoggleDirect, diff --git a/FHEM/98_update.pm b/FHEM/98_update.pm index ca3f5ba68..27863fb3c 100644 --- a/FHEM/98_update.pm +++ b/FHEM/98_update.pm @@ -168,6 +168,17 @@ update_DoUpdate(@) $ret = $checkUpdates; } + # save statefile + $ret .= "\nSaving statefile: "; + my $cmdret = WriteStatefile(); + if (!$cmdret) { + Log 1, "update saving statefile"; + $ret .= "done\n\n"; + } else { + Log 1, "update statefile: $cmdret"; + $ret .= "Something went wrong with statefile:\n$cmdret\n\n"; + } + # do a backup first my $doBackup = (!defined($attr{global}{backup_before_update}) ? 1 : $attr{global}{backup_before_update});