kiss: KISS_HOOK support multiple files

See #229
This commit is contained in:
Dylan Araps 2021-07-14 18:40:37 +03:00
parent d296b90b75
commit 7fc6929516
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 13 additions and 15 deletions

28
kiss
View File

@ -108,23 +108,21 @@ pkg_owner() {
}
run_hook() {
# Provide a default post-build hook to remove files and directories
# for things we don't support out of the box. One can simply define
# their own hook to override this behavior.
set -- "${1:-null}" "${2:-null}" "${3:-null}"
# Run all hooks in KISS_HOOK (a colon separated
# list of absolute file paths).
_type=${1:-null} _name=${2:-null} _path=${3:-null}
case ${KISS_HOOK:-}-$1 in
-post-build)
rm -rf "$3/usr/share/gettext" \
"$3/usr/share/polkit-1" \
"$3/usr/share/locale" \
"$3/usr/share/info"
;;
IFS=:
*?*-"$1")
"${KISS_HOOK:-}" "$1" "$2" "$3"
;;
esac
# Intentional, globbing disabled.
# shellcheck disable=2086
set -- ${KISS_HOOK:-}
unset IFS
for hook do "$hook" "$_type" "$_name" "$_path" ||
die "$_name" "$_type hook failed: '$hook'"
done
}
run_hook_pkg() {