From 4764925ae6644841b360b3f0908f4b19054f6c1e Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 18 Oct 2013 17:13:06 +0200 Subject: [PATCH] Only skip data dir paths when updating source --- couchpotato/core/_base/updater/main.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index f3b4b19c..aecf0c4f 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -298,6 +298,7 @@ class SourceUpdater(BaseUpdater): def replaceWith(self, path): app_dir = ss(Env.get('app_dir')) + data_dir = ss(Env.get('data_dir')) # Get list of files we want to overwrite self.deletePyc() @@ -329,12 +330,15 @@ class SourceUpdater(BaseUpdater): log.error('Failed overwriting file "%s": %s', (tofile, traceback.format_exc())) return False - if Env.get('app_dir') not in Env.get('data_dir'): - for still_exists in existing_files: - try: - os.remove(still_exists) - except: - log.error('Failed removing non-used file: %s', traceback.format_exc()) + for still_exists in existing_files: + + if data_dir in still_exists: + continue + + try: + os.remove(still_exists) + except: + log.error('Failed removing non-used file: %s', traceback.format_exc()) return True