Add null field separator so filenames don't get broken up.

This commit is contained in:
awalsh128 2023-04-14 14:33:26 -07:00
parent abb3a6d0e7
commit bf94842250

View file

@ -98,7 +98,8 @@ for installed_package in ${installed_packages}; do
& get_install_script_filepath "" "${package_name}" "preinst" \ & get_install_script_filepath "" "${package_name}" "preinst" \
& get_install_script_filepath "" "${package_name}" "postinst"; } | & get_install_script_filepath "" "${package_name}" "postinst"; } |
while IFS= read -r f; do test -f "${f}" -o -L "${f}" && get_tar_relpath "${f}"; done | while IFS= read -r f; do test -f "${f}" -o -L "${f}" && get_tar_relpath "${f}"; done |
awk '{print "\x27"$1"\x27"}' | # Single quotes ensure literals like backslash get captured. # Single quotes ensure literals like backslash get captured. Use \0 to avoid field separation.
awk -F\0 '{print "\x27"$1"\x27"}' |
sudo xargs tar -cf "${cache_filepath}" -C / sudo xargs tar -cf "${cache_filepath}" -C /
log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))." log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."