From b0da983722752ea262206f8db9093fb43954e2f3 Mon Sep 17 00:00:00 2001 From: awalsh128 Date: Sun, 7 Aug 2022 06:00:09 -0700 Subject: [PATCH] Change to zstd compression (#46). --- install_and_cache_pkgs.sh | 2 +- lib.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install_and_cache_pkgs.sh b/install_and_cache_pkgs.sh index 20ebcd2..64e5a42 100755 --- a/install_and_cache_pkgs.sh +++ b/install_and_cache_pkgs.sh @@ -75,7 +75,7 @@ for installed_package in ${installed_packages}; do while IFS= read -r f; do if test -f $f || test -L $f; then echo "${f:1}"; fi; #${f:1} removes the leading slash that Tar disallows done | - xargs tar -czf "${cache_filepath}" -C / + xargs tar -caf "${cache_filepath}" -C / log " * Cached ${installed_package_name} to ${cache_filepath} (compressed size $(du -h "${cache_filepath}" | cut -f1))." fi diff --git a/lib.sh b/lib.sh index f9f88b9..9f80537 100755 --- a/lib.sh +++ b/lib.sh @@ -13,11 +13,11 @@ function normalize_package_list { # : ... function get_installed_packages { install_log_filepath="${1}" - local regex="^Unpacking ([^ :]+)([^ ]+)? (\[[^ ]+\]\s)?\(([^ )]+)" + local regex="^Unpacking ([^ :]+)([^ ]+)? (\[[^ ]+\]\s)?\(([^ )]+)" dep_packages="" while read -r line; do if [[ "${line}" =~ ${regex} ]]; then - dep_packages="${dep_packages}${BASH_REMATCH[1]}:${BASH_REMATCH[4]} " + dep_packages="${dep_packages}${BASH_REMATCH[1]}:${BASH_REMATCH[4]} " else log_err "Unable to parse package name and version from \"${line}\"" exit 2