Merge "Cleanup yumdownloader repos"

This commit is contained in:
Jenkins 2016-11-18 00:23:00 +00:00 committed by Gerrit Code Review
commit 0fbf131550
1 changed files with 13 additions and 2 deletions

View File

@ -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