Merge "elements: zypper-minimal: Refresh repositories where necessary"

This commit is contained in:
Zuul 2017-11-30 04:36:06 +00:00 committed by Gerrit Code Review
commit bbbe762dff

View File

@ -62,9 +62,13 @@ case ${DIB_RELEASE} in
esac
for repo in ${ZYPPER_REPOS}; do
refresh_repo=""
reponame=repo-${repo%%=>*}
repouri=${repo##*=>}
sudo zypper ${ZYPPER_TARGET_OPTS} addrepo --name ${reponame} --keep-packages ${repouri} ${reponame}
# Refresh all repos in TW and only the update one for the stable ones. This will ensure that
# we always get the latest information from the repo.
[[ ${DIB_RELEASE} == tumbleweed ]] || [[ ${reponame} == "repo-update" ]] && refresh_repo="-f"
sudo zypper ${ZYPPER_TARGET_OPTS} addrepo --name ${reponame} --keep-packages ${refresh_repo} ${repouri} ${reponame}
done
# It appears that zypper will clean up the repo's cache when it (re-)adds the