From 99747e10ed583287a45d4cf0de87fbf9ef49e3d3 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Wed, 29 Jun 2011 11:08:00 +0200 Subject: [PATCH] [entropy.spm] PortagePlugin: make sure to also update vdb pkg dir mtime --- .../plugins/interfaces/portage_plugin/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py b/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py index 6fcb5ec31..07645a9b7 100644 --- a/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py +++ b/libraries/entropy/spm/plugins/interfaces/portage_plugin/__init__.py @@ -2867,6 +2867,7 @@ class PortagePlugin(SpmPlugin): if os.path.isdir(pkg_dir): shutil.rmtree(pkg_dir) + vdb_failed = False try: shutil.copytree(copypath, pkg_dir) except (IOError,) as e: @@ -2879,10 +2880,12 @@ class PortagePlugin(SpmPlugin): level = "warning", header = darkred(" ## ") ) + vdb_failed = True # this is a Unit Testing setting, so it's always not available # unless in unit testing code - if not package_metadata.get('unittest_root'): + if not package_metadata.get('unittest_root') and \ + (not vdb_failed): # Packages emerged with -B don't contain CONTENTS file # in their metadata, so we have to create one @@ -2904,8 +2907,12 @@ class PortagePlugin(SpmPlugin): ) counter = -1 - # from this point, every vardb change has to be committed - self._bump_vartree_mtime(spm_package) + if not vdb_failed: + # from this point, every vardb change has to be committed + self._bump_vartree_mtime(spm_package) + # We also need to bump vdb mtime now, otherwise Portage + # will potentially pick up wrong cache data + os.utime(pkg_dir, None) user_inst_source = etpConst['install_sources']['user'] if package_metadata['install_source'] != user_inst_source: