From ec27aa3a78c549a78f97bab180e65ddbc23822c6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 23 Jun 2017 09:35:27 +1000 Subject: [PATCH] Skip restorecon if it cannot be found https://bugs.freedesktop.org/show_bug.cgi?id=101557 Signed-off-by: Peter Hutterer --- src/libinput-restore-selinux-context.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libinput-restore-selinux-context.sh b/src/libinput-restore-selinux-context.sh index 7fd8fad0..3b1c555b 100644 --- a/src/libinput-restore-selinux-context.sh +++ b/src/libinput-restore-selinux-context.sh @@ -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