From 226e59952e2accc0e69e540d8ec75993a3ef1d4b Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sat, 19 Mar 2016 17:27:36 +0000 Subject: [PATCH] configDB.pm: add modpath changes (Forum #51036) git-svn-id: https://svn.fhem.de/fhem/trunk@11085 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/configDB.pm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fhem/configDB.pm b/fhem/configDB.pm index d876865e6..342839fbc 100644 --- a/fhem/configDB.pm +++ b/fhem/configDB.pm @@ -495,6 +495,7 @@ sub cfgDB_SaveState() { sub cfgDB_MigrationImport() { my ($ret, $filename, @files, @def); + my $modpath = AttrVal("global","modpath","."); # find eventTypes file $filename = ''; @@ -506,16 +507,13 @@ sub cfgDB_MigrationImport() { } # import templateDB.gplot - $filename = $attr{global}{modpath}; - $filename .= "/www/gplot/template.gplot"; + $filename = "$modpath/www/gplot/template.gplot"; push @files, $filename; - $filename = $attr{global}{modpath}; - $filename .= "/www/gplot/templateDB.gplot"; + $filename = "$modpath/www/gplot/templateDB.gplot"; push @files, $filename; # import template.layout - $filename = $attr{global}{modpath}; - $filename .= "/FHEM/template.layout"; + $filename = "$modpath/FHEM/template.layout"; push @files, $filename; # find used gplot files @@ -524,7 +522,7 @@ sub cfgDB_MigrationImport() { @def = _cfgDB_findDef('TYPE=SVG','GPLOTFILE'); foreach $filename (@def) { next unless $filename; - push @files, "./www/gplot/".$filename.".gplot"; + push @files, "$modpath/www/gplot/".$filename.".gplot"; } # find DbLog configs @@ -560,9 +558,14 @@ sub cfgDB_MigrationImport() { @def = _cfgDB_findDef('TYPE=holiday','NAME'); foreach $filename (@def) { next unless $filename; - push @files, "./FHEM/".$filename.".holiday"; + push @files, "$modpath/FHEM/".$filename.".holiday"; } +# import uniqueID file + $filename = "$modpath/FHEM/FhemUtils/uniqueID"; + push @files,$filename if (-e $filename); + + # do the import $filename = ''; foreach $filename (@files) {