diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-12 05:20:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-12 05:20:48 +0000 |
commit | 3b44fff5b04d13dfa2af6c2c948076cd38dd350f (patch) | |
tree | 839fc2103c1573b472b666467cdf18dfd4a45c3a | |
parent | f773aa347211235417363945d8bfd409e201357e (diff) | |
download | portage-3b44fff5b04d13dfa2af6c2c948076cd38dd350f.tar.gz portage-3b44fff5b04d13dfa2af6c2c948076cd38dd350f.tar.bz2 portage-3b44fff5b04d13dfa2af6c2c948076cd38dd350f.zip |
Bug #261992 - Inside Binpkg._prefetch_exit(), avoid potention issues with
shutil.rmtree() by just doing a minimal cleanup.
svn path=/main/trunk/; revision=13070
-rw-r--r-- | pym/_emerge/__init__.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index b8a0a5059..04c8d72b5 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -3413,12 +3413,14 @@ class Binpkg(CompositeTask): pkg_count = self.pkg_count if not (self.opts.pretend or self.opts.fetchonly): self._build_dir.lock() - try: - shutil.rmtree(self._build_dir.dir_path) - except EnvironmentError, e: - if e.errno != errno.ENOENT: - raise - del e + # If necessary, discard old log so that we don't + # append to it. + for x in ('.logid', 'temp/build.log'): + try: + os.unlink(os.path.join(self._build_dir.dir_path, x)) + except OSError: + pass + # Initialze PORTAGE_LOG_FILE. portage.prepare_build_dirs(self.settings["ROOT"], self.settings, 1) fetcher = BinpkgFetcher(background=self.background, logfile=self.settings.get("PORTAGE_LOG_FILE"), pkg=self.pkg, |