From 7f051add613bc63821da3ecbadd698641684b36d Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 16 Nov 2017 16:53:30 +0000 Subject: [PATCH] elements: zypper-minimal: Refresh repositories where necessary We should always refresh the Tumbleweed repositories and the 'update' one for Leap in order to always have the latest information from the repositories. Change-Id: I85db9d8bb7fa153f01222129e9b36fecc2632f57 --- .../elements/zypper-minimal/root.d/08-zypper-chroot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot b/diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot index d9a0d7260..a15907029 100755 --- a/diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot +++ b/diskimage_builder/elements/zypper-minimal/root.d/08-zypper-chroot @@ -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