[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19/87: home: environment-variables: Fix escaping.
From: |
guix-commits |
Subject: |
19/87: home: environment-variables: Fix escaping. |
Date: |
Mon, 9 Jan 2023 18:27:29 -0500 (EST) |
mbakke pushed a commit to branch staging
in repository guix.
commit 35ecbb418c03e3957ebab87af921742466fe2de9
Author: Andrew Tropin <andrew@trop.in>
AuthorDate: Mon Jan 9 12:22:56 2023 +0400
home: environment-variables: Fix escaping.
* gnu/home/services.scm (environment-variable-shell-definitions): Fix
escaping.
* tests/guix-home.sh: Add STRING_WITH_ESCAPES environment variable and test
its value.
Reported-by: elevnkb
---
gnu/home/services.scm | 2 +-
tests/guix-home.sh | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index c442da374c..b17a34d19d 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -192,7 +192,7 @@ ensures variable values are properly quoted."
(list->string (string-fold-right
(lambda (chr lst)
(if (memq chr quoted-chars)
- (append (list chr #\\) lst)
+ (append (list #\\ chr) lst)
(cons chr lst)))
'()
value))))
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 83ca6e72c8..3151f66683 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -84,8 +84,9 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf
"$test_directory"' EXIT
home-environment-variables-service-type
`(("TODAY" . "26 messidor")
("SHELL" . ,(file-append bash "/bin/bash"))
- ("BUILDHOSTTIME" . ,#~(strftime "%c"
- (localtime (current-time))))
+ ("BUILDHOST_TIME" . ,#~(strftime "%c"
+ (localtime (current-time))))
+ ("STRING_WITH_ESCAPES" . "chars: \" /\\")
("LITERAL" . ,(literal-string "${abc}"))))
(simple-service 'home-bash-service-extension-test
@@ -156,6 +157,8 @@ EOF
( . "${HOME}/.guix-home/setup-environment"; test "$TODAY" = "26 messidor" )
( . "${HOME}/.guix-home/setup-environment"; test "$LITERAL" = '${abc}' )
+ ( . "${HOME}/.guix-home/setup-environment";
+ test "$STRING_WITH_ESCAPES" = "chars: \" /\\")
( . "${HOME}/.guix-home/setup-environment";
echo "$SHELL" | grep "/gnu/store/.*/bin/bash" )
- 03/87: gnu: java-jgit-4.2: Do not build with icedtea-7., (continued)
- 03/87: gnu: java-jgit-4.2: Do not build with icedtea-7., guix-commits, 2023/01/09
- 02/87: gnu: Move Java bootstrap packages to separate module., guix-commits, 2023/01/09
- 06/87: gnu: java-cisd-args4j: Use later version of ECJ., guix-commits, 2023/01/09
- 07/87: gnu: java-cisd-args4j: Do not build with icedtea-7., guix-commits, 2023/01/09
- 09/87: gnu: java-ecj: Do not inherit from java-ecj-3., guix-commits, 2023/01/09
- 12/87: gnu: ant-apache-bcel: Fix inheritance by using gexp., guix-commits, 2023/01/09
- 13/87: gnu: ant-junit: Fix inheritance by using gexp., guix-commits, 2023/01/09
- 16/87: gnu: ikiwiki: Add missing inputs., guix-commits, 2023/01/09
- 17/87: gnu: ikiwiki: Remove input labels., guix-commits, 2023/01/09
- 18/87: home: environment-variables: Return support for file-likes and gexps., guix-commits, 2023/01/09
- 19/87: home: environment-variables: Fix escaping.,
guix-commits <=
- 20/87: gnu: Add r-gg3d., guix-commits, 2023/01/09
- 27/87: gnu: Add minetest-wielded-light., guix-commits, 2023/01/09
- 04/87: gnu: java-jgit-4.2: Remove trailing #T from build phase., guix-commits, 2023/01/09
- 05/87: gnu: java-cisd-args4j: Remove trailing #T from build phase., guix-commits, 2023/01/09
- 08/87: gnu: Remove java-ecj-3.5., guix-commits, 2023/01/09
- 10/87: gnu: java-cisd-jhdf5: Remove trailing #T., guix-commits, 2023/01/09
- 11/87: gnu: java-cisd-jhdf5: Do not override default JDK., guix-commits, 2023/01/09
- 14/87: gnu: Remove java-ecj-3., guix-commits, 2023/01/09
- 15/87: gnu: python-afdko: Fix failing tests., guix-commits, 2023/01/09
- 21/87: services: base: Add environment support to guix-configuration., guix-commits, 2023/01/09