From 9a90e078b5538c10a15d973653b8ebb5e0a6ac97 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 31 Jan 2015 22:52:41 +0100 Subject: [PATCH] COPKGManager: ensure cleanup /tmp/.opkg after closing packet manager Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee56b7556721908774f5971eff7ebda0b0ec465d Author: Thilo Graf Date: 2015-01-31 (Sat, 31 Jan 2015) --- src/gui/opkg_manager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index 1a966e4cf..70a3b575c 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -56,6 +56,7 @@ /* later this can be changed to just "opkg" */ #define OPKG_CL "opkg-cl" #define OPKG_CL_CONFIG_OPTIONS " -V2 --tmp-dir=/tmp --cache=/tmp/.opkg " +#define OPKG_TMP_DIR "/tmp/.opkg" using namespace std; @@ -94,11 +95,12 @@ COPKGManager::COPKGManager() list_upgradeable_done = false; expert_mode = false; local_dir = &g_settings.update_dir_opkg; - CFileHelpers::createDir("/tmp/.opkg"); + CFileHelpers::createDir(OPKG_TMP_DIR); } COPKGManager::~COPKGManager() { + CFileHelpers::removeDir(OPKG_TMP_DIR); } int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) @@ -108,7 +110,9 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) if (actionKey.empty()) { if (parent) parent->hide(); - return showMenu(); + int ret = showMenu(); + CFileHelpers::removeDir(OPKG_TMP_DIR); + return ret; } int selected = menu->getSelected() - menu_offset;