2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

configDB.pm: add modpath changes (Forum #51036)

git-svn-id: https://svn.fhem.de/fhem/trunk@11085 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2016-03-19 17:27:36 +00:00
parent 290d6c2dbd
commit 226e59952e

View File

@ -495,6 +495,7 @@ sub cfgDB_SaveState() {
sub cfgDB_MigrationImport() { sub cfgDB_MigrationImport() {
my ($ret, $filename, @files, @def); my ($ret, $filename, @files, @def);
my $modpath = AttrVal("global","modpath",".");
# find eventTypes file # find eventTypes file
$filename = ''; $filename = '';
@ -506,16 +507,13 @@ sub cfgDB_MigrationImport() {
} }
# import templateDB.gplot # import templateDB.gplot
$filename = $attr{global}{modpath}; $filename = "$modpath/www/gplot/template.gplot";
$filename .= "/www/gplot/template.gplot";
push @files, $filename; push @files, $filename;
$filename = $attr{global}{modpath}; $filename = "$modpath/www/gplot/templateDB.gplot";
$filename .= "/www/gplot/templateDB.gplot";
push @files, $filename; push @files, $filename;
# import template.layout # import template.layout
$filename = $attr{global}{modpath}; $filename = "$modpath/FHEM/template.layout";
$filename .= "/FHEM/template.layout";
push @files, $filename; push @files, $filename;
# find used gplot files # find used gplot files
@ -524,7 +522,7 @@ sub cfgDB_MigrationImport() {
@def = _cfgDB_findDef('TYPE=SVG','GPLOTFILE'); @def = _cfgDB_findDef('TYPE=SVG','GPLOTFILE');
foreach $filename (@def) { foreach $filename (@def) {
next unless $filename; next unless $filename;
push @files, "./www/gplot/".$filename.".gplot"; push @files, "$modpath/www/gplot/".$filename.".gplot";
} }
# find DbLog configs # find DbLog configs
@ -560,9 +558,14 @@ sub cfgDB_MigrationImport() {
@def = _cfgDB_findDef('TYPE=holiday','NAME'); @def = _cfgDB_findDef('TYPE=holiday','NAME');
foreach $filename (@def) { foreach $filename (@def) {
next unless $filename; 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 # do the import
$filename = ''; $filename = '';
foreach $filename (@files) { foreach $filename (@files) {