fixes bug 311531 "last-update.log isn't updated if it already exists" r=bsmedberg

This commit is contained in:
darin%meer.net 2005-10-07 21:54:08 +00:00
Родитель 8dbb1899d0
Коммит 8015a5ae5c
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -68,6 +68,7 @@ const FILE_UPDATE_LOG = "update.log"
const FILE_UPDATES_DB = "updates.xml"; const FILE_UPDATES_DB = "updates.xml";
const FILE_UPDATE_ACTIVE = "active-update.xml"; const FILE_UPDATE_ACTIVE = "active-update.xml";
const FILE_PERMS_TEST = "update.test"; const FILE_PERMS_TEST = "update.test";
const FILE_LAST_LOG = "last-update.log";
const MODE_RDONLY = 0x01; const MODE_RDONLY = 0x01;
const MODE_WRONLY = 0x02; const MODE_WRONLY = 0x02;
@ -337,7 +338,11 @@ function cleanUpUpdatesDir() {
// Preserve the last update log file for debugging purposes // Preserve the last update log file for debugging purposes
if (f.leafName == FILE_UPDATE_LOG) { if (f.leafName == FILE_UPDATE_LOG) {
try { try {
f.copyTo(f.parent.parent, "last-update.log"); var dir = f.parent.parent;
var logFile = dir.clone();
logFile.append(FILE_LAST_LOG);
logFile.remove(false);
f.copyTo(dir, FILE_LAST_LOG);
} }
catch (e) { catch (e) {
LOG("General", "Failed to copy file: " + f.path); LOG("General", "Failed to copy file: " + f.path);