mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
guix environment, build: Allow absolute file names with '--root'.
Reported by Chris Webber. * guix/scripts/build.scm (register-root): If ROOT is absolute, keep it as is. * guix/scripts/environment.scm (register-gc-root): Likewise. * tests/guix-environment.sh (expected): Add test.
This commit is contained in:
parent
67fee545cc
commit
840f38ba37
3 changed files with 15 additions and 6 deletions
|
@ -99,8 +99,10 @@ (define (find-url file)
|
|||
|
||||
(define (register-root store paths root)
|
||||
"Register ROOT as an indirect GC root for all of PATHS."
|
||||
(let* ((root (string-append (canonicalize-path (dirname root))
|
||||
"/" root)))
|
||||
(let* ((root (if (string-prefix? "/" root)
|
||||
root
|
||||
(string-append (canonicalize-path (dirname root))
|
||||
"/" root))))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(match paths
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
|
||||
;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -531,8 +531,10 @@ (define (assert-container-features)
|
|||
|
||||
(define (register-gc-root target root)
|
||||
"Make ROOT an indirect root to TARGET. This is procedure is idempotent."
|
||||
(let* ((root (string-append (canonicalize-path (dirname root))
|
||||
"/" root)))
|
||||
(let* ((root (if (string-prefix? "/" root)
|
||||
root
|
||||
(string-append (canonicalize-path (dirname root))
|
||||
"/" root))))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(symlink target root)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
|
@ -74,7 +74,12 @@ test `readlink "$gcroot"` = "$expected"
|
|||
guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \
|
||||
-- guile -c 1
|
||||
test `readlink "$gcroot"` = "$expected"
|
||||
rm "$gcroot"
|
||||
|
||||
# Same with an absolute file name.
|
||||
guix environment --bootstrap -r "$PWD/$gcroot" --ad-hoc guile-bootstrap \
|
||||
-- guile -c 1
|
||||
test `readlink "$gcroot"` = "$expected"
|
||||
|
||||
case "`uname -m`" in
|
||||
x86_64)
|
||||
|
|
Loading…
Reference in a new issue