guix-commits
[Top][All Lists]
Advanced

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

01/05: system: 'operating-system-with-provenance' uses the OS location i


From: guix-commits
Subject: 01/05: system: 'operating-system-with-provenance' uses the OS location info.
Date: Tue, 28 Jul 2020 18:22:54 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 12a3d7d6f747b2b3c456ba20727e1ac97f9a952f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Jul 28 22:36:20 2020 +0200

    system: 'operating-system-with-provenance' uses the OS location info.
    
    This allows 'guix deploy' to save the config file when it's available.
    
    * gnu/system.scm (operating-system-configuration-file): New procedure.
    (operating-system-with-provenance): 'config-file' defaults to the value
    returned by 'operating-system-configuration-file'.
---
 gnu/system.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index c8ef641..5dd2f7f 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -651,7 +651,20 @@ bookkeeping."
                                     gc-root-service-type roots)
                     (operating-system-user-services os)))))
 
-(define* (operating-system-with-provenance os #:optional config-file)
+(define (operating-system-configuration-file os)
+  "Return the configuration file of OS, based on its 'location' field, or #f
+if it could not be determined."
+  (let ((file (and=> (operating-system-location os)
+                     location-file)))
+    (and file
+         (or (and (string-prefix? "/" file) file)
+             (search-path %load-path file)))))
+
+(define* (operating-system-with-provenance os
+                                           #:optional
+                                           (config-file
+                                            
(operating-system-configuration-file
+                                             os)))
   "Return a variant of OS that stores its own provenance information,
 including CONFIG-FILE, if available.  This is achieved by adding an instance
 of PROVENANCE-SERVICE-TYPE to its services."



reply via email to

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