From ac8be6e92bcef06efc48274c84ae2755b2cb100c Mon Sep 17 00:00:00 2001 From: ER Date: Tue, 29 Aug 2023 19:48:40 +0300 Subject: [PATCH] chore: back to array syntax in rpm-ostree --- modules/rpm-ostree/rpm-ostree.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/modules/rpm-ostree/rpm-ostree.sh b/modules/rpm-ostree/rpm-ostree.sh index 469f8b8..00fc91a 100644 --- a/modules/rpm-ostree/rpm-ostree.sh +++ b/modules/rpm-ostree/rpm-ostree.sh @@ -15,21 +15,18 @@ fi get_yaml_array INSTALL '.install[]' "$1" get_yaml_array REMOVE '.remove[]' "$1" -INSTALL_STR=$(echo "${INSTALL[*]}" | tr -d '\n') -REMOVE_STR=$(echo "${REMOVE[*]}" | tr -d '\n') - if [[ ${#INSTALL[@]} -gt 0 && ${#REMOVE[@]} -gt 0 ]]; then echo "Installing & Removing RPMs" - echo "Installing: ${INSTALL_STR[*]}" - echo "Removing: ${REMOVE_STR[*]}" + echo "Installing: $(echo "${INSTALL[*]}" | tr -d '\n')" + echo "Removing: $(echo "${REMOVE[*]}" | tr -d '\n')" # Doing both actions in one command allows for replacing required packages with alternatives - rpm-ostree override remove ${REMOVE_STR[@]} $(printf -- "--install=%s " ${INSTALL_STR[@]}) + rpm-ostree override remove "${REMOVE[@]}" $(printf -- "--install=%s " ${INSTALL[@]}) elif [[ ${#INSTALL[@]} -gt 0 ]]; then echo "Installing RPMs" - echo "Installing: ${INSTALL_STR[*]}" - rpm-ostree install ${INSTALL_STR[@]} + echo "Installing: $(echo "${INSTALL[*]}" | tr -d '\n')" + rpm-ostree install "${INSTALL[@]}" elif [[ ${#INSTALL[@]} -gt 0 ]]; then echo "Removing RPMs" - echo "Removing: ${REMOVE_STR[*]}" - rpm-ostree override remove ${REMOVE_STR[@]} + echo "Removing: $(echo "${REMOVE[*]}" | tr -d '\n')" + rpm-ostree override remove "${REMOVE[@]}" fi \ No newline at end of file