fix: newlines in rpm-ostree cmds errors

i'm not sure if this approach is better than iterating over the array
but it should now work in the same way it did previously
This commit is contained in:
ER
2023-08-26 17:10:08 +03:00
parent c2367e0d56
commit e27eb25b80

View File

@@ -15,13 +15,15 @@ fi
get_yaml_array INSTALL '.install[]' "$1" get_yaml_array INSTALL '.install[]' "$1"
if [[ ${#INSTALL[@]} -gt 0 ]]; then if [[ ${#INSTALL[@]} -gt 0 ]]; then
echo "Installing RPMs" echo "Installing RPMs"
echo "Installing: ${INSTALL[*]}" INSTALL_STR=$(echo "${INSTALL[*]}" | tr -d '\n')
rpm-ostree install "${INSTALL[@]}" echo "Installing: $INSTALL_STR"
rpm-ostree install "$INSTALL_STR"
fi fi
get_yaml_array REMOVE '.remove[]' "$1" get_yaml_array REMOVE '.remove[]' "$1"
if [[ ${#REMOVE[@]} -gt 0 ]]; then if [[ ${#REMOVE[@]} -gt 0 ]]; then
echo "Removing RPMs" echo "Removing RPMs"
echo "Removing: ${REMOVE[*]}" REMOVE_STR=$(echo "${REMOVE[*]}" | tr -d '\n')
rpm-ostree override remove "${REMOVE[@]}" echo "Removing: $REMOVE"
rpm-ostree override remove "$REMOVE_STR"
fi fi