Skip restorecon if it cannot be found
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 22 Jun 2017 23:35:27 +0000 (09:35 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 22 Jun 2017 23:58:42 +0000 (09:58 +1000)
https://bugs.freedesktop.org/show_bug.cgi?id=101557

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/libinput-restore-selinux-context.sh

index 7fd8fad0742332833e07de8b183efc963813e039..3b1c555b017bdd302dbf96921ac9562d883b0e7d 100644 (file)
@@ -6,5 +6,7 @@
 libdir="$1"
 sofile=$(basename "$2")
 
-echo "Restoring SELinux context on $MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
-restorecon "$MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
+if command -v restorecon >/dev/null; then
+       echo "Restoring SELinux context on $MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
+       restorecon "$MESON_INSTALL_DESTDIR_PREFIX/$libdir/$sofile"
+fi