[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57031] [PATCH v3 1/2] ui: Make one-time hint API public.
From: |
( |
Subject: |
[bug#57031] [PATCH v3 1/2] ui: Make one-time hint API public. |
Date: |
Thu, 27 Oct 2022 20:42:42 +0100 |
* guix/scripts/shell.scm (hint-directory, hint-file, record-hint,
hint-given?): Move these...
* guix/ui.scm (hint-directory, hint-file, record-hint, hint-given?):
...here.
---
guix/scripts/shell.scm | 23 -----------------------
guix/ui.scm | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index a2836629ad..c66ff4e5c4 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -505,29 +505,6 @@ (define (validated-spec spec)
(exp
(pretty-print exp port)))))
-
-;;;
-;;; One-time hints.
-;;;
-
-(define (hint-directory)
- "Return the directory name where previously given hints are recorded."
- (string-append (cache-directory #:ensure? #f) "/hints"))
-
-(define (hint-file hint)
- "Return the name of the file that marks HINT as already printed."
- (string-append (hint-directory) "/" (symbol->string hint)))
-
-(define (record-hint hint)
- "Mark HINT as already given."
- (let ((file (hint-file hint)))
- (mkdir-p (dirname file))
- (close-fdes (open-fdes file (logior O_CREAT O_WRONLY)))))
-
-(define (hint-given? hint)
- "Return true if HINT was already given."
- (file-exists? (hint-file hint)))
-
(define-command (guix-shell . args)
(category development)
diff --git a/guix/ui.scm b/guix/ui.scm
index dad2b853ac..3512c761d2 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
+;;; Copyright © 2022 ( <paren@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -137,6 +138,11 @@ (define-module (guix ui)
switch-to-generation*
delete-generation*
+ hint-directory
+ hint-file
+ record-hint
+ hint-given?
+
%default-message-language
current-message-language
@@ -2057,6 +2063,29 @@ (define* (package-specification->name+version+output spec
(package-name->name+version name)))
(values name version sub-drv)))
+
+;;;
+;;; One-time hints.
+;;;
+
+(define (hint-directory)
+ "Return the directory name where previously given hints are recorded."
+ (string-append (cache-directory #:ensure? #f) "/hints"))
+
+(define (hint-file hint)
+ "Return the name of the file that marks HINT as already printed."
+ (string-append (hint-directory) "/" (symbol->string hint)))
+
+(define (record-hint hint)
+ "Mark HINT as already given."
+ (let ((file (hint-file hint)))
+ (mkdir-p (dirname file))
+ (close-fdes (open-fdes file (logior O_CREAT O_WRONLY)))))
+
+(define (hint-given? hint)
+ "Return true if HINT was already given."
+ (file-exists? (hint-file hint)))
+
;;;
;;; Command-line option processing.
base-commit: f928abac369f699f425ddee925d0d0c2dc0a635d
--
2.38.0
- [bug#57031] [PATCH v3 1/2] ui: Make one-time hint API public.,
( <=