diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-01 08:37:11 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-01 08:37:11 -0700 |
commit | 256d04c35bdd166aaf7bc46d93bb9246cd064bb7 (patch) | |
tree | c7b58cad19cd7529af183a482a92013411aedbd1 | |
parent | 621b4fa5986029ad68c09809ce76512646039bea (diff) | |
download | portage-256d04c35bdd166aaf7bc46d93bb9246cd064bb7.tar.gz portage-256d04c35bdd166aaf7bc46d93bb9246cd064bb7.tar.bz2 portage-256d04c35bdd166aaf7bc46d93bb9246cd064bb7.zip |
In ensure_dirs(), only call apply_permissions() when keyword arguments
for it are given.
-rw-r--r-- | pym/portage/util/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 2c22949a4..b11222d00 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1042,7 +1042,7 @@ def write_atomic(file_path, content, **kwargs): else: raise -def ensure_dirs(dir_path, *args, **kwargs): +def ensure_dirs(dir_path, **kwargs): """Create a directory and call apply_permissions. Returns True if a directory is created or the permissions needed to be modified, and False otherwise.""" @@ -1070,7 +1070,10 @@ def ensure_dirs(dir_path, *args, **kwargs): raise ReadOnlyFileSystem(func_call) else: raise - perms_modified = apply_permissions(dir_path, *args, **kwargs) + if kwargs: + perms_modified = apply_permissions(dir_path, **kwargs) + else: + perms_modified = False return created_dir or perms_modified class LazyItemsDict(UserDict): |