Make list of failed packages

This commit is contained in:
Mikhail Novosyolov 2019-03-09 12:29:26 +03:00
parent e7f06d7a8f
commit b936f1cb6b
2 changed files with 9 additions and 2 deletions

View file

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

View file

@ -10,6 +10,7 @@
# I previously made this hack in
# https://github.com/mikhailnov/docker-rosa/blob/master/mkimage-urpmi.sh
set -xefu
failed_pkgs=""
urpmi_exec(){
urpmi \
@ -55,7 +56,10 @@ process_packages(){
# now check the return code of the _last_ urpmi iteration
if [ "${urpmi_return_code}" != 0 ]; then
echo "urpmi bootstrapping failed!"
if [ "$EXIT" = 1 ]; then exit "${urpmi_return_code}"; fi
if [ "$EXIT" = 1 ]; then
if [ -n "${failed_pkgs}" ]; then echo "Failed packages: ${failed_pkgs}"; fi
exit "${urpmi_return_code}"
fi
return "${urpmi_return_code}"
fi
# return failing the whole script on any error
@ -87,6 +91,9 @@ do
packagesList="$i"
urpmi_options="--auto --no-suggests --allow-force --allow-nodeps"
urpmi_exec
if [ "$urpmi_return_code" != 0 ]; then
export failed_pkgs="${failed_pkgs} ${i}"
fi
set -e )
done