environment: Improve error reporting for '-l'.

This fixes two problems:

  1. Load errors would print an ugly backtrace.
  2. When FILE was an absolute name, 'load' was passed an incorrect file
     name.

* guix/scripts/environment.scm (options/resolve-packages): Use 'load*' instead
  of 'load'.
This commit is contained in:
Ludovic Courtès 2015-06-30 23:31:24 +02:00
parent 417c39f132
commit d70389c423

View file

@ -200,7 +200,7 @@ (define (options/resolve-packages opts)
(package-outputs package))))) (package-outputs package)))))
(('load . file) (('load . file)
;; Add all the outputs of the package defined in FILE. ;; Add all the outputs of the package defined in FILE.
(let ((package (load (string-append (getcwd) "/" file)))) (let ((package (load* file (make-user-module '()))))
(map (lambda (output) (map (lambda (output)
`(package ,package ,output)) `(package ,package ,output))
(package-outputs package)))) (package-outputs package))))