Skip to content

Commit

Permalink
writeable_check: handle invalid entries in /proc/self/mountinfo
Browse files Browse the repository at this point in the history
That fixes Gentoo installation won WLS
Source: microsoft/WSL#992 (comment)
Can reproduce on two machines
  • Loading branch information
cnd authored and zmedico committed Sep 18, 2016
1 parent a514908 commit 2593cb2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pym/portage/util/writeable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2593cb2

Please sign in to comment.