From 4dadf12bb8613a610bfd1b6b044cd6b5b4ec8ed3 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 17 Mar 2023 15:06:19 -0300 Subject: Makefile: Streamline verification of generated config files --- Makefile | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 26893ea..6ec9c2e 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,14 @@ all: EuAndreh.key guix nix +test-config-files = \ + tests/internet/etc/postfix/main.cf \ + tests/internet/etc/dkimproxyout.conf \ + tests/internet/etc/dovecot.conf \ + +derived-assets = \ + $(test-config-files) \ + guix: guix-packages guix-services guix-packages: @@ -22,17 +30,29 @@ guix-packages: -f src/org/euandre/packages.scm \ -f src/org/euandre/queue.scm \ +local-files = \ + /etc/postfix/master.cf \ + /etc/postfix/main.cf \ + +internet-files = \ + $(local-files) \ + /etc/sasl2/smtpd.conf \ + /etc/dkimproxyout.conf \ + /etc/dovecot.conf \ + guix-services-local: rm -f result-local guix system -v3 -Lsrc/ -K -r result-local build tests/local/system.scm - cmp -s result-local/etc/postfix/master.cf tests/local/master.cf - cmp -s result-local/etc/postfix/main.cf tests/local/main.cf + for f in $(local-files); do \ + diff -U5 --color=always result-local$$f tests/local$$f; \ + done -guix-services-internet: tests/internet/main.cf +guix-services-internet: $(test-config-files) rm -f result-internet guix system -v3 -Lsrc/ -K -r result-internet build tests/internet/system.scm - cmp -s result-internet/etc/postfix/master.cf tests/internet/master.cf - cmp -s result-internet/etc/postfix/main.cf tests/internet/main.cf + for f in $(internet-files); do \ + diff -U5 --color=always result-internet$$f tests/internet$$f; \ + done guix-services: guix-services-local guix-services-internet @@ -47,7 +67,7 @@ check: clean: rm -rf \ - result* .paku/ deb/ tests/internet/main.cf + $(derived-assets) result* .paku/ deb/ public: -- cgit v1.2.3