Add show of failed packages for review before install and after
This commit is contained in:
parent
a69d966c2c
commit
f1efcf6274
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue