From a033e6668a1eefd4fdb1a4b13a1abd5fe5dfc82d Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 18 Aug 2013 15:23:42 +0000 Subject: [PATCH] fhem.pl: print os and user upon startup, move release.pm from fhem.pl to update git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3741 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_update.pm | 6 ++---- fhem/fhem.pl | 20 +++----------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/fhem/FHEM/98_update.pm b/fhem/FHEM/98_update.pm index dda3aefcf..1b701b7a8 100644 --- a/fhem/FHEM/98_update.pm +++ b/fhem/FHEM/98_update.pm @@ -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] [|check|fhem],update Fhem", ); $cmds{update} = \%hash; + } ######################################## diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 6274dc46d..164c56586 100755 --- a/fhem/fhem.pl +++ b/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)) {