mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
fhem.pl: print os and user upon startup, move release.pm from fhem.pl to update
git-svn-id: https://svn.fhem.de/fhem/trunk@3741 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e5dcad27dc
commit
ba7e9f8a9b
@ -28,6 +28,7 @@ use warnings;
|
||||
use HttpUtils;
|
||||
use File::Copy qw(cp mv);
|
||||
use Blocking;
|
||||
use FhemUtils::release;
|
||||
|
||||
sub CommandUpdate($$);
|
||||
sub update_CheckFhemRelease($$$);
|
||||
@ -47,10 +48,6 @@ sub update_WriteLocalControlFile($$$$$);
|
||||
sub
|
||||
update_Initialize($$)
|
||||
{
|
||||
if(!eval "require FhemUtils::release") {
|
||||
require release;
|
||||
}
|
||||
|
||||
foreach my $pack (split(" ",uc($UPDATE{packages}))) {
|
||||
$UPDATE{$pack}{control} = "controls_".lc($pack).".txt";
|
||||
}
|
||||
@ -60,6 +57,7 @@ update_Initialize($$)
|
||||
Hlp => "[development|stable] [<file>|check|fhem],update Fhem",
|
||||
);
|
||||
$cmds{update} = \%hash;
|
||||
|
||||
}
|
||||
|
||||
########################################
|
||||
|
20
fhem/fhem.pl
20
fhem/fhem.pl
@ -435,8 +435,9 @@ if($motd eq "$sc_text\n\n") {
|
||||
}
|
||||
}
|
||||
|
||||
my $osuser = "os $^O, user ".(getlogin || getpwuid($<) || "unknown");
|
||||
Log 0, "Server started with ".int(keys %defs).
|
||||
" defined entities (version $attr{global}{version}, pid $$)";
|
||||
" defined entities (version $attr{global}{version}, $osuser, pid $$)";
|
||||
|
||||
################################################
|
||||
# Main Loop
|
||||
@ -1879,22 +1880,7 @@ GlobalAttr($$)
|
||||
|
||||
opendir(DH, $modpath) || return "Can't read $modpath: $!";
|
||||
push @INC, $modpath if(!grep(/$modpath/, @INC));
|
||||
eval {
|
||||
use vars qw($DISTRIB_DESCRIPTION);
|
||||
# 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";
|
||||
};
|
||||
$attr{global}{version} = $cvsid;
|
||||
my $counter = 0;
|
||||
|
||||
foreach my $m (sort readdir(DH)) {
|
||||
|
Loading…
Reference in New Issue
Block a user