commit:     2593cb2c5d56e373c6c6e4f4663f25241e0e79b7
Author:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 08:59:53 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 22:13:04 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2593cb2c

writeable_check: handle invalid entries in /proc/self/mountinfo

That fixes Gentoo installation won WLS
Source: 
https://github.com/Microsoft/BashOnWindows/issues/992#issuecomment-244460439
Can reproduce on two machines

 pym/portage/util/writeable_check.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pym/portage/util/writeable_check.py 
b/pym/portage/util/writeable_check.py
index ac6c039..b698ea1 100644
--- a/pym/portage/util/writeable_check.py
+++ b/pym/portage/util/writeable_check.py
@@ -58,7 +58,13 @@ def linux_ro_checker(dir_list):
                                # to the left of the ' - ', after the attr's, 
so split it there
                                mount = line.split(' - ', 1)
                                _dir, attr1 = mount[0].split()[4:6]
-                               attr2 = mount[1].split()[2]
+                               # check for situation with invalid entries for 
/home and /root in /proc/self/mountinfo
+                               # root path is missing sometimes on WSL
+                               # for example: 16 1 0:16 / /root rw,noatime - 
lxfs  rw
+                               try:
+                                       attr2 = mount[1].split()[2]
+                               except IndexError:
+                                       attr2 = mount[1].split()[1]
                                if attr1.startswith('ro') or 
attr2.startswith('ro'):
                                        ro_filesystems.add(_dir)
 

Reply via email to