From 00b692013311f1893ec3ce1006e3b6f6661342e6 Mon Sep 17 00:00:00 2001 From: ER Date: Sun, 27 Aug 2023 17:08:25 +0300 Subject: [PATCH] fix: rm newlines from rpm-ostree cmds basically re-adds the e27eb25 changes which were later reverted in favor of the way packages.json apparently worked --- modules/rpm-ostree/rpm-ostree.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/rpm-ostree/rpm-ostree.sh b/modules/rpm-ostree/rpm-ostree.sh index 06346f1342..cae83f672c 100644 --- a/modules/rpm-ostree/rpm-ostree.sh +++ b/modules/rpm-ostree/rpm-ostree.sh @@ -15,18 +15,21 @@ 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[*]}" - echo "Removing: ${REMOVE[*]}" + echo "Installing: ${INSTALL_STR[*]}" + echo "Removing: ${REMOVE_STR[*]}" # Doing both actions in one command allows for replacing required packages with alternatives - rpm-ostree override remove "${REMOVE[@]}" $(printf -- "--install=%s " ${INSTALL[@]}) + rpm-ostree override remove "${REMOVE_STR[@]}" $(printf -- "--install=%s " ${INSTALL_STR[@]}) elif [[ ${#INSTALL[@]} -gt 0 ]]; then echo "Installing RPMs" - echo "Installing: ${INSTALL[*]}" - rpm-ostree install "${INSTALL[@]}" + echo "Installing: ${INSTALL_STR[*]}" + rpm-ostree install "${INSTALL_STR[@]}" elif [[ ${#INSTALL[@]} -gt 0 ]]; then echo "Removing RPMs" - echo "Removing: ${REMOVE[*]}" - rpm-ostree override remove "${REMOVE[@]}" + echo "Removing: ${REMOVE_STR[*]}" + rpm-ostree override remove "${REMOVE_STR[@]}" fi \ No newline at end of file