Skip to content

Commit

Permalink
Remove compression from file caching. (#53) (#54) (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
awalsh128 authored Sep 4, 2022
1 parent 09f9c08 commit c58510b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions install_and_cache_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion restore_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c58510b

Please sign in to comment.