From 2b699d4046b3c1da67332d02f584eb93a5b0de01 Mon Sep 17 00:00:00 2001 From: jochens Date: Fri, 13 Nov 2026 00:23:56 +0100 Subject: [PATCH] Z0 pacman-config-first: the pacman module declares its config file before its package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The apply stops at the first failure and the package fails while the config file is missing (A-26). Builds: design 42 zfs-owns-zfs §1, A-26 --- modules/pacman/cmd/pacman-tools/manifest_test.go | 12 ++++++++++++ modules/pacman/module.json | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/pacman/cmd/pacman-tools/manifest_test.go b/modules/pacman/cmd/pacman-tools/manifest_test.go index 6cf1df713..45cd3f68e 100644 --- a/modules/pacman/cmd/pacman-tools/manifest_test.go +++ b/modules/pacman/cmd/pacman-tools/manifest_test.go @@ -133,3 +133,15 @@ func TestTheReflectorPackageIsDeclaredBeforeTheFileItShips(t *testing.T) { t.Fatalf("a package's file and timer come after the package: %v", order) } } + +// TestThePackageManagersConfigIsDeclaredBeforeItsPackage holds design 42 zfs-owns-zfs §1 and A-26: the +// apply stops at the first failure, and the package fails while its config file is missing. +func TestThePackageManagersConfigIsDeclaredBeforeItsPackage(t *testing.T) { + order := map[string]int{} + for i, r := range manifest(t).Resources { + order[r["id"].(string)] = i + } + if order["config"] >= order["package"] { + t.Fatalf("the config file comes before the package: %v", order) + } +} diff --git a/modules/pacman/module.json b/modules/pacman/module.json index 307c79a4e..df46ec650 100644 --- a/modules/pacman/module.json +++ b/modules/pacman/module.json @@ -89,11 +89,6 @@ "pacman_config" ], "resources": [ - { - "id": "package", - "type": "package", - "package": "pacman" - }, { "id": "config", "type": "file", @@ -101,6 +96,11 @@ "mode": "0644", "template": "files/pacman.conf" }, + { + "id": "package", + "type": "package", + "package": "pacman" + }, { "id": "contrib", "type": "package",