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
This commit is contained in:
Markos Chandras 2016-10-31 23:18:28 +00:00
parent 8abc90b22d
commit 290925bd5e

View file

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