2022-12-01 13:03:02 +01:00
|
|
|
#!/bin/bash -xe
|
2021-05-04 15:57:05 +02:00
|
|
|
|
2021-07-05 06:56:36 +02:00
|
|
|
TAGPREFIX=_TAGPREFIX_
|
|
|
|
LABELPREFIX=_LABELPREFIX_
|
|
|
|
REGISTRY=_REGISTRY_
|
|
|
|
PKG_VERSION=_PKG_VERSION_
|
|
|
|
PKG_RELEASE=_PKG_RELEASE_
|
2022-12-01 13:03:02 +01:00
|
|
|
DISTRO=_DISTRO_
|
|
|
|
|
|
|
|
# Set HOME=/root as a workaround for
|
|
|
|
# https://github.com/openSUSE/obs-build/issues/901
|
|
|
|
_distro=$(HOME=/root rpm --eval '%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}')
|
|
|
|
[ "${DISTRO}" == "${_distro}" ] || exit 1
|
2021-05-04 15:57:05 +02:00
|
|
|
|
|
|
|
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
|