summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-30 04:54:20 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-30 04:54:20 +0000
commit227cef9e3cecf48af1d0e0aa517f64862db96b45 (patch)
treed0ac5ac0169061c34da849a7275bcf2262e4b390
parent1e00b017538dc04b97b4d58c0bf6da77e28c8fe4 (diff)
downloadportage-227cef9e3cecf48af1d0e0aa517f64862db96b45.tar.gz
portage-227cef9e3cecf48af1d0e0aa517f64862db96b45.tar.bz2
portage-227cef9e3cecf48af1d0e0aa517f64862db96b45.zip
Handle distlocks subdir initialization together with $DISTDIR and $DISTDIR/cvs-src.
svn path=/main/trunk/; revision=3038
-rw-r--r--pym/portage.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 08f277e17..56aa7b2df 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1838,29 +1838,12 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
print "!!! No write access to %s" % mysettings["DISTDIR"]+"/"
can_fetch=False
else:
- def distdir_perms(filename):
- all_applied = True
- try:
- all_applied = portage_util.apply_secpass_permissions(filename, gid=portage_gid, mode=02070, mask=02)
- except portage_exception.OperationNotPermitted:
- all_applied = False
- if not all_applied:
- writemsg(("!!! Unable to apply group permissions to '%s'." \
- + " Non-root users may experience issues.\n") % filename)
- distdir_perms(mysettings["DISTDIR"])
if use_locks and locks_in_subdir:
distlocks_subdir = os.path.join(mysettings["DISTDIR"], locks_in_subdir)
- try:
- distdir_perms(distlocks_subdir)
- except portage_exception.FileNotFound:
- os.mkdir(distlocks_subdir)
- distdir_perms(distlocks_subdir)
if not os.access(distlocks_subdir, os.W_OK):
writemsg("!!! No write access to write to %s. Aborting.\n" % distlocks_subdir)
return 0
del distlocks_subdir
- del distdir_perms
-
for myfile in filedict.keys():
fetched=0
file_lock = None
@@ -2744,8 +2727,12 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
dirmode = 02070
filemode = 060
modemask = 02
+ distdir_dirs = ["", "cvs-src"]
+ if "distlocks" in features:
+ distdir_dirs.append(".locks")
try:
- for x in ("", "cvs-src"):
+
+ for x in distdir_dirs:
mydir = os.path.join(mysettings["DISTDIR"], x)
try:
os.makedirs(mydir)