From 2c5ee9bba4067fb0a9e68fb2af3a6e7fe36960cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 24 Jan 2019 19:18:10 +0100 Subject: [PATCH] tests: Remove duplicate field initializers. Fixes a regression introduced in c2dcff41c2e47f5f978f467864d5ed7829939884, whereby many tests in 'tests/packages.scm' would trigger a syntax error due to duplicate field intializers in forms like: (dummy-package "foo" (version "0")) * guix/tests.scm (dummy-package, dummy-origin): Rewrite to inherit from a base record. This restores the semantics from before c2dcff41c2e47f5f978f467864d5ed7829939884. * tests/services.scm ("instantiate-missing-services, indirect"): Remove duplicate 'extensions' field. --- guix/tests.scm | 19 ++++++++++--------- tests/services.scm | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/guix/tests.scm b/guix/tests.scm index 16a426c4f9..749a4edd7a 100644 --- a/guix/tests.scm +++ b/guix/tests.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -334,18 +334,19 @@ (define-syntax with-derivation-substitute (define-syntax-rule (dummy-package name* extra-fields ...) "Return a \"dummy\" package called NAME*, with all its compulsory fields initialized with default values, and with EXTRA-FIELDS set as specified." - (package extra-fields ... - (name name*) (version "0") (source #f) - (build-system gnu-build-system) - (synopsis #f) (description #f) - (home-page #f) (license #f))) + (let ((p (package + (name name*) (version "0") (source #f) + (build-system gnu-build-system) + (synopsis #f) (description #f) + (home-page #f) (license #f)))) + (package (inherit p) extra-fields ...))) (define-syntax-rule (dummy-origin extra-fields ...) "Return a \"dummy\" origin, with all its compulsory fields initialized with default values, and with EXTRA-FIELDS set as specified." - (origin extra-fields ... - (method #f) (uri "http://www.example.com") - (sha256 (base32 (make-string 52 #\x))))) + (let ((o (origin (method #f) (uri "http://www.example.com") + (sha256 (base32 (make-string 52 #\x)))))) + (origin (inherit o) extra-fields ...))) ;; Local Variables: ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) diff --git a/tests/services.scm b/tests/services.scm index 5827dee80d..44ad0022c6 100644 --- a/tests/services.scm +++ b/tests/services.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -143,7 +143,7 @@ (define live-service (default-value 'dflt) (compose concatenate) (extend cons))) - (t2 (service-type (name 't2) (extensions '()) + (t2 (service-type (name 't2) (default-value 'dflt2) (compose concatenate) (extend cons)