Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
fix: rm newlines from rpm-ostree cmds
Browse files Browse the repository at this point in the history
basically re-adds the e27eb25 changes
which were later reverted
in favor of the way packages.json apparently worked
  • Loading branch information
xynydev committed Aug 27, 2023
1 parent 5ff623b commit 00b6920
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/rpm-ostree/rpm-ostree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 00b6920

Please sign in to comment.