diff --git a/install_and_cache_pkgs.sh b/install_and_cache_pkgs.sh index 4ca95ba..18d6ce0 100755 --- a/install_and_cache_pkgs.sh +++ b/install_and_cache_pkgs.sh @@ -20,14 +20,16 @@ echo -n "Updating APT package list..." sudo apt-get update > /dev/null echo "done." +echo "Clean installing and caching $(echo $packages | wc -w) packages..." for package in $packages; do cache_filepath=$cache_dir/$package.tar.gz - echo -n "Clean installing $package..." + echo "- $package" + echo -n " Installing..." sudo apt-get --yes install $package > /dev/null echo "done." - echo -n "Caching $package to $cache_filepath..." + echo -n " Caching to $cache_filepath..." # Pipe all package files (no folders) to Tar. dpkg -L $package | while IFS= read -r f; do @@ -36,5 +38,10 @@ for package in $packages; do xargs tar -czf $cache_filepath -C / echo "done." done +echo "done." -echo "$(echo $packages | wc -w) package(s) installed and cached." +manifest_filepath="$cache_dir/manifest.log" +echo -n "Writing package manifest to $manifest_filepath..." +# Remove trailing comma. +echo ${manifest:0:-1} > $manifest_filepath +echo "done." \ No newline at end of file diff --git a/post_cache_action.sh b/post_cache_action.sh index 898441f..6f2c8b2 100755 --- a/post_cache_action.sh +++ b/post_cache_action.sh @@ -36,9 +36,3 @@ for package in $packages; do manifest=$manifest$item, done echo "done." - -manifest_filepath="$cache_dir/manifest.log" -echo -n "Writing manifest to $manifest_filepath..." -# 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 c78b232..ad9e223 100755 --- a/restore_pkgs.sh +++ b/restore_pkgs.sh @@ -17,17 +17,10 @@ packages="${@:3}" cache_filenames=$(ls -1 $cache_dir | grep .tar.gz | sort) cache_filename_count=$(echo $cache_filenames | wc -w) -echo "Found $cache_filename_count packages in cache." +echo -n "Restoring $cache_filename_count packages from cache..." for cache_filename in $cache_filenames; do - echo "- $cache_filename" -done - -echo -n "Restoring cached packages..." -for package in $packages; do cache_filepath=$cache_dir/$package.tar.gz echo "- $package ($cache_filepath)" sudo tar -xf $cache_filepath -C $cache_restore_root > /dev/null done echo "done." - -echo "$cache_filename_count package(s) restored." \ No newline at end of file