Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] ro_checker: skip parents of EPREFIX dir (bug 544624)
Date: Mon, 06 Apr 2015 04:28:23
Message-Id: 1428294487-20104-1-git-send-email-zmedico@gentoo.org
1 The ro_checker code added in commit
2 47ef9a0969474f963dc8e52bfbbb8bc075e8d73c incorrectly asserts that the
3 parent directories of EPREFIX be writable. Fix it to skip the parents,
4 since they are irrelevant. This does not affect the case where EPREFIX
5 is empty, since all directories are checked in that case.
6
7 Fixes 47ef9a096947: ("Test for read-only filesystems, fixes bug 378869")
8 X-Gentoo-Bug: 544624
9 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544624
10 ---
11 pym/portage/dbapi/vartree.py | 7 ++++++-
12 1 file changed, 6 insertions(+), 1 deletion(-)
13
14 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
15 index 277c2f1..1c0deab 100644
16 --- a/pym/portage/dbapi/vartree.py
17 +++ b/pym/portage/dbapi/vartree.py
18 @@ -3751,6 +3751,7 @@ class dblink(object):
19 line_ending_re = re.compile('[\n\r]')
20 srcroot_len = len(srcroot)
21 ed_len = len(self.settings["ED"])
22 + eprefix_len = len(self.settings["EPREFIX"])
23
24 while True:
25
26 @@ -3792,7 +3793,11 @@ class dblink(object):
27 break
28
29 relative_path = parent[srcroot_len:]
30 - dirlist.append(os.path.join(destroot, relative_path))
31 + if len(relative_path) >= eprefix_len:
32 + # Files are never installed outside of the prefix,
33 + # therefore we skip the readonly filesystem check for
34 + # parent directories of the prefix (see bug 544624).
35 + dirlist.append(os.path.join(destroot, relative_path))
36
37 for fname in files:
38 try:
39 --
40 2.3.1

Replies