From e95eefe66621201cb546166294ed9696339d8407 Mon Sep 17 00:00:00 2001 From: jutty Date: Sun, 14 Jul 2024 07:16:02 -0300 Subject: [PATCH] Fix trailing whitespace preventing package match --- CHANGELOG | 2 ++ src/package/package_tracking.sh | 5 ++++- tori | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9e9ba63..9c917a9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +0.4.1 2024-07-14: Fixes "Cancel" option not exiting on package resolution + Fixes whitespace preventing package list matches on "remove all" 0.4.0 2024-07-14: "Add/remove all from configuration" resolution strategy 0.3.1 2024-07-13: Refactor, new docs page, make cache refresh lazier 0.3.0 2024-07-11: "Enter packages to install/uninstall" resolution strategy diff --git a/src/package/package_tracking.sh b/src/package/package_tracking.sh index f011270..f8eeb06 100644 --- a/src/package/package_tracking.sh +++ b/src/package/package_tracking.sh @@ -9,7 +9,10 @@ track_packages() { untrack_packages() { local packages="$1" + log debug "[untrack_packages] Removing packages: $packages" + echo "$packages" | xargs | sed 's/ /\n/g' | while read -r package; do - sed -i '' "/^$package$/d" "$CONFIG_ROOT/packages" + sed -i '' "/^[[:space:]]*$package[[:space:]]*$/d" "$CONFIG_ROOT/packages" + log debug "[untrack_packages] Executed removal for $package with exit code $?" done } diff --git a/tori b/tori index 05b7417..261c82b 100755 --- a/tori +++ b/tori @@ -2,7 +2,7 @@ main() { # paths - VERSION="0.4.0 2024-07-14" + VERSION="0.4.1 2024-07-14" TORI_ROOT="$HOME/.local/share/tori" CONFIG_ROOT="$HOME/.config/tori" TMP_DIR="/tmp/tori"