guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#57031] [PATCH v2 1/2] ui: Make one-time hint API public.


From: (
Subject: [bug#57031] [PATCH v2 1/2] ui: Make one-time hint API public.
Date: Sun, 11 Sep 2022 20:59:40 +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 c115a00320..3ac7d80eb0 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -489,29 +489,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.
-- 
2.37.3






reply via email to

[Prev in Thread] Current Thread [Next in Thread]