2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

configDB.pm: minor code cleanup

git-svn-id: https://svn.fhem.de/fhem/trunk@15792 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2018-01-05 16:55:57 +00:00
parent 927d25f989
commit 39ef1ab462

View File

@ -126,8 +126,6 @@
#
# 2017-08-31 - changed improve table_info for migration check
#
# 2018-01-05 - added show commandfile's svnid to info output
#
##############################################################################
=cut
@ -899,7 +897,7 @@ sub _cfgDB_Migrate() {
$ret .= cfgDB_MigrationImport;
$ret .= "Migration completed\n\n";
Log3('configDB',4,'Migration completed.');
$ret .= _cfgDB_Info('');
$ret .= _cfgDB_Info(undef);
return $ret;
}
@ -907,6 +905,7 @@ sub _cfgDB_Migrate() {
sub _cfgDB_Info($) {
my ($info2) = @_;
$info2 //= 'unknown';
Debug ">$info2<";
my ($l, @r, $f);
for my $i (1..65){ $l .= '-';}
@ -915,8 +914,8 @@ sub _cfgDB_Info($) {
push @r, $l;
my $info1 = cfgDB_svnId;
$info1 =~ s/# //;
push @r, " d:".$info1;
push @r, " c:".$info2;
push @r, " d:$info1";
push @r, " c:$info2";
push @r, $l;
push @r, " dbconn: $cfgDB_dbconn";
push @r, " dbuser: $cfgDB_dbuser" if !$configDB{attr}{private};
@ -1040,7 +1039,7 @@ sub _cfgDB_Reorg(;$$) {
$fhem_dbh->disconnect();
eval qx(sqlite3 $cfgDB_filename vacuum) if($cfgDB_dbtype eq "SQLITE");
return if(defined($quiet));
return " Result after database reorg:\n"._cfgDB_Info('');
return " Result after database reorg:\n"._cfgDB_Info(undef);
}
# delete temporary version
@ -1162,6 +1161,11 @@ sub _cfgDB_Filedelete($) {
$fhem_dbh->commit();
$fhem_dbh->disconnect();
$ret = ($ret > 0) ? 1 : undef;
# if($ret > 0) {
# $ret = "File $filename deleted from database.";
# } else {
# $ret = "File $filename not found in database.";
# }
return $ret;
}