redhat-rpm-config/SOURCES/brp-kmod-restore-perms

21 lines
534 B
Plaintext
Raw Permalink Normal View History

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