summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-18 02:29:21 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-18 02:29:21 +0000
commit6f3f3d8517c11ef4f727937a5ba5db020febb061 (patch)
tree6028f2034556aead2dffe8b71f64b7f6336de795
parent4e02bb3944f625ca360de9b092c88f0b96a3c2f1 (diff)
downloadportage-6f3f3d8517c11ef4f727937a5ba5db020febb061.tar.gz
portage-6f3f3d8517c11ef4f727937a5ba5db020febb061.tar.bz2
portage-6f3f3d8517c11ef4f727937a5ba5db020febb061.zip
Fix PORTAGE_WORKDIR_MODE parsing so that the validated value is stored in mysettings.
svn path=/main/trunk/; revision=2930
-rw-r--r--pym/portage.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 0939091a9..a6ace930d 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2645,15 +2645,18 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
workdir_mode = 0700
try:
- workdir_mode = int(eval(mysettings["PORTAGE_WORKDIR_MODE"]))
- if workdir_mode & 07777 != workdir_mode:
+ parsed_mode = int(eval(mysettings["PORTAGE_WORKDIR_MODE"]))
+ if parsed_mode & 07777 != parsed_mode:
raise ValueError("Invalid file mode: %s" % mysettings["PORTAGE_WORKDIR_MODE"])
+ else:
+ workdir_mode = parsed_mode
except KeyError, e:
writemsg("!!! PORTAGE_WORKDIR_MODE is unset, using %s." % oct(workdir_mode))
except (ValueError, SyntaxError), e:
writemsg("%s\n" % e)
writemsg("!!! Unable to parse PORTAGE_WORKDIR_MODE='%s', using %s.\n" % \
(mysettings["PORTAGE_WORKDIR_MODE"], oct(workdir_mode)))
+ mysettings["PORTAGE_WORKDIR_MODE"] = oct(workdir_mode)
try:
apply_secpass_permissions(mysettings["WORKDIR"],
uid=portage_uid, gid=portage_gid, mode=workdir_mode)