* [gentoo-portage-dev] [PATCH] ro_checker: skip parents of EPREFIX dir (bug 544624)
@ 2015-04-06 4:28 Zac Medico
2015-04-06 4:56 ` Brian Dolbec
0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-04-06 4:28 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
The ro_checker code added in commit
47ef9a0969474f963dc8e52bfbbb8bc075e8d73c incorrectly asserts that the
parent directories of EPREFIX be writable. Fix it to skip the parents,
since they are irrelevant. This does not affect the case where EPREFIX
is empty, since all directories are checked in that case.
Fixes 47ef9a096947: ("Test for read-only filesystems, fixes bug 378869")
X-Gentoo-Bug: 544624
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544624
---
pym/portage/dbapi/vartree.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 277c2f1..1c0deab 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3751,6 +3751,7 @@ class dblink(object):
line_ending_re = re.compile('[\n\r]')
srcroot_len = len(srcroot)
ed_len = len(self.settings["ED"])
+ eprefix_len = len(self.settings["EPREFIX"])
while True:
@@ -3792,7 +3793,11 @@ class dblink(object):
break
relative_path = parent[srcroot_len:]
- dirlist.append(os.path.join(destroot, relative_path))
+ if len(relative_path) >= eprefix_len:
+ # Files are never installed outside of the prefix,
+ # therefore we skip the readonly filesystem check for
+ # parent directories of the prefix (see bug 544624).
+ dirlist.append(os.path.join(destroot, relative_path))
for fname in files:
try:
--
2.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] ro_checker: skip parents of EPREFIX dir (bug 544624)
2015-04-06 4:28 [gentoo-portage-dev] [PATCH] ro_checker: skip parents of EPREFIX dir (bug 544624) Zac Medico
@ 2015-04-06 4:56 ` Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-04-06 4:56 UTC (permalink / raw
To: gentoo-portage-dev
On Sun, 5 Apr 2015 21:28:07 -0700
Zac Medico <zmedico@gentoo.org> wrote:
> The ro_checker code added in commit
> 47ef9a0969474f963dc8e52bfbbb8bc075e8d73c incorrectly asserts that the
> parent directories of EPREFIX be writable. Fix it to skip the parents,
> since they are irrelevant. This does not affect the case where EPREFIX
> is empty, since all directories are checked in that case.
>
> Fixes 47ef9a096947: ("Test for read-only filesystems, fixes bug
> 378869") X-Gentoo-Bug: 544624
> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544624
> ---
> pym/portage/dbapi/vartree.py | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/pym/portage/dbapi/vartree.py
> b/pym/portage/dbapi/vartree.py index 277c2f1..1c0deab 100644
> --- a/pym/portage/dbapi/vartree.py
> +++ b/pym/portage/dbapi/vartree.py
> @@ -3751,6 +3751,7 @@ class dblink(object):
> line_ending_re = re.compile('[\n\r]')
> srcroot_len = len(srcroot)
> ed_len = len(self.settings["ED"])
> + eprefix_len = len(self.settings["EPREFIX"])
>
> while True:
>
> @@ -3792,7 +3793,11 @@ class dblink(object):
> break
>
> relative_path = parent[srcroot_len:]
> -
> dirlist.append(os.path.join(destroot, relative_path))
> + if len(relative_path) >= eprefix_len:
> + # Files are never installed
> outside of the prefix,
> + # therefore we skip the
> readonly filesystem check for
> + # parent directories of the
> prefix (see bug 544624).
> +
> dirlist.append(os.path.join(destroot, relative_path))
> for fname in files:
> try:
LGTM
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-06 4:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06 4:28 [gentoo-portage-dev] [PATCH] ro_checker: skip parents of EPREFIX dir (bug 544624) Zac Medico
2015-04-06 4:56 ` Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox