Browse Source

Fix installation of user specified versions for mender-configure add-on

It has been broken since the introduction of mender-configure.

This add-on is architecture independent, so when downloading the .deb
directly from the pool we need to look for "all" suffix instead of the
target architecture. This worked fine for "latest" and "master" versions
because the filename for these were resolved via repository's Packages.

Changelog: title

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
(cherry picked from commit d460de3c80)
2.6.x^2
Lluis Campos 3 years ago
committed by Mender
parent
commit
7005e533a2
  1. 2
      mender-convert-modify
  2. 18
      modules/deb.sh

2
mender-convert-modify

@ -122,7 +122,7 @@ fi
if [ "${MENDER_ADDON_CONFIGURE_INSTALL}" = "y" ]; then
log_info "Installing Mender Configure addon"
deb_get_and_install_pacakge mender-configure "${MENDER_ADDON_CONFIGURE_VERSION}"
deb_get_and_install_pacakge mender-configure "${MENDER_ADDON_CONFIGURE_VERSION}" "true"
fi
# Do this unconditionally even if not installing add-ons. The reason is that if

18
modules/deb.sh

@ -126,13 +126,15 @@ function deb_extract_package() {
#
# $1 - Package name
# $2 - Package version
# $3 - Arch independent (optional, default "false")
#
function deb_get_and_install_pacakge() {
if [[ $# -ne 2 ]]; then
log_fatal "deb_get_and_install_pacakge() requires 2 arguments"
if ! [[ $# -eq 2 || $# -eq 3 ]]; then
log_fatal "deb_get_and_install_pacakge() requires 2 or 3 arguments"
fi
local package="$1"
local version="$2"
local arch_indep="${3:-false}"
mkdir -p work/deb-packages
@ -150,11 +152,19 @@ function deb_get_and_install_pacakge() {
elif [ "${version}" = "master" ]; then
DEB_NAME=$(deb_from_repo_dist_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "${deb_distro}/${deb_codename}/experimental" "${package}")
else
# On direct downloads, the architecture suffix will be "all" for arch independent packages
local pool_arch=""
if [[ "$arch_indep" == "true" ]]; then
pool_arch="all"
else
pool_arch="$deb_arch"
fi
local debian_version="-1+${deb_distro}+${deb_codename}"
DEB_NAME=$(deb_from_repo_pool_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "${package}" "${version}${debian_version}")
DEB_NAME=$(deb_from_repo_pool_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${pool_arch} "${package}" "${version}${debian_version}")
if [[ -z "${DEB_NAME}" ]]; then
local debian_version_fallback="-1"
DEB_NAME=$(deb_from_repo_pool_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "${package}" "${version}${debian_version_fallback}")
DEB_NAME=$(deb_from_repo_pool_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${pool_arch} "${package}" "${version}${debian_version_fallback}")
if [[ -z "${DEB_NAME}" ]]; then
log_fatal "Specified version for ${package} cannot be found, tried ${version}${debian_version} and ${version}${debian_version_fallback}"
fi

Loading…
Cancel
Save