Fix FileNotFoundError when restorecon unavailable

Fixes:
 - http://autobuild.buildroot.net/results/d5dcdfdfab3503fdc387f99e68267972a38c417d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
pull/3252/head
Fabrice Fontaine 7 years ago committed by Jussi Pakkanen
parent 24ae120868
commit 2e128f71bb
  1. 4
      mesonbuild/scripts/meson_install.py

@ -97,6 +97,10 @@ def restore_selinux_contexts():
# is ignored quietly. # is ignored quietly.
return return
if not shutil.which('restorecon'):
# If we don't have restorecon, failure is ignored quietly.
return
with subprocess.Popen(['restorecon', '-F', '-f-', '-0'], with subprocess.Popen(['restorecon', '-F', '-f-', '-0'],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc: stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
out, err = proc.communicate(input=b'\0'.join(os.fsencode(f) for f in selinux_updates) + b'\0') out, err = proc.communicate(input=b'\0'.join(os.fsencode(f) for f in selinux_updates) + b'\0')

Loading…
Cancel
Save