From db81bf52ea861cc36ea7151ae87b847c07fcb7f9 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 8 Oct 2021 10:42:41 -0700 Subject: [PATCH] installer: cleanup old cache paths --- selfdrive/ui/installer/installer.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/selfdrive/ui/installer/installer.cc b/selfdrive/ui/installer/installer.cc index 9b2aa6b670..2bade6afe3 100644 --- a/selfdrive/ui/installer/installer.cc +++ b/selfdrive/ui/installer/installer.cc @@ -23,8 +23,7 @@ #define CONTINUE_PATH "/data/continue.sh" #endif -// TODO: remove the other paths after a bit -const QList CACHE_PATHS = {"/data/openpilot.cache", "/system/comma/openpilot", "/usr/comma/openpilot"}; +const QString CACHE_PATH = "/data/openpilot.cache"; #define INSTALL_PATH "/data/openpilot" #define TMP_INSTALL_PATH "/data/tmppilot" @@ -104,21 +103,12 @@ void Installer::doInstall() { qDebug() << "Waiting for valid time"; } - // cleanup + // cleanup previous install attemps run("rm -rf " TMP_INSTALL_PATH " " INSTALL_PATH); - // find the cache path - QString cache; - for (const QString &path : CACHE_PATHS) { - if (QDir(path).exists()) { - cache = path; - break; - } - } - // do the install - if (!cache.isEmpty()) { - cachedFetch(cache); + if (QDir(CACHE_PATH).exists()) { + cachedFetch(CACHE_PATH); } else { freshClone(); }