From 290925bd5e0470f69357a8ff13e423ba628c49bb Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 31 Oct 2016 23:18:28 +0000 Subject: [PATCH] elements: zypper-minimal: Refresh repositories after adding the cache The refresh operation must happen after the cache has been added in order to ensure that whatever is in the cache is still relevant to the current build and we are not using stale packages. Change-Id: Iafd718e9738f85b8c235806c027665730f44d89b --- elements/zypper-minimal/root.d/08-zypper-chroot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/elements/zypper-minimal/root.d/08-zypper-chroot b/elements/zypper-minimal/root.d/08-zypper-chroot index e6d55c30..413970d0 100755 --- a/elements/zypper-minimal/root.d/08-zypper-chroot +++ b/elements/zypper-minimal/root.d/08-zypper-chroot @@ -41,9 +41,6 @@ for repo in ${ZYPPER_REPOS}; do sudo zypper ${ZYPPER_TARGET_OPTS} addrepo --name ${reponame} --keep-packages ${repouri} ${reponame} done -# Refresh it -sudo zypper ${ZYPPER_TARGET_OPTS} refresh - # It appears that zypper will clean up the repo's cache when it (re-)adds the # repo so we need to add the cache now, once the repos are added. This is # similar to what the zypper/50-zypper-cache script does @@ -53,6 +50,10 @@ mkdir -p $ZYPPER_CACHE_DIR sudo mkdir -p $TMP_MOUNT_PATH/var/cache/zypp sudo mount --bind $ZYPPER_CACHE_DIR $TMP_MOUNT_PATH/var/cache/zypp +# Refresh it so we get updated data in cased we switched DIB_RELEASE +# since last run. +sudo zypper ${ZYPPER_TARGET_OPTS} refresh + # Install filesystem, base and useful tools sudo zypper ${ZYPPER_TARGET_OPTS} install ${ZYPPER_INSTALL_OPTS} filesystem # Install basic components in order