diff --git a/elements/yum-minimal/root.d/08-yum-chroot b/elements/yum-minimal/root.d/08-yum-chroot index 50c0a6b2d..10fe1d258 100755 --- a/elements/yum-minimal/root.d/08-yum-chroot +++ b/elements/yum-minimal/root.d/08-yum-chroot @@ -56,6 +56,7 @@ _RPM="rpm --dbpath=/var/lib/rpm" # has yum/yumdownloader function _install_repos { local packages + local rc # pre-install the base system packages via rpm. We previously # just left it up to yum to drag these in when we "yum install @@ -79,11 +80,21 @@ function _install_repos { packages+="${DISTRO_NAME}-repos " fi - yumdownloader \ + # yumdownloader puts repo xml files and such into a directory + # ${TMPDIR}/yum-$USER-random. Since we don't need this once the + # initial download happens, redirect TMPDIR for this call so we + # can clean it up nicely + local temp_tmp + temp_tmp=$(mktemp -d) + TMPDIR=${temp_tmp} yumdownloader \ --releasever=$DIB_RELEASE \ --setopt=reposdir=$TMP_HOOKS_PATH/yum.repos.d \ --destdir=$WORKING \ - ${packages} + ${packages} && rc=$? || rc=$? + rm -rf ${temp_tmp} + if [[ ${rc} != 0 ]]; then + die "Failed to download initial packages: ${packages}" + fi # --nodeps works around these wanting /bin/sh in some fedora # releases, see rhbz#1265873