#!/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