diff --git a/data/settingsupdate.conf b/data/settingsupdate.conf index 45eafcac9..5234dc041 100644 --- a/data/settingsupdate.conf +++ b/data/settingsupdate.conf @@ -21,7 +21,17 @@ ## Die Verzeichnisse "/", "/dev", "/proc", "/sys", "/mnt", "/tmp" können nicht gesichert werden!! #------------------------------------------------------------------------------------------------ +#--------------------------------------------------------------------------- +## vor der Sicherung aus dem neuen Image zu löschende Dateien/Verzeichnisse, +## gekennzeichnet durch ein vorangestelltes ~ +# z.B. +# ~/share/tuxbox/neutrino/themes/Classic.theme +#--------------------------------------------------------------------------- + + +#------------- ## Sicherungen +#------------- /etc/hostname /etc/hosts /etc/network @@ -30,6 +40,7 @@ /var/etc /var/tuxbox/config + #---------------------------------------------------------------------------------------- ## von der Sicherung auszuschließende Dateien, gekennzeichnet durch ein vorangestelltes - #---------------------------------------------------------------------------------------- @@ -41,10 +52,3 @@ -/var/tuxbox/config/satellites.xml -/var/tuxbox/config/settingsupdate.conf -/var/tuxbox/config/tobackup.conf - -#---------------------------------------------------------------------------- -## nach der Sicherung aus dem neuen Image zu löschende Dateien/Verzeichnisse, -## gekennzeichnet durch ein vorangestelltes ~ -# z.B. -# ~/share/tuxbox/neutrino/themes/Classic.theme -#---------------------------------------------------------------------------- diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index c883a7060..c9094941d 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -506,6 +506,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) { char buf[PATH_MAX]; static struct stat FileInfo; + vector::iterator it; f1 = fopen(backupList.c_str(), "r"); if (f1 == NULL) { @@ -582,8 +583,30 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } fclose(f1); + // read DeleteList + for(it = deleteList.begin(); it != deleteList.end(); ++it) { + line = *it; + if (lstat(line.c_str(), &FileInfo) != -1) { + if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { + // Wildcards + WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); + deleteFileList(line.c_str()); + } + else if (S_ISREG(FileInfo.st_mode)) { + // File + WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); + unlink(line.c_str()); + } + else if (S_ISDIR(FileInfo.st_mode)){ + // Directory + WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str()); + FileHelpers->removeDir(line.c_str()); + } + } + } + sync(); + // read copyList - vector::iterator it; for(it = copyList.begin(); it != copyList.end(); ++it) { line = *it; line = trim(line); @@ -628,28 +651,6 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } } - - // read DeleteList - for(it = deleteList.begin(); it != deleteList.end(); ++it) { - line = *it; - if (lstat(line.c_str(), &FileInfo) != -1) { - if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { - // Wildcards - WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); - deleteFileList(line.c_str()); - } - else if (S_ISREG(FileInfo.st_mode)) { - // File - WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); - unlink(line.c_str()); - } - else if (S_ISDIR(FileInfo.st_mode)){ - // Directory - WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str()); - FileHelpers->removeDir(line.c_str()); - } - } - } sync(); return true; }