limine: update to 8.6.0.
[void-pkg.git] / common / hooks / post-install / 14-fix-permissions.sh
blob9207308744681274d99493c1b1d99dcbea229be7
1 # This hook fixes permissions in common places
3 change_file_perms() {
4 local dir="${PKGDESTDIR}${1}"
5 # permission mask for matching the files
6 local permmask="$2"
7 # permissions which will be set on matched files
8 local perms="$3"
9 if [ -d "$dir" ]; then
10 find "$dir" -type f -perm "/$permmask" -exec chmod -v "$perms" {} +
14 hook() {
15 if [ -z "$nocheckperms" ]; then
16 # check that no files have permission write for other users
17 find "$PKGDESTDIR" -type f -perm -0002 | while read -r file; do
18 msg_error "$pkgver: file ${file#$PKGDESTDIR} has write permission for other users\n"
19 done
22 if [ -z "$nofixperms" ]; then
23 change_file_perms "/usr/share/man" 133 644
24 change_file_perms "/etc/apparmor.d" 111 644
25 change_file_perms "/usr/share/applications" 133 644
26 change_file_perms "/usr/share/help" 133 644
27 change_file_perms "/usr/share/icons" 133 644
28 change_file_perms "/usr/share/locale" 133 644
29 change_file_perms "/usr/share/metainfo" 133 644
30 change_file_perms "/usr/share/appdata" 133 644
31 change_file_perms "/usr/include" 133 644
32 change_file_perms "/usr/share/bash-completion/completions" 133 644
33 change_file_perms "/usr/share/fish/vendor_completions.d" 133 644
34 change_file_perms "/usr/share/zsh/site-functions" 133 644