2021-05-04 15:58:13 +02:00
|
|
|
#!/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
|
2021-06-08 14:38:54 +02:00
|
|
|
REGISTRY=registry.suse.com
|
2021-05-04 15:58:13 +02:00
|
|
|
;;
|
|
|
|
150300:0)
|
|
|
|
TAGPREFIX=suse/sles/15.3
|
|
|
|
LABELPREFIX=com.suse.kubevirt
|
2021-06-08 14:38:54 +02:00
|
|
|
REGISTRY=registry.suse.com
|
2021-05-04 15:58:13 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
TAGPREFIX=kubevirt
|
|
|
|
LABELPREFIX=org.opensuse.kubevirt
|
2021-06-08 14:38:54 +02:00
|
|
|
REGISTRY=registry.opensuse.org
|
2021-05-04 15:58:13 +02:00
|
|
|
;;
|
|
|
|
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
|