[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/06: store: Add 'query-path-info*'.
From: |
Ludovic Courtès |
Subject: |
02/06: store: Add 'query-path-info*'. |
Date: |
Mon, 2 Jul 2018 18:39:20 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 0744a9f0029b2f78cc86b193214004b4501fa847
Author: Ludovic Courtès <address@hidden>
Date: Mon Jul 2 23:50:38 2018 +0200
store: Add 'query-path-info*'.
* guix/scripts/size.scm (query-path-info*): Move to...
* guix/store.scm (query-path-info*): ... here.
---
guix/scripts/size.scm | 11 +----------
guix/store.scm | 10 ++++++++++
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm
index b7b53e4..344be40 100644
--- a/guix/scripts/size.scm
+++ b/guix/scripts/size.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -53,15 +53,6 @@
(define substitutable-path-info*
(store-lift substitutable-path-info))
-(define (query-path-info* item)
- "Monadic version of 'query-path-info' that returns #f when ITEM is not in
-the store."
- (lambda (store)
- (guard (c ((nix-protocol-error? c)
- ;; ITEM is not in the store; return #f.
- (values #f store)))
- (values (query-path-info store item) store))))
-
(define (file-size item)
"Return the size in bytes of ITEM, resorting to information from substitutes
if ITEM is not in the store."
diff --git a/guix/store.scm b/guix/store.scm
index 3bf5657..bac42f2 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -107,6 +107,7 @@
references
references/substitutes
references*
+ query-path-info*
requisites
referrers
optimize-store
@@ -1398,6 +1399,15 @@ where FILE is the entry's absolute file name and STAT is
the result of
(define references*
(store-lift references))
+(define (query-path-info* item)
+ "Monadic version of 'query-path-info' that returns #f when ITEM is not in
+the store."
+ (lambda (store)
+ (guard (c ((nix-protocol-error? c)
+ ;; ITEM is not in the store; return #f.
+ (values #f store)))
+ (values (query-path-info store item) store))))
+
(define-inlinable (current-system)
;; Consult the %CURRENT-SYSTEM fluid at bind time. This is equivalent to
;; (lift0 %current-system %store-monad), but inlinable, thus avoiding
- branch master updated (c729901 -> 3dbf331), Ludovic Courtès, 2018/07/02
- 03/06: ui: Make 'check-available-space' public., Ludovic Courtès, 2018/07/02
- 05/06: deduplication: Fix incorrect use of 'throw'., Ludovic Courtès, 2018/07/02
- 01/06: packages: Optimize 'package-transitive-supported-systems'., Ludovic Courtès, 2018/07/02
- 02/06: store: Add 'query-path-info*'.,
Ludovic Courtès <=
- 04/06: guix system: init: Check the available space before copying., Ludovic Courtès, 2018/07/02
- 06/06: deduplication: Place link files under /gnu/store/.links., Ludovic Courtès, 2018/07/02