diskimage-builder/diskimage_builder/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash
Dirk Mueller 1bdeaadc95 Fix opensuse-minimal element on non-SUSE hosts
zypper on non-suse hosts is not parsing the pattern repodata because
those are marked as an inofficial extension to the repomd specification.
This is not a big issue as there is meanwhile in newer openSUSE
distributions a pattern *package* that depends on the same packages like
the pattern would do, so we can just replace it with that.

Change-Id: I0c8f713075bd7e5bf1d425f81933b4666654add7
Depends-On: I34e98f0f7693859ed05011b008334628adff612f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-04-02 19:37:01 -04:00

28 lines
1.2 KiB
Bash

export DISTRO_NAME=opensuse
DIB_RELEASE=${DIB_RELEASE:-42.2}
export DIB_RELEASE=${DIB_RELEASE,,}
export DIB_OPENSUSE_MIRROR=${DIB_OPENSUSE_MIRROR:-http://download.opensuse.org}
export DIB_OPENSUSE_PATTERNS=patterns-openSUSE-base
case ${DIB_RELEASE} in
# We are using "=>" as the assignment symbol since "@" "=" etc could be used in the URI itself.
# Remember, we can't export an array in bash so we use a string instead.
# Repo format: {name}=>{uri}
# Old openSUSE releases
13*)
ZYPPER_REPOS="update=>${DIB_OPENSUSE_MIRROR}/update/${DIB_RELEASE}/ "
ZYPPER_REPOS+="oss=>${DIB_OPENSUSE_MIRROR}/distribution/${DIB_RELEASE}/repo/oss/"
;;
# New Leap releases
42*)
ZYPPER_REPOS="update=>${DIB_OPENSUSE_MIRROR}/update/leap/${DIB_RELEASE}/oss/ "
ZYPPER_REPOS+="oss=>${DIB_OPENSUSE_MIRROR}/distribution/leap/${DIB_RELEASE}/repo/oss/"
;;
# Tumbleweed
tumbleweed)
ZYPPER_REPOS="update=>${DIB_OPENSUSE_MIRROR}/update/${DIB_RELEASE}/ "
ZYPPER_REPOS+="oss=>${DIB_OPENSUSE_MIRROR}/${DIB_RELEASE}/repo/oss/"
;;
*) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;;
esac
export ZYPPER_REPOS