From f1efcf62740eae3a323fc76d597af7c7fc9736a7 Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sun, 7 Jul 2024 16:09:24 -0400 Subject: [PATCH] Add show of failed packages for review before install and after --- scripts/os_debian | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/os_debian b/scripts/os_debian index adfeaf7..1ac8bb0 100755 --- a/scripts/os_debian +++ b/scripts/os_debian @@ -107,6 +107,11 @@ if [[ "\$promptPkgs" =~ ^[Yy] ]]; then apt-get --simulate install \$(cat "\${TMPDIR}/diff.list") |& awk '/^E: Unable to locate package / {print \$NF}' | sort > "\${TMPDIR}/diff.fail" comm --nocheck-order -23 "\${TMPDIR}/diff.list" "\${TMPDIR}/diff.fail" | xargs apt-get install + echo + echo "Packages that were omitted because they could not be found:" + cat "\${TMPDIR}/diff.fail" | tr '\n' ' ' | fold -s + echo + read -p "Did everything above look okay and do you want to proceed? [Y/n] " -n 1 -sr promptPkgsDo if [[ "\$promptPkgsDo" =~ ^[Yy] ]]; then comm --nocheck-order -23 "\${TMPDIR}/diff.list" "\${TMPDIR}/diff.fail" | xargs apt-get install @@ -118,7 +123,7 @@ else fi echo "Packages that failed to schedule for install:" -cat "\${TMPDIR}/diff.fail" +cat "\${TMPDIR}/diff.fail" | tr '\n' ' ' | fold -s EOF chmod ug+rx restore.sh popd || exit 2