[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/11: pull: Work around Ubuntu's 'sudo'.
From: |
guix-commits |
Subject: |
10/11: pull: Work around Ubuntu's 'sudo'. |
Date: |
Wed, 18 Sep 2019 17:10:38 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ee25048e51dd45ad91a1ad4b0f25f4013843c52b
Author: Ludovic Courtès <address@hidden>
Date: Wed Sep 18 22:59:13 2019 +0200
pull: Work around Ubuntu's 'sudo'.
Partly fixes <https://bugs.gnu.org/36785>.
Reported by Julien Lepiller <address@hidden>.
* guix/scripts/pull.scm (ensure-default-profile): Do not call
'migrate-generations' when "SUDO_USER" is set.
---
guix/scripts/pull.scm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 54bbadd..4b03cea 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -293,8 +293,15 @@ true, display what would be built without actually
building it."
;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. Move
;; them to %PROFILE-DIRECTORY.
- (unless (string=? %profile-directory
- (dirname (canonicalize-profile %user-profile-directory)))
+ ;;
+ ;; XXX: Ubuntu's 'sudo' preserves $HOME by default, and thus the second
+ ;; condition below is always false when one runs "sudo guix pull". As a
+ ;; workaround, skip this code when $SUDO_USER is set. See
+ ;; <https://bugs.gnu.org/36785>.
+ (unless (or (getenv "SUDO_USER")
+ (string=? %profile-directory
+ (dirname
+ (canonicalize-profile %user-profile-directory))))
(migrate-generations %user-profile-directory %profile-directory))
;; Make sure ~/.config/guix/current points to /var/guix/profiles/….
- 04/11: gnu: Add python-jupyter-protocol., (continued)
- 04/11: gnu: Add python-jupyter-protocol., guix-commits, 2019/09/18
- 06/11: gnu: Add python-jupyter-kernel-test., guix-commits, 2019/09/18
- 01/11: guix package: "guix package -f FILE" ensures FILE returns a package., guix-commits, 2019/09/18
- 02/11: linux-container: 'eval/container' correctly passes -L and -C flags., guix-commits, 2019/09/18
- 05/11: gnu: Add python-jupyter-kernel-mgmt., guix-commits, 2019/09/18
- 08/11: doc: Mention the "repository name" for 'guix pack -f docker'., guix-commits, 2019/09/18
- 07/11: gnu: Add Xeus., guix-commits, 2019/09/18
- 03/11: gnu: nlohmann-json-cpp: Update to 3.7.0., guix-commits, 2019/09/18
- 09/11: import: pypi: Refresher recognizes pythonhosted.org source URLs., guix-commits, 2019/09/18
- 11/11: scripts: pull: Add options for generation management, guix-commits, 2019/09/18
- 10/11: pull: Work around Ubuntu's 'sudo'.,
guix-commits <=