kiss-size: fix for packages containing files with quotes in filenames

if a package contains a file with a quote in it's name, xargs complains
about an unmatched quote and fails, and the pipeline is aborted.
this patch escapes all non-alphanumeric characters so that xargs can
handle such filenames.
This commit is contained in:
aabacchus 2021-12-13 17:48:01 +00:00 committed by git-bruh
parent 990eba374e
commit a973491b0e

View File

@ -29,7 +29,7 @@ kiss list "${1:-null}" >/dev/null || {
# Directories in the manifest end in a trailing '/'.
# Send the file list to 'xargs' to run through 'du',
# this prevents du from exiting due to too many arguments
sed -e "s|^|$KISS_ROOT|" -e 's|.*/$||' \
sed -e "s|^|$KISS_ROOT|" -e '/.*\/$/d' -e 's/[^[:alnum:]]/\\&/g' \
"$KISS_ROOT/var/db/kiss/installed/$1/manifest" \
| xargs du -sk -- 2>/dev/null |