From 75fcdeb6eeceb53af8c7194f206b0593723bef6e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 27 Jul 2006 20:20:28 +0000 Subject: Move permissions adjustment of previously fetched files into the main fetch loop. svn path=/main/trunk/; revision=4033 --- pym/portage.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pym/portage.py') diff --git a/pym/portage.py b/pym/portage.py index 4cb3716e0..e321832b5 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1800,14 +1800,6 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", writemsg(_("Local mirror has file: %(file)s\n" % {"file":myfile})) shutil.copyfile(mydir+"/"+myfile,destdir+"/"+myfile) break - try: - apply_secpass_permissions(os.path.join(mysettings["DISTDIR"], myfile), gid=portage_gid, - mode=0664, mask=02) - except portage_exception.FileNotFound: - pass - except portage_exception.PortageException, e: - if not os.access(os.path.join(mysettings["DISTDIR"], myfile), os.R_OK): - writemsg("!!! Failed to adjust permissions: %s\n" % str(e), noiselevel=-1) except (OSError,IOError),e: # file does not exist writemsg(_("!!! %(file)s not found in %(dir)s\n") % {"file":myfile, "dir":mysettings["DISTDIR"]}, @@ -1943,6 +1935,14 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", raise del e else: + try: + apply_secpass_permissions( + myfile_path, gid=portage_gid, mode=0664, mask=02, + stat_cached=mystat) + except portage_exception.PortageException, e: + if not os.access(myfile_path, os.R_OK): + writemsg("!!! Failed to adjust permissions:" + \ + " %s\n" % str(e), noiselevel=-1) if myfile not in mydigests: # We don't have a digest, but the file exists. We must # assume that it is fully downloaded. -- cgit v1.2.3-1-g7c22