This commit is contained in:
George Joseph 2026-04-12 12:32:22 -06:00 committed by GitHub
commit f764b3da8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

2
lib.sh
View file

@ -172,7 +172,7 @@ function write_manifest {
else
log "Writing ${1} packages manifest to ${3}..."
# 0:-1 to remove trailing comma, delimit by newline and sort.
echo "${2:0:-1}" | tr ',' '\n' | sort > ${3}
echo "${2:0:-1}" | tr ',' '\n' > ${3}
log "done"
fi
}

View file

@ -40,13 +40,15 @@ log "done"
log_empty_line
# Only search for archived results. Manifest and cache key also live here.
cached_filepaths=$(ls -1 "${cache_dir}"/*.tar 2>/dev/null | sort)
cached_filecount=$(echo ${cached_filepaths} | wc -w)
manifest_all="${cache_dir}/manifest_all.log"
mapfile -t packages <"${manifest_all}"
cached_filecount="${#packages[@]}"
log "Restoring ${cached_filecount} packages from cache..."
for cached_filepath in ${cached_filepaths}; do
log "- $(basename "${cached_filepath}") restoring..."
for package in "${packages[@]}"; do
cached_filepath="${cache_dir}/${package}.tar"
log "- ${package} restoring..."
sudo tar -xf "${cached_filepath}" -C "${cache_restore_root}" > /dev/null
log " done"