fixed an error with an "unset attr{global}{version}" after first update in a fresh 5.2 installation

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@1761 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs
2012-07-26 14:53:07 +00:00
parent 2e57cfd00e
commit c7be922c32

View File

@@ -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;