From 0f3d2504f75595a2db2a2344b624ced2ba307448 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 3 Feb 2013 23:24:25 +0100 Subject: store: Add substitute-related procedures. * guix/store.scm (has-substitutes?, substitutable-paths, read-substitutable-path-list, substitutable-path-info): New procedures. (): New record type. (read-arg): Add `substitutable-path-info'. Change `hash' pattern variable to `base16' literal. * tests/store.scm ("no substitutes"): New test. --- tests/store.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/store.scm b/tests/store.scm index 1ff6aa05c2..c90fd3fed9 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Ludovic Courtès +;;; Copyright © 2012, 2013 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,8 @@ (define-module (test-store) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix base32) + #:use-module (guix packages) + #:use-module (guix derivations) #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -77,6 +79,17 @@ (define (random-text) (> freed 0) (not (file-exists? p)))))) +(test-assert "no substitutes" + (let* ((s (open-connection)) + (d1 (package-derivation s %bootstrap-guile (%current-system))) + (d2 (package-derivation s %bootstrap-glibc (%current-system))) + (o (map derivation-path->output-path (list d1 d2)))) + (set-build-options s #:use-substitutes? #f) + (and (not (has-substitutes? s d1)) + (not (has-substitutes? s d2)) + (null? (substitutable-paths s o)) + (null? (substitutable-path-info s o))))) + (test-end "store") -- cgit v1.2.3