Merge "Allow zypper repos to be overrideable"

This commit is contained in:
Zuul 2019-12-04 06:14:54 +00:00 committed by Gerrit Code Review
commit 361a751d36
2 changed files with 30 additions and 19 deletions

View File

@ -6,3 +6,10 @@ Base element for creating minimal SUSE-based images
This element is incomplete by itself so you probably want to use it along This element is incomplete by itself so you probably want to use it along
with the opensuse-minimal one. It requires 'zypper' to be installed on the with the opensuse-minimal one. It requires 'zypper' to be installed on the
host. host.
To create a zypper-based image with non-default repositories, set
``DIB_ZYPPER_REPOS`` to a mapping of repository names to URLs, for example::
DIB_ZYPPER_REPOS="update=>http://smt-mirror.example.com/SUSE:/SLE-15-SP1:/Update/standard/ "
DIB_ZYPPER_REPOS+="SLE-15-SP1=>http://smt-mirror.example.com/ibs/SUSE:/SLE-15-SP1:/GA/standard/ "
DIB_ZYPPER_REPOS+="SLE-15=>http://smt-mirror.example.com/ibs/SUSE:/SLE-15:/GA/standard/ "

View File

@ -41,6 +41,9 @@ ZYPPER_INSTALL_SYSTEM_PYTHON="python3"
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-https://download.opensuse.org} DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-https://download.opensuse.org}
ZYPPER_REPOS=${DIB_ZYPPER_REPOS:-''}
if [ -z "${ZYPPER_REPOS}" ] ; then
case ${DIB_RELEASE} in case ${DIB_RELEASE} in
# Old Leap releases # Old Leap releases
42*) 42*)
@ -60,6 +63,7 @@ case ${DIB_RELEASE} in
;; ;;
*) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;; *) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;;
esac esac
fi
for repo in ${ZYPPER_REPOS}; do for repo in ${ZYPPER_REPOS}; do
refresh_repo="" refresh_repo=""