Blame SOURCES/brp-kmod-restore-perms

7689d7
#! /bin/bash -efu
7689d7
7689d7
## A counterpart of brp-kmod-set-exec-bits that restores original kmod
7689d7
## file permissions
7689d7
7689d7
# If using normal root, avoid changing anything.
7689d7
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] || exit 0
7689d7
7689d7
# Checking for required programs
7689d7
which chmod >/dev/null || exit 0
7689d7
7689d7
[ -r "$RPM_BUILD_ROOT/kmod-permissions.list" ] || exit 0
7689d7
7689d7
while read perm path; do
7689d7
	[ -n "$perm" ] || continue
7689d7
7689d7
	chmod "$perm" "$RPM_BUILD_ROOT/$path"
7689d7
done < "$RPM_BUILD_ROOT/kmod-permissions.list"
7689d7
7689d7
rm -f "$RPM_BUILD_ROOT/kmod-permissions.list"