From b009575ddd4fc74618d2fda2356dcbfb367a9726 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Wed, 16 Sep 2026 09:06:20 -0400 Subject: [PATCH] fix some multi-package repo bugs --- dot_local/bin/executable_xxclean | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dot_local/bin/executable_xxclean b/dot_local/bin/executable_xxclean index d0810bc..26c2d1b 100644 --- a/dot_local/bin/executable_xxclean +++ b/dot_local/bin/executable_xxclean @@ -20,12 +20,11 @@ echo # Get unique package names (strip version info) for pkg in $(find "$binpkgs_dir" -maxdepth 1 -name '*.xbps' -type f -printf '%f\n' | sed 's/-[0-9].*//' | sort -u); do - # Find all versions of this package, sorted by modification time (newest first) + # Find all versions of this package, sorted by version (newest first) # Keep only the first (newest), remove the rest - find "$binpkgs_dir" -maxdepth 1 -name "${pkg}-*.xbps" -type f -printf '%T@ %p\n' | \ - sort -rn | \ + find "$binpkgs_dir" -maxdepth 1 -name "${pkg}-[0-9]*.xbps" -type f -printf '%p\n' | \ + sort -rV | \ tail -n +2 | \ - cut -d' ' -f2- | \ while read -r old_pkg; do echo "Removing: $(basename "$old_pkg")" rm -f "$old_pkg"