From 614f4c0fbfbfe9bd79a426f2c3da1bb2188e5741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Mon, 14 May 2018 22:42:59 +0000 Subject: subr/pkg_install_rpm.subr: prefer ${PKG_URL} over ${PKG_URLS_GIT}, don't accept unknown versions. --- subr/pkg_install_rpm.subr | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'subr') diff --git a/subr/pkg_install_rpm.subr b/subr/pkg_install_rpm.subr index d9931fb3..9fe67f37 100644 --- a/subr/pkg_install_rpm.subr +++ b/subr/pkg_install_rpm.subr @@ -8,7 +8,11 @@ pkg_install_rpm() { || ! [ -x "$(which rpmbuild 2>/dev/null)" ]; then return 0; fi; - if [ -n "${PKG_URLS_GIT}" ]; then + if [ -n "${PKG_URL}" ]; then + _pkg_version_rpm="${PKG_VERSION%%-*}"; + _pkg_version_full="${PKG_VERSION}"; + _pkg_url="${PKG_URL}"; + elif [ -n "${PKG_URLS_GIT}" ]; then _pkg_version_rpm="$(cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && git rev-parse HEAD)"; _pkg_version_full="${_pkg_version_rpm} ($(cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && git rev-parse --abbrev-ref HEAD))"; _pkg_url="${PKG_URLS_GIT%% *}"; @@ -16,14 +20,6 @@ pkg_install_rpm() { if [ "${_pkg_url#${DEFAULT_GITROOT_HEAD}}" != "${_pkg_url}" ]; then _pkg_url="Unknown"; fi; - elif [ -n "${PKG_VERSION}" ]; then - _pkg_version_rpm="${PKG_VERSION%%-*}"; - _pkg_version_full="${PKG_VERSION}"; - _pkg_url="${PKG_URL}"; - else - _pkg_version_rpm="${PKG_VERSION}"; - _pkg_version_full="${PKG_VERSION}"; - _pkg_url="${PKG_URL}"; fi; cat > "${PKG_BASE_DIR}/${PKG_NAME}-${_pkg_version_rpm}.spec" <