From 5c9807a55b870d3244fbcf38ba56dcb609abaa6a Mon Sep 17 00:00:00 2001 From: Rob Nagler Date: Wed, 18 Oct 2023 16:27:16 -0600 Subject: [PATCH] Fix #396 rsaccounting yum install (#397) --- rsconf/component/rsaccounting.py | 5 ----- rsconf/package_data/rsconf/rsconf.sh | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rsconf/component/rsaccounting.py b/rsconf/component/rsaccounting.py index f363b78a..875cb6ed 100644 --- a/rsconf/component/rsaccounting.py +++ b/rsconf/component/rsaccounting.py @@ -25,11 +25,6 @@ def internal_build_compile(self): from rsconf.component import docker_registry self.buildt.require_component("nginx") - # much newer than centos 7 version - v = "rclone-1.64.0-1" - self.append_root_bash( - f"rsconf_yum_install_url {v} https://downloads.rclone.org/v1.64.0/{v}-linux-amd64.rpm" - ) jc, z = self.j2_ctx_init() z._run_u = jc.rsconf_db.run_u self.__run_d = systemd.docker_unit_prepare( diff --git a/rsconf/package_data/rsconf/rsconf.sh b/rsconf/package_data/rsconf/rsconf.sh index 2758b826..a93eb17c 100644 --- a/rsconf/package_data/rsconf/rsconf.sh +++ b/rsconf/package_data/rsconf/rsconf.sh @@ -617,14 +617,8 @@ rsconf_yum_install() { todo+=( "$x" ) fi done - declare cmd="${rsconf_yum_install_cmd:-install}" - if [[ ! $cmd =~ ^((re)?install|downgrade)$ ]]; then - install_err "unexpected value rsconf_yum_install_cmd=$cmd" - fi if (( ${#todo[@]} > 0 )); then - if ! yum "$cmd" --color=never -y -q "${todo[@]}"; then - install_err "FAILED: yum $cmd ${todo[*]}"; - fi + _rsconf_yum_install "${todo[@]}" fi } @@ -634,7 +628,18 @@ rsconf_yum_install_url() { if rpm -q "$base" >& /dev/null; then return fi - rsconf_yum_install "$url" + _rsconf_yum_install "$url" +} + +_rsconf_yum_install() { + declare todo=( "$@" ) + declare cmd="${rsconf_yum_install_cmd:-install}" + if [[ ! $cmd =~ ^((re)?install|downgrade)$ ]]; then + install_err "unexpected value rsconf_yum_install_cmd=$cmd" + fi + if ! yum "$cmd" --color=never -y -q "${todo[@]}"; then + install_err "FAILED: yum $cmd ${todo[*]}"; + fi } rsconf_main ${install_extra_args[@]+"${install_extra_args[@]}"}