Only skip data dir paths when updating source
This commit is contained in:
1 parent
a09e8b63ae
commit
4764925ae6
1 file changed
+10
-6
@@ -298,6 +298,7 @@ class SourceUpdater(BaseUpdater):
|
|||||||
|
|
||||||
def replaceWith(self, path):
|
def replaceWith(self, path):
|
||||||
app_dir = ss(Env.get('app_dir'))
|
app_dir = ss(Env.get('app_dir'))
|
||||||
|
data_dir = ss(Env.get('data_dir'))
|
||||||
|
|
||||||
# Get list of files we want to overwrite
|
# Get list of files we want to overwrite
|
||||||
self.deletePyc()
|
self.deletePyc()
|
||||||
@@ -329,12 +330,15 @@ class SourceUpdater(BaseUpdater):
|
|||||||
log.error('Failed overwriting file "%s": %s', (tofile, traceback.format_exc()))
|
log.error('Failed overwriting file "%s": %s', (tofile, traceback.format_exc()))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if Env.get('app_dir') not in Env.get('data_dir'):
|
for still_exists in existing_files:
|
||||||
for still_exists in existing_files:
|
|
||||||
try:
|
if data_dir in still_exists:
|
||||||
os.remove(still_exists)
|
continue
|
||||||
except:
|
|
||||||
log.error('Failed removing non-used file: %s', traceback.format_exc())
|
try:
|
||||||
|
os.remove(still_exists)
|
||||||
|
except:
|
||||||
|
log.error('Failed removing non-used file: %s', traceback.format_exc())
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user