Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11727 - main/trunk/pym/portage
Date: Mon, 27 Oct 2008 22:19:50
Message-Id: E1KuaR8-00083e-K4@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-27 22:19:45 +0000 (Mon, 27 Oct 2008)
3 New Revision: 11727
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 In fetch(), avoid the "Adjusting permissions recursively" message in cases
9 when the directory has just been created and therefore it must be empty.
10
11
12 Modified: main/trunk/pym/portage/__init__.py
13 ===================================================================
14 --- main/trunk/pym/portage/__init__.py 2008-10-26 07:55:41 UTC (rev 11726)
15 +++ main/trunk/pym/portage/__init__.py 2008-10-27 22:19:45 UTC (rev 11727)
16 @@ -3583,7 +3583,12 @@
17 write_test_file = os.path.join(
18 mydir, ".__portage_test_write__")
19
20 - if os.path.isdir(mydir):
21 + try:
22 + st = os.stat(mydir)
23 + except OSError:
24 + st = None
25 +
26 + if st is not None and stat.S_ISDIR(st.st_mode):
27 if not (userfetch or userpriv):
28 continue
29 if _userpriv_test_write_file(mysettings, write_test_file):
30 @@ -3591,6 +3596,10 @@
31
32 _userpriv_test_write_file_cache.pop(write_test_file, None)
33 if portage.util.ensure_dirs(mydir, gid=dir_gid, mode=dirmode, mask=modemask):
34 + if st is None:
35 + # The directory has just been created
36 + # and therefore it must be empty.
37 + continue
38 writemsg("Adjusting permissions recursively: '%s'\n" % mydir,
39 noiselevel=-1)
40 def onerror(e):