From: Zac Medico Date: Wed, 26 Nov 2008 00:42:05 +0000 (-0000) Subject: Bug #248782 - Handle permission error in EbuildFetchonly.execute() if PORTAGE_TMPDIR X-Git-Tag: v2.1.6_rc2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fa1447c99e949f4068d4bfc1ab898a3b23ff7cac;p=portage.git Bug #248782 - Handle permission error in EbuildFetchonly.execute() if PORTAGE_TMPDIR is not writable. (trunk r12092) svn path=/main/branches/2.1.6/; revision=12093 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index f7c5ad032..9a0f86483 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1586,7 +1586,12 @@ class EbuildFetchonly(SlotObject): settings = self.settings global_tmpdir = settings["PORTAGE_TMPDIR"] from tempfile import mkdtemp - private_tmpdir = mkdtemp("", "._portage_fetch_.", global_tmpdir) + try: + private_tmpdir = mkdtemp("", "._portage_fetch_.", global_tmpdir) + except OSError, e: + if e.errno != portage.exception.PermissionDenied.errno: + raise + raise portage.exception.PermissionDenied(global_tmpdir) settings["PORTAGE_TMPDIR"] = private_tmpdir settings.backup_changes("PORTAGE_TMPDIR") try: