From eab402f36928c8791be1f18e35c4405b0f99e214 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 05:29:39 +0000 Subject: [PATCH 1/2] Initial plan From 43dc36e4db1e2c043ccb97e2d32f21c2a281c82a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Aug 2026 05:40:13 +0000 Subject: [PATCH 2/2] fix: force clean-system to use OS podman path Co-authored-by: castrojo <1264109+castrojo@users.noreply.github.com> --- Justfile | 1 + .../usr/share/ublue-os/just/default.just | 8 ++--- tests/test_clean_system_podman_path.bats | 33 +++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 tests/test_clean_system_podman_path.bats diff --git a/Justfile b/Justfile index d70f5349..6b8885a9 100644 --- a/Justfile +++ b/Justfile @@ -17,6 +17,7 @@ test: bats tests/test_ujust.bats bats tests/test_ublue_fastfetch.bats bats tests/test_motd_integration.bats + bats tests/test_clean_system_podman_path.bats bats tests/test_ublue_image_info.bats bats tests/test_profile_d.bats bats tests/test_dynamic_wallpaper.bats diff --git a/system_files/shared/usr/share/ublue-os/just/default.just b/system_files/shared/usr/share/ublue-os/just/default.just index 2d2d9bd3..899cac43 100644 --- a/system_files/shared/usr/share/ublue-os/just/default.just +++ b/system_files/shared/usr/share/ublue-os/just/default.just @@ -30,12 +30,12 @@ clean-system: #!/usr/bin/bash if gum confirm "Prune all Podman images and volumes?"; then echo "Images that would be pruned:" - podman image ls --filter dangling=true --format "{{{{.Repository}}}}:{{{{.Tag}}}} {{{{.ID}}}}" 2>/dev/null | head -20 + /usr/bin/podman image ls --filter dangling=true --format "{{{{.Repository}}}}:{{{{.Tag}}}} {{{{.ID}}}}" 2>/dev/null | head -20 echo "Volumes that would be pruned:" - podman volume ls --filter dangling=true --quiet 2>/dev/null | head -20 + /usr/bin/podman volume ls --filter dangling=true --quiet 2>/dev/null | head -20 if gum confirm "Proceed with pruning Podman images and volumes?"; then - podman image prune -af - podman volume prune -f + /usr/bin/podman image prune -af + /usr/bin/podman volume prune -f fi fi diff --git a/tests/test_clean_system_podman_path.bats b/tests/test_clean_system_podman_path.bats new file mode 100644 index 00000000..2a9477e4 --- /dev/null +++ b/tests/test_clean_system_podman_path.bats @@ -0,0 +1,33 @@ +#!/usr/bin/env bats + +DEFAULT_JUST="${BATS_TEST_DIRNAME}/../system_files/shared/usr/share/ublue-os/just/default.just" + +_clean_system_recipe() { + awk ' + /^clean-system:/ { in_recipe=1; next } + in_recipe && $0 !~ /^ / && $0 !~ /^$/ { exit } + in_recipe && $0 ~ /^ / { print } + ' "${DEFAULT_JUST}" +} + +@test "clean-system: uses OS-managed Podman binary" { + local recipe + recipe="$(_clean_system_recipe)" + + run grep -Fq "/usr/bin/podman image ls" <<< "${recipe}" + [ "${status}" -eq 0 ] + run grep -Fq "/usr/bin/podman volume ls" <<< "${recipe}" + [ "${status}" -eq 0 ] + run grep -Fq "/usr/bin/podman image prune -af" <<< "${recipe}" + [ "${status}" -eq 0 ] + run grep -Fq "/usr/bin/podman volume prune -f" <<< "${recipe}" + [ "${status}" -eq 0 ] +} + +@test "clean-system: does not use unqualified podman" { + local recipe + recipe="$(_clean_system_recipe)" + + run grep -Eq '(^|[[:space:]])podman[[:space:]]' <<< "${recipe}" + [ "${status}" -ne 0 ] +}