aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-14 22:32:23 -0500
committerCraig Jennings <c@cjennings.net>2026-06-14 22:32:23 -0500
commit8661faa4ce8f62dce05bd5aaf29948194a8c01d3 (patch)
treea2d9b1c12f9f33e69a0eafbfa63e92e8468a57fe /Makefile
parent9e426241e1632fe9d5c9ee6c7cb60d11c13ac1fa (diff)
downloadarchsetup-8661faa4ce8f62dce05bd5aaf29948194a8c01d3.tar.gz
archsetup-8661faa4ce8f62dce05bd5aaf29948194a8c01d3.zip
test(scripts): lock package-inventory behavior with characterization tests
package-inventory compares archsetup's declared packages against the live system but had no tests, so a future archsetup edit (a new for-loop shape, a renamed install helper) could silently break the extraction. I added two env seams so the script is testable without the real system. PKGINV_ARCHSETUP points the extractor at a fixture installer, PKGINV_PACMAN swaps in a fake pacman serving controlled query output. Both default to the real targets, so normal use is unchanged, and the seams match the env-override pattern audit-packages.sh already uses. The 7 tests pin the extraction (direct calls, for-loop lists, variable-arg skip) and both diff directions against the fixture, with no network or real pacman db. I also added a make package-diff target so the tool is reachable alongside the test targets.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 30a52d4..629c750 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
# (https://git.cjennings.net/dotfiles.git). Run them from there:
# cd ~/.dotfiles && make stow|restow|reset|unstow|import <de>
-.PHONY: help deps test-unit test test-keep test-vm-base
+.PHONY: help deps test-unit test test-keep test-vm-base package-diff
# Default target - show help
help:
@@ -17,6 +17,7 @@ help:
@echo " test Run full VM test suite (creates base VM if needed)"
@echo " test-keep Run test and keep VM running for manual testing"
@echo " test-vm-base Create base VM only (runs archangel)"
+ @echo " package-diff Compare archsetup's declared packages vs this system"
@echo ""
@echo "Dotfile stow operations now live in the dotfiles repo:"
@echo " cd ~/.dotfiles && make stow|restow|reset|unstow|import <de>"
@@ -64,3 +65,8 @@ test-keep:
bash scripts/testing/create-base-vm.sh; \
fi
@bash scripts/testing/run-test.sh --keep
+
+# Compare the packages archsetup declares against what's installed here.
+# Shows declared-but-missing and installed-but-undeclared (AUR vs official).
+package-diff:
+ @bash scripts/package-inventory