summaryrefslogtreecommitdiffstats
path: root/api/logic/updater
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-11-18 16:04:08 +0100
committerPetr Mrázek <peterix@gmail.com>2016-11-19 22:11:45 +0100
commit69be23c5f629884465dec98efcb9d5a2678b4df5 (patch)
tree9c9135bb995006fac7a6de3b349fe24b325dbe99 /api/logic/updater
parente974950d48e4e8b9500acbeadf9c1abdab1dec72 (diff)
downloadMultiMC-69be23c5f629884465dec98efcb9d5a2678b4df5.tar
MultiMC-69be23c5f629884465dec98efcb9d5a2678b4df5.tar.gz
MultiMC-69be23c5f629884465dec98efcb9d5a2678b4df5.tar.lz
MultiMC-69be23c5f629884465dec98efcb9d5a2678b4df5.tar.xz
MultiMC-69be23c5f629884465dec98efcb9d5a2678b4df5.zip
GH-1726 better failure detection for updates
Instead of just checking if the new version started, make sure it is able to write its IPC key to a file and then use the key to connect to the process.
Diffstat (limited to 'api/logic/updater')
-rw-r--r--api/logic/updater/DownloadTask_test.cpp4
-rw-r--r--api/logic/updater/GoUpdate.h21
2 files changed, 14 insertions, 11 deletions
diff --git a/api/logic/updater/DownloadTask_test.cpp b/api/logic/updater/DownloadTask_test.cpp
index 5b88b366..e75c3ffa 100644
--- a/api/logic/updater/DownloadTask_test.cpp
+++ b/api/logic/updater/DownloadTask_test.cpp
@@ -52,8 +52,8 @@ QDebug operator<<(QDebug dbg, const Operation::Type &t)
QDebug operator<<(QDebug dbg, const Operation &u)
{
- dbg.nospace() << "Operation(type=" << u.type << " file=" << u.file
- << " dest=" << u.dest << " mode=" << u.mode << ")";
+ dbg.nospace() << "Operation(type=" << u.type << " file=" << u.source
+ << " dest=" << u.destination << " mode=" << u.destinationMode << ")";
return dbg.maybeSpace();
}
diff --git a/api/logic/updater/GoUpdate.h b/api/logic/updater/GoUpdate.h
index b8a534de..95f26b8c 100644
--- a/api/logic/updater/GoUpdate.h
+++ b/api/logic/updater/GoUpdate.h
@@ -68,19 +68,22 @@ typedef QList<VersionFileEntry> VersionFileList;
*/
struct MULTIMC_LOGIC_EXPORT Operation
{
- static Operation CopyOp(QString fsource, QString fdest, int fmode=0644)
+ static Operation CopyOp(QString from, QString to, int fmode=0644)
{
- return Operation{OP_REPLACE, fsource, fdest, fmode};
+ return Operation{OP_REPLACE, from, to, fmode};
}
static Operation DeleteOp(QString file)
{
- return Operation{OP_DELETE, file, "", 0644};
+ return Operation{OP_DELETE, QString(), file, 0644};
}
// FIXME: for some types, some of the other fields are irrelevant!
bool operator==(const Operation &u2) const
{
- return type == u2.type && file == u2.file && dest == u2.dest && mode == u2.mode;
+ return type == u2.type &&
+ source == u2.source &&
+ destination == u2.destination &&
+ destinationMode == u2.destinationMode;
}
//! Specifies the type of operation that this is.
@@ -90,14 +93,14 @@ struct MULTIMC_LOGIC_EXPORT Operation
OP_DELETE,
} type;
- //! The file to operate on.
- QString file;
+ //! The source file, if any
+ QString source;
//! The destination file.
- QString dest;
+ QString destination;
- //! The mode to change the source file to.
- int mode;
+ //! The mode to change the destination file to.
+ int destinationMode;
};
typedef QList<Operation> OperationList;