diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-04-03 03:59:26 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-04-03 03:59:26 +0000 |
commit | 09a00db962e429d0247ab6209ec312dde5b00866 (patch) | |
tree | bf19e589cee023393d1cde88eb3e265b2953bee6 /pym/portage_util.py | |
parent | 1de0260346ad4c9862b5699d9e82a2d1c74eef2d (diff) | |
download | portage-09a00db962e429d0247ab6209ec312dde5b00866.tar.gz portage-09a00db962e429d0247ab6209ec312dde5b00866.tar.bz2 portage-09a00db962e429d0247ab6209ec312dde5b00866.zip |
Move DISTDIR initialization from doebuild to fetch and handle read-only file system errors for bug #128506.
svn path=/main/trunk/; revision=3058
Diffstat (limited to 'pym/portage_util.py')
-rw-r--r-- | pym/portage_util.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py index ae7525186..5c128d59d 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/pym/portage_util.py,v 1.11.2.6 2005/04/23 07:26:04 jstubbs Exp $ -from portage_exception import PortageException, FileNotFound, OperationNotPermitted +from portage_exception import PortageException, FileNotFound, OperationNotPermitted, ReadOnlyFileSystem import sys,string,shlex,os,errno try: @@ -512,12 +512,14 @@ def apply_permissions(filename, uid=-1, gid=-1, mode=-1, mask=-1, os.chmod(filename, new_mode) modified = True except OSError, oe: + func_call = "chmod('%s', %s)" % (filename, oct(new_mode)) if oe.errno == errno.EPERM: - raise OperationNotPermitted("chmod('%s', %s)" % (filename, oct(new_mode))) + raise OperationNotPermitted(func_call) + elif oe.errno == errno.EROFS: + raise ReadOnlyFileSystem(func_call) elif oe.errno == errno.ENOENT: raise FileNotFound(filename) - else: - raise + raise return modified def apply_stat_permissions(filename, newstat, **kwargs): |