forked from pool/containerized-data-importer
48ef596aa4
- Add REGISTRY variable OBS-URL: https://build.opensuse.org/request/show/898375 OBS-URL: https://build.opensuse.org/package/show/Virtualization/containerized-data-importer?expand=0&rev=21
32 lines
812 B
Bash
32 lines
812 B
Bash
#!/bin/bash
|
|
|
|
distro=$(rpm --eval '%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}')
|
|
case "${distro}" in
|
|
150200:0)
|
|
TAGPREFIX=suse/sles/15.2
|
|
LABELPREFIX=com.suse.kubevirt
|
|
REGISTRY=registry.suse.com
|
|
;;
|
|
150300:0)
|
|
TAGPREFIX=suse/sles/15.3
|
|
LABELPREFIX=com.suse.kubevirt
|
|
REGISTRY=registry.suse.com
|
|
;;
|
|
*)
|
|
TAGPREFIX=kubevirt
|
|
LABELPREFIX=org.opensuse.kubevirt
|
|
REGISTRY=registry.opensuse.org
|
|
;;
|
|
esac
|
|
|
|
if [ -n "${pkg}" ]; then
|
|
if rpm -q ${pkg}; then
|
|
PKG_VERSION=$(rpm -q --queryformat=%{version} ${pkg})
|
|
PKG_RELEASE=$(rpm -q --queryformat=%{release} ${pkg})
|
|
else
|
|
_pkg=$(find ./repos -name "${pkg}*.rpm")
|
|
PKG_VERSION=$(rpm -qp --queryformat=%{version} ${_pkg})
|
|
PKG_RELEASE=$(rpm -qp --queryformat=%{release} ${_pkg})
|
|
fi
|
|
fi
|