Really run additional diagnostics if packages were installed successfully

This commit is contained in:
Mikhail Novosyolov 2019-10-13 21:12:14 +03:00
parent b86b6d84a1
commit 77ee8a2c34
2 changed files with 16 additions and 11 deletions

View file

@ -3,7 +3,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 21.1
Release: 63
Release: 64
Epoch: 1
License: GPLv2+
Group: System/Base

View file

@ -36,6 +36,17 @@ urpmi_bootstrap(){
done
}
diagnostics(){
# Now, when packages have been installed successfully,
# verify that really all of them have been installed.
# Can't redirect to >/dev/null here, because errors are also in stdout.
chroot "$rpmRoot" /bin/rpm -q ${packagesList_orig}
# Perform a check
# TODO: we should fail if there are errors, but will just print to log for now
chroot "$rpmRoot" /bin/rpm -Va || :
}
process_packages(){
# This will validate that all requested packages do exist
@ -88,7 +99,10 @@ packagesList="${packagesList_orig}"
EXIT=0
process_packages
# exit if all packages have been installed
if [ "$urpmi_return_code" = 0 ]; then exit 0; fi
if [ "$urpmi_return_code" = 0 ]; then
diagnostics && \
exit 0
fi
# If installing packages still failed, let's try to install them one-by-one
packagesList_sorted="$(echo "${packagesList_orig}" | tr ' ' '\n' | sort -u)"
@ -117,12 +131,3 @@ fi
packagesList="${packagesList_orig}"
EXIT=1
process_packages
# Now, when packages have been installed successfully,
# verify that really all of them have been installed.
# Can't redirect to >/dev/null here, because errors are also in stdout.
chroot "$rpmRoot" /bin/rpm -q ${packagesList_orig}
# Perform a check
# TODO: we should fail if there are errors, but will just print to log for now
chroot "$rpmRoot" /bin/rpm -Va || :