From c58510bf4168bbe6bac71b83912986c92d031651 Mon Sep 17 00:00:00 2001 From: Andrew Walsh Date: Sat, 3 Sep 2022 21:40:21 -0700 Subject: [PATCH] Remove compression from file caching. (#53) (#54) (#55) --- install_and_cache_pkgs.sh | 4 ++-- restore_pkgs.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install_and_cache_pkgs.sh b/install_and_cache_pkgs.sh index 84bd0de..2f05a4c 100755 --- a/install_and_cache_pkgs.sh +++ b/install_and_cache_pkgs.sh @@ -64,7 +64,7 @@ log_empty_line installed_package_count=$(wc -w <<< "${installed_packages}") log "Caching ${installed_package_count} installed packages..." for installed_package in ${installed_packages}; do - cache_filepath="${cache_dir}/${installed_package}.tar.gz" + cache_filepath="${cache_dir}/${installed_package}.tar" # Sanity test in case APT enumerates duplicates. if test ! -f "${cache_filepath}"; then @@ -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 | - sudo xargs tar -czf "${cache_filepath}" -C / + sudo xargs tar -cf "${cache_filepath}" -C / log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))." fi diff --git a/restore_pkgs.sh b/restore_pkgs.sh index d58c07c..e398a3e 100755 --- a/restore_pkgs.sh +++ b/restore_pkgs.sh @@ -31,7 +31,7 @@ log "done" log_empty_line # Only search for archived results. Manifest and cache key also live here. -cached_pkg_filepaths=$(ls -1 "${cache_dir}"/*.tar.gz | sort) +cached_pkg_filepaths=$(ls -1 "${cache_dir}"/*.tar | sort) cached_pkg_filecount=$(echo ${cached_pkg_filepaths} | wc -w) log "Restoring ${cached_pkg_filecount} packages from cache..." for cached_pkg_filepath in ${cached_pkg_filepaths}; do