aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-05 20:12:01 +0200
committerDanilo M. <danix@danix.xyz>2026-07-05 20:12:01 +0200
commitbca9f594e12d0419b46f6364b8541817db986f39 (patch)
tree831fd66dc138e7f8bfee75dfab5bae2f17c44433 /tests
parenta45ec57c5565c974fccbb95c038c15dd60eaada6 (diff)
downloadmkhintfile-bca9f594e12d0419b46f6364b8541817db986f39.tar.gz
mkhintfile-bca9f594e12d0419b46f6364b8541817db986f39.zip
test: config file overrides PACKAGES_DIR
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mkhint_test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh
index 9b00547..630c140 100755
--- a/tests/mkhint_test.sh
+++ b/tests/mkhint_test.sh
@@ -1377,6 +1377,31 @@ EOF
run_mkhint -f curl < <(printf '\nY\n')
assert_contains "hintfile new pkg → build" "$SLACKREPO_LOG" '^build curl$'
+# ── T72: config file overrides PACKAGES_DIR ──────────────────────────────────
+echo ""
+echo "T72: ~/.config/mkhint/config overrides PACKAGES_DIR"
+rm -f "$SLACKREPO_LOG" "$MOCK_HINT"/*.hint "$MOCK_HINT"/*.bak 2>/dev/null
+rm -rf "$MOCK_PKGS" "$MOCK_BASE/altpkgs"
+mkdir -p "$MOCK_BASE/altpkgs/network/curl"
+: > "$MOCK_BASE/altpkgs/network/curl/curl-8.5.0-x86_64-1_danix.txz"
+cat > "$MOCK_BASE/config" << EOF
+PACKAGES_DIR="$MOCK_BASE/altpkgs"
+EOF
+cat > "$MOCK_BASE/new_ver.json" << 'EOF'
+{ "version": 2, "data": { "curl": { "version": "8.9.0" } } }
+EOF
+cat > "$MOCK_HINT/curl.hint" << 'EOF'
+VERSION="8.5.0"
+ARCH="x86_64"
+DOWNLOAD="https://curl.se/download/curl-8.5.0.tar.gz"
+MD5SUM="abc123def456abc123def456abc123de"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+EOF
+run_mkhint -C curl < <(printf 'Y\nY\n')
+assert_contains "override tree → update" "$SLACKREPO_LOG" '^update curl$'
+rm -f "$MOCK_BASE/config"
+
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
teardown