diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-11-12 23:26:38 +0100 |
---|---|---|
committer | Corentin Chary <corentin.chary@gmail.com> | 2012-11-12 23:26:43 +0100 |
commit | 0efe8292b1ac21aa487a6bbe15d19e9d3ba5dc66 (patch) | |
tree | 281c4d6b3f62144d1dbbe3cf9534b74d8e0f6102 /euscanwww | |
parent | euscanwww: Favourite/Unfavourite template code refactored (diff) | |
download | euscan-0efe8292b1ac21aa487a6bbe15d19e9d3ba5dc66.tar.gz euscan-0efe8292b1ac21aa487a6bbe15d19e9d3ba5dc66.tar.bz2 euscan-0efe8292b1ac21aa487a6bbe15d19e9d3ba5dc66.zip |
Don't remove everything, only cache
Diffstat (limited to 'euscanwww')
-rw-r--r-- | euscanwww/djeuscan/processing/misc/update_portage_trees.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/euscanwww/djeuscan/processing/misc/update_portage_trees.py b/euscanwww/djeuscan/processing/misc/update_portage_trees.py index 92d3fcc..f847eef 100644 --- a/euscanwww/djeuscan/processing/misc/update_portage_trees.py +++ b/euscanwww/djeuscan/processing/misc/update_portage_trees.py @@ -79,8 +79,15 @@ def layman_sync(logger, cache=True): for overlay in installed_overlays: logger.info('Cleaning cache for overlay %s...' % overlay) overlay_path = os.path.join(l.config['storage'], overlay) - shutil.rmtree(os.path.join(overlay_path, 'metadata'), True) - shutil.rmtree(os.path.join(overlay_path, 'profiles'), True) + dirs = [os.path.join(overlay_path, 'metadata/cache'), + os.path.join(overlay_path, 'metadata/md5-cache')] + files = [os.path.join(overlay_path, 'profiles/use.local.desc')] + for dirname in dirs: + if os.path.isdir(dirname): + shutil.rmtree(dirname, True) + for filename in files: + if os.path.exists(filename): + os.remove(filename) # FIXME, try to find a way to log layman output... #l.sync(installed_overlays, output_results=False) |