mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-03-04 04:09:39 +00:00
Avoid using xargs when creating package tarballs (#136)
This commit is contained in:
parent
d1a184e480
commit
13d2226e13
|
@ -88,13 +88,10 @@ for installed_package in ${installed_packages}; do
|
||||||
log " * Caching ${package_name} to ${cache_filepath}..."
|
log " * Caching ${package_name} to ${cache_filepath}..."
|
||||||
|
|
||||||
# Pipe all package files (no folders) and installation control data to Tar.
|
# Pipe all package files (no folders) and installation control data to Tar.
|
||||||
{ dpkg -L "${package_name}" \
|
tar -cf "${cache_filepath}" -C / --verbatim-files-from --files-from <( { dpkg -L "${package_name}" &&
|
||||||
& 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 )
|
||||||
# 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 /
|
|
||||||
|
|
||||||
log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."
|
log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue