mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
* Software Update with apply the settings (Part6)
- Use identifier '#:' for config vars in settingsupdate.conf
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# settings for logfile
|
||||
Log=1
|
||||
LogFile=/tmp/update.log
|
||||
#:Log=1
|
||||
#:LogFile=/tmp/update.log
|
||||
|
||||
|
||||
## M<>gliche Eintr<74>ge:
|
||||
|
@@ -385,7 +385,7 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string &
|
||||
|
||||
bool CExtUpdate::findConfigEntry(std::string & line, std::string find)
|
||||
{
|
||||
if (line.find(find + "=") == 0) {
|
||||
if (line.find("#:" + find + "=") == 0) {
|
||||
size_t pos = line.find_first_of('=');
|
||||
line = line.substr(pos+1);
|
||||
line = trim(line);
|
||||
@@ -442,21 +442,20 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
||||
size_t pos;
|
||||
while(fgets(buf, sizeof(buf), f1) != NULL) {
|
||||
std::string line = buf;
|
||||
// remove comments
|
||||
line = trim(line);
|
||||
if (line.find_first_of("#") == 0)
|
||||
// remove comments
|
||||
if (line.find_first_of("#") == 0) {
|
||||
if (line.find_first_of(":") == 1) { // config vars
|
||||
if (line.length() > 1)
|
||||
readConfig(line);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
pos = line.find_first_of("#");
|
||||
if (pos != std::string::npos) {
|
||||
line = line.substr(0, pos);
|
||||
line = trim(line);
|
||||
}
|
||||
// config vars
|
||||
if (line.find_first_of("/+-~") != 0) {
|
||||
if (line.length() > 1)
|
||||
readConfig(line);
|
||||
continue;
|
||||
}
|
||||
// special folders
|
||||
else if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) ||
|
||||
(line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) {
|
||||
|
Reference in New Issue
Block a user