summaryrefslogtreecommitdiff
path: root/gnu/packages.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-25 01:29:17 -0400
committerMaxim Cournoyer <maxim@guixotic.coop>2026-05-23 13:36:10 +0900
commit1cb710f1fba398c69f4bb4aed0f88ca0b56af56a (patch)
treec33a1beda884a4d113533f02b186d688fee1e568 /gnu/packages.scm
parentf98c00ab749e6b82e56a4a34d0789496451cbc59 (diff)
packages: Sanitize %load-path used in %patch-path.
Having the Guix root trailed by a slash in the GUILE_LOAD_PATH would previously cause %patch-path to not return an entry with the patches sub-directory, leading to errors such as: While executing meta-command: ERROR: 1. &formatted-message: format: "~a: patch not found\n" arguments: ("icecat-use-older-reveal-hidden-html.patch") * gnu/packages.scm (strip-trailing-slash): New procedure. (%patch-path): Use it to strip any trailing slash from the %load-path entries. Fixes: <https://issues.guix.gnu.org/43818>. Change-Id: I4e98860d3914c8731c8dc70d29441e794825ff76
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r--gnu/packages.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index d859feadf62..db6a6c21ae3 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -164,6 +164,12 @@ flags."
164 %default-package-module-path 164 %default-package-module-path
165 channels-scm)))) 165 channels-scm))))
166 166
167(define (strip-trailing-slash s)
168 ;; Strip the trailing slash of a string, if present.
169 (if (string-suffix? "/" s)
170 (string-drop-right s 1)
171 s))
172
167(define %patch-path 173(define %patch-path
168 ;; Define it after '%package-module-path' so that '%load-path' contains user 174 ;; Define it after '%package-module-path' so that '%load-path' contains user
169 ;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found. 175 ;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found.
@@ -172,7 +178,7 @@ flags."
172 (if (string=? directory %distro-root-directory) 178 (if (string=? directory %distro-root-directory)
173 (string-append directory "/gnu/packages/patches") 179 (string-append directory "/gnu/packages/patches")
174 directory)) 180 directory))
175 %load-path))) 181 (map strip-trailing-slash %load-path))))
176 182
177;; This procedure is used by Emacs-Guix up to 0.5.1.1, so keep it for now. 183;; This procedure is used by Emacs-Guix up to 0.5.1.1, so keep it for now.
178;; See <https://github.com/alezost/guix.el/issues/30>. 184;; See <https://github.com/alezost/guix.el/issues/30>.