diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2018-05-14 22:42:59 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2018-05-14 22:42:59 +0000 |
commit | 614f4c0fbfbfe9bd79a426f2c3da1bb2188e5741 (patch) | |
tree | 6e5e759ce9ac4eec11560d446b49ecdfa9d2065e | |
parent | 4a1eebfbf75915fc69a73bd09d98bcfeb264ca0b (diff) | |
download | midipix_build-614f4c0fbfbfe9bd79a426f2c3da1bb2188e5741.tar.bz2 midipix_build-614f4c0fbfbfe9bd79a426f2c3da1bb2188e5741.tar.xz |
subr/pkg_install_rpm.subr: prefer ${PKG_URL} over ${PKG_URLS_GIT}, don't accept unknown versions.
-rw-r--r-- | subr/pkg_install_rpm.subr | 14 |
1 files changed, 5 insertions, 9 deletions
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" <<EOF Name: ${PKG_NAME} |