mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-14 19:05:10 -05:00
pull: Work around Ubuntu's 'sudo'.
Partly fixes <https://bugs.gnu.org/36785>. Reported by Julien Lepiller <julien@lepiller.eu>. * guix/scripts/pull.scm (ensure-default-profile): Do not call 'migrate-generations' when "SUDO_USER" is set.
This commit is contained in:
parent
45fbc15a48
commit
ee25048e51
1 changed files with 9 additions and 2 deletions
|
@ -293,8 +293,15 @@ (define (ensure-default-profile)
|
|||
|
||||
;; 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/….
|
||||
|
|
Loading…
Reference in a new issue