From f2d18253d4c668a23969f98d2d4f0d842c1f34a3 Mon Sep 17 00:00:00 2001 From: mfr69bs <> Date: Thu, 26 Jul 2012 14:53:07 +0000 Subject: [PATCH] fixed an error with an "unset attr{global}{version}" after first update in a fresh 5.2 installation git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1761 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fhem.pl b/fhem.pl index e45d69602..275d87055 100755 --- a/fhem.pl +++ b/fhem.pl @@ -1625,7 +1625,17 @@ GlobalAttr($$) push @INC, $modpath if(!grep(/$modpath/, @INC)); eval { use vars qw($DISTRIB_DESCRIPTION); - require "FhemUtils/release.pm"; + # start of fix + # "Use of uninitialized value" after a fresh 5.2 installation and first time "updatefhem" + # release.pm does not reside in FhemUtils (what it should), so we load it from $modpath + if(-e "$modpath/FhemUtils/release.pm") { + require "FhemUtils/release.pm"; + } elsif(-e:"$modpath/release.pm") { + require "release.pm"; + } else { + $DISTRIB_DESCRIPTION = "unknown"; + } + # end of fix $attr{global}{version} = "$DISTRIB_DESCRIPTION, $cvsid"; }; my $counter = 0;