From 5bc19300ee82093f9e20760dc5e305e12df12dd0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 17 Nov 2020 09:18:04 +0100 Subject: gnu: guix: Fix typo in comment. * gnu/packages/package-management.scm (guix): Fix typo in comment. --- gnu/packages/package-management.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 512f1950a3..7e6f98862d 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -338,7 +338,7 @@ (define code (("^#!.*/bash") (string-append "#! " bash "/bin/bash"))))) #t))) - ;; The 'guix' executable has 'OUT/libexec/guix/guile' has + ;; The 'guix' executable has 'OUT/libexec/guix/guile' as ;; its shebang; that should remain unchanged, thus remove ;; the 'patch-shebangs' phase, which would otherwise ;; change it to 'GUILE/bin/guile'. -- cgit v1.2.3 From 37b98e8cca3244067071bc6e382b06861457a459 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 18 Nov 2020 10:58:58 +0100 Subject: services: shepherd: Map all the invalid store characters to dash. Fixes a regression introduced in 977eb5d023cfdf8e336f1896480eea9cef5c04e9 whereby file system services would now have a different name. * gnu/services/base.scm (file-system->shepherd-service-name): Revert changes introduced in 977eb5d023cfdf8e336f1896480eea9cef5c04e9. * gnu/services/shepherd.scm (%store-characters): New variable (shepherd-service-file-name): Map all the characters outside %STORE-CHARACTERS to #\-. --- gnu/services/base.scm | 15 ++------------- gnu/services/shepherd.scm | 13 +++++++++---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 55d8c91cb5..e1892f3e48 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -291,19 +291,8 @@ (define (root-file-system-service) (define (file-system->shepherd-service-name file-system) "Return the symbol that denotes the service mounting and unmounting FILE-SYSTEM." - (define valid-characters - ;; Valid store characters; see 'checkStoreName' in the daemon. - (string->char-set - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-._?=")) - - (define mount-point - (string-map (lambda (chr) - (if (char-set-contains? valid-characters chr) - chr - #\-)) - (file-system-mount-point file-system))) - - (symbol-append 'file-system- (string->symbol mount-point))) + (symbol-append 'file-system- + (string->symbol (file-system-mount-point file-system)))) (define (mapped-device->shepherd-service-name md) "Return the symbol that denotes the shepherd service of MD, a ." diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index e14ceca231..1faeb350df 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -224,16 +224,21 @@ (define (assert-satisfied-requirements service) (for-each assert-satisfied-requirements services)) +(define %store-characters + ;; Valid store characters; see 'checkStoreName' in the daemon. + (string->char-set + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-._?=")) + (define (shepherd-service-file-name service) "Return the file name where the initialization code for SERVICE is to be stored." (let ((provisions (string-join (map symbol->string (shepherd-service-provision service))))) (string-append "shepherd-" - (string-map (match-lambda - (#\/ #\-) - (#\ #\-) - (chr chr)) + (string-map (lambda (chr) + (if (char-set-contains? %store-characters chr) + chr + #\-)) provisions) ".scm"))) -- cgit v1.2.3 From e385e5fc3c6839ad3d700b50f908df8f6b9f3ad8 Mon Sep 17 00:00:00 2001 From: Christopher Lemmer Webber Date: Mon, 16 Nov 2020 13:04:38 -0500 Subject: .dir-locals.el: Prevent errors if .dir-locals.el isn't found. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While this repo should presumably always have a .dir-locals.el by the nature of this file itself, it seems that this behavior "leaks". See added comment for more details on the fix to this strange bug, which is likely an upstream emacs or vc-mode issue. Thanks to Miguel Ángel Arruga Vivas and Maxim Cournoyer for helping investigate this problem. * .dir-locals.el: Don't error out if .dir-locals.el isn't found. --- .dir-locals.el | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index b1cb936a55..4599f06546 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -17,17 +17,27 @@ ;; Geiser ;; This allows automatically setting the `geiser-guile-load-path' ;; variable when using various Guix checkouts (e.g., via git worktrees). - (eval . (let* ((root-dir (expand-file-name - (locate-dominating-file - default-directory ".dir-locals.el"))) - ;; Workaround for bug https://issues.guix.gnu.org/43818. - (root-dir* (directory-file-name root-dir))) - (unless (boundp 'geiser-guile-load-path) - (defvar geiser-guile-load-path '())) - (make-local-variable 'geiser-guile-load-path) - (require 'cl-lib) - (cl-pushnew root-dir* geiser-guile-load-path - :test #'string-equal))))) + (eval . (let ((root-dir-unexpanded (locate-dominating-file + default-directory ".dir-locals.el"))) + ;; While Guix should in theory always have a .dir-locals.el + ;; (we are reading this file, after all) there seems to be a + ;; strange problem where this code "escapes" to some other buffers, + ;; at least vc-mode. See: + ;; https://lists.gnu.org/archive/html/guix-devel/2020-11/msg00296.html + ;; (TODO: add/replace with upstream emacs bug link when reported) + ;; Hence the following "when", which might otherwise be unnecessary; + ;; it prevents causing an error when root-dir-unexpanded is nil. + (when root-dir-unexpanded + (let* ((root-dir (expand-file-name root-dir-unexpanded)) + ;; Workaround for bug https://issues.guix.gnu.org/43818. + (root-dir* (directory-file-name root-dir))) + + (unless (boundp 'geiser-guile-load-path) + (defvar geiser-guile-load-path '())) + (make-local-variable 'geiser-guile-load-path) + (require 'cl-lib) + (cl-pushnew root-dir* geiser-guile-load-path + :test #'string-equal))))))) (c-mode . ((c-file-style . "gnu"))) (scheme-mode -- cgit v1.2.3 From 28aef467ee78439de8361be9ce418f7aed593aa7 Mon Sep 17 00:00:00 2001 From: Christopher Lemmer Webber Date: Mon, 16 Nov 2020 13:06:27 -0500 Subject: .dir-locals.el: Use setq-local on guix-directory. * .dir-locals.el: Use setq-local on guix-directory. While a problem with using setq hasn't been identified, this seems like good hygiene. --- .dir-locals.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 4599f06546..c95ca9e5ed 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -11,8 +11,9 @@ . "") ;; Emacs-Guix - (eval . (setq guix-directory - (locate-dominating-file default-directory ".dir-locals.el"))) + (eval . (setq-local guix-directory + (locate-dominating-file default-directory + ".dir-locals.el"))) ;; Geiser ;; This allows automatically setting the `geiser-guile-load-path' -- cgit v1.2.3 From 7a04d80921fd1a4784517a734ed0c92cb60f1828 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Arruga Vivas Date: Mon, 16 Nov 2020 21:36:45 +0100 Subject: .dir-locals.el: Add upstream report link. Follow up from 1d6e7732b163c9e945c9e5b32c726fe3b5f09c3a. * .dir-locals.el: Modify comment to point at the report to bug-gnu-emacs. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index c95ca9e5ed..4eb27d8b1b 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -25,7 +25,7 @@ ;; strange problem where this code "escapes" to some other buffers, ;; at least vc-mode. See: ;; https://lists.gnu.org/archive/html/guix-devel/2020-11/msg00296.html - ;; (TODO: add/replace with upstream emacs bug link when reported) + ;; Upstream report: ;; Hence the following "when", which might otherwise be unnecessary; ;; it prevents causing an error when root-dir-unexpanded is nil. (when root-dir-unexpanded -- cgit v1.2.3 From 207c3c594e22b678ddcea8ebc78f19b839612187 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Sun, 15 Nov 2020 08:38:14 -0800 Subject: guix-install.sh: don't throw away release candidates when picking the latest version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * etc/guix-install.sh (guix_get_bin_list): modify regexes to allow rcN syntax Signed-off-by: Ludovic Courtès --- etc/guix-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7f0dd00e53..f0a1550a74 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -6,6 +6,7 @@ # Copyright © 2019, 2020 Tobias Geerinckx-Rice # Copyright © 2020 Morgan Smith # Copyright © 2020 Simon Tournier +# Copyright © 2020 Daniel Brooks # # This file is part of GNU Guix. # @@ -60,6 +61,7 @@ INF="[ INFO ] " DEBUG=0 GNU_URL="https://ftp.gnu.org/gnu/guix/" +#GNU_URL="https://alpha.gnu.org/gnu/guix/" OPENPGP_SIGNING_KEY_ID="3CE464558A84FDC69DB40CFB090B11993D9AEBB5" # This script needs to know where root's home directory is. However, we @@ -228,11 +230,11 @@ guix_get_bin_list() # Filter only version and architecture bin_ver_ls=("$(wget -qO- "$gnu_url" \ - | sed -n -e 's/.*guix-binary-\([0-9.]*\)\..*.tar.xz.*/\1/p' \ + | sed -n -e 's/.*guix-binary-\([0-9.]*[a-z0-9]*\)\..*.tar.xz.*/\1/p' \ | sort -Vu)") latest_ver="$(echo "$bin_ver_ls" \ - | grep -oE "([0-9]{1,2}\.){2}[0-9]{1,2}" \ + | grep -oE "([0-9]{1,2}\.){2}[0-9]{1,2}[a-z0-9]*" \ | tail -n1)" default_ver="guix-binary-${latest_ver}.${ARCH_OS}" -- cgit v1.2.3