1
0

010-wsl2.patch 901 B

123456789101112131415161718192021
  1. From 7d1ef4343ed5b2b7ab51469177a42c32c47f0528 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Tue, 6 Sep 2022 01:36:17 -0700
  4. Subject: [PATCH] minstall: handle extra error for selinuxenabled
  5. Microsoft's WSL2 uses a Plan 9 filesystem, which returns IOError when file is missing.
  6. ---
  7. mesonbuild/minstall.py | 2 +-
  8. 1 file changed, 1 insertion(+), 1 deletion(-)
  9. --- a/mesonbuild/minstall.py
  10. +++ b/mesonbuild/minstall.py
  11. @@ -229,7 +229,7 @@ def restore_selinux_contexts() -> None:
  12. '''
  13. try:
  14. subprocess.check_call(['selinuxenabled'])
  15. - except (FileNotFoundError, NotADirectoryError, PermissionError, subprocess.CalledProcessError):
  16. + except (FileNotFoundError, NotADirectoryError, OSError, PermissionError, subprocess.CalledProcessError):
  17. # If we don't have selinux or selinuxenabled returned 1, failure
  18. # is ignored quietly.
  19. return