From 3920ba9ab53fd75e5b54fdecdd330e0a80fcc0bb Mon Sep 17 00:00:00 2001 From: Arcitec <38923130+Arcitec@users.noreply.github.com> Date: Tue, 23 May 2023 20:27:18 +0200 Subject: [PATCH] fix: remove RPMs after installing RPMs, to guarantee cleanup This is necessary because the `rpm-ostree install` command lacks any way to exclude "recommended dependency" packages. It installs everything and the kitchen sink. Therefore, installing something will often pull in a bunch of unwanted dependencies. The best we can do with the current situation is to run the removal after the install, so that users can remove those unwanted components manually and can be sure that they're actually removed. --- scripts/build.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index f4a41c0..06e695c 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -51,15 +51,6 @@ run_scripts() { } run_scripts "pre" -# Remove RPMs. -get_yaml_array remove_rpms '.rpm.remove[]' -if [[ ${#remove_rpms[@]} -gt 0 ]]; then - echo "-- Removing RPMs defined in recipe.yml --" - echo "Removing: ${remove_rpms[@]}" - rpm-ostree override remove "${remove_rpms[@]}" - echo "---" -fi - # Install RPMs. get_yaml_array install_rpms '.rpm.install[]' if [[ ${#install_rpms[@]} -gt 0 ]]; then @@ -69,6 +60,15 @@ if [[ ${#install_rpms[@]} -gt 0 ]]; then echo "---" fi +# Remove RPMs. +get_yaml_array remove_rpms '.rpm.remove[]' +if [[ ${#remove_rpms[@]} -gt 0 ]]; then + echo "-- Removing RPMs defined in recipe.yml --" + echo "Removing: ${remove_rpms[@]}" + rpm-ostree override remove "${remove_rpms[@]}" + echo "---" +fi + # Toggle yafti, which provides the "first boot" experience, https://github.com/ublue-os/yafti. FIRSTBOOT_DATA="/usr/share/ublue-os/firstboot" FIRSTBOOT_LINK="/usr/etc/profile.d/ublue-firstboot.sh"