From 7d32618756188a5cc8e1361a35a562e6400192f2 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Thu, 28 Aug 2025 19:12:51 +0300 Subject: [PATCH] Add list packages --- bin/list-packages | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/list-packages diff --git a/bin/list-packages b/bin/list-packages new file mode 100755 index 0000000..08270e0 --- /dev/null +++ b/bin/list-packages @@ -0,0 +1,19 @@ +#!/bin/bash + +# Get the directory of this script +SCRIPT_DIR=$(realpath "${BASH_SOURCE[0]%/*}") +BUILD_ROOT=$(realpath "$SCRIPT_DIR/..") + +ARCH_DIR="$BUILD_ROOT/x86_64" +DB_FILE="$ARCH_DIR/omarchy.db.tar.zst" + +if [[ ! -f "$DB_FILE" ]]; then + echo "Repository database not found" + exit 1 +fi + +# Extract package names and versions from database +tar -xOf "$DB_FILE" --wildcards "*/desc" 2>/dev/null | + awk '/%NAME%/{getline; name=$0} + /%VERSION%/{getline; print name "-" $0}' | + sort \ No newline at end of file