profiles: 'user-friendly-profile' now recognizes ~/.config/guix/current.
* guix/profiles.scm (%known-shorthand-profiles): New variable. (user-friendly-profile): Use it.
This commit is contained in:
parent
8155a20907
commit
1c795c4fd2
|
@ -1665,13 +1665,20 @@ as if '-p' was omitted." ; see <http://bugs.gnu.org/17939>
|
||||||
profile)))
|
profile)))
|
||||||
(const profile))))
|
(const profile))))
|
||||||
|
|
||||||
|
(define %known-shorthand-profiles
|
||||||
|
;; Known shorthand forms for profiles that the user manipulates.
|
||||||
|
(list (string-append (config-directory #:ensure? #f) "/current")
|
||||||
|
%user-profile-directory))
|
||||||
|
|
||||||
(define (user-friendly-profile profile)
|
(define (user-friendly-profile profile)
|
||||||
"Return either ~/.guix-profile if that's what PROFILE refers to, directly or
|
"Return either ~/.guix-profile or ~/.config/guix/current if that's what
|
||||||
indirectly, or PROFILE."
|
PROFILE refers to, directly or indirectly, or PROFILE."
|
||||||
(if (and %user-profile-directory
|
(or (find (lambda (shorthand)
|
||||||
(false-if-exception
|
(and shorthand
|
||||||
(string=? (readlink %user-profile-directory) profile)))
|
(let ((target (false-if-exception
|
||||||
%user-profile-directory
|
(readlink shorthand))))
|
||||||
|
(and target (string=? target profile)))))
|
||||||
|
%known-shorthand-profiles)
|
||||||
profile))
|
profile))
|
||||||
|
|
||||||
;;; profiles.scm ends here
|
;;; profiles.scm ends here
|
||||||
|
|
Loading…
Reference in New Issue