From edd1138fdda09dd2a1ca9ed0a67fa354f3f3724b Mon Sep 17 00:00:00 2001 From: awalsh128 Date: Thu, 21 Oct 2021 23:28:06 -0700 Subject: [PATCH] Write out manifest. --- install_and_cache_pkgs.sh | 4 ++++ restore_pkgs.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/install_and_cache_pkgs.sh b/install_and_cache_pkgs.sh index 18d6ce0..d402901 100755 --- a/install_and_cache_pkgs.sh +++ b/install_and_cache_pkgs.sh @@ -42,6 +42,10 @@ echo "done." manifest_filepath="$cache_dir/manifest.log" echo -n "Writing package manifest to $manifest_filepath..." +manifest= +for package in $packages; do + manifest=$manifest,$package:$(dpkg -s $package | grep Version | awk '{print $2}') +done # Remove trailing comma. echo ${manifest:0:-1} > $manifest_filepath echo "done." \ No newline at end of file diff --git a/restore_pkgs.sh b/restore_pkgs.sh index 6d273c1..ab87879 100755 --- a/restore_pkgs.sh +++ b/restore_pkgs.sh @@ -20,6 +20,7 @@ echo "Reading from manifest..." for logline in $(cat $cache_dir/manifest.log | tr ',' '\n' ); do echo "- $(echo $logline | tr ':' ' ')" done +echo "done." # Only search for archived results. Manifest and cache key also live here. cache_pkg_filepaths=$(ls -1 $cache_dir/*.tar.gz | sort)