Blame SOURCES/brp-kmod-restore-perms

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