scripts: environment: Ignore user shell when spawning container.

* guix/scripts/environment.scm (%default-options): Remove 'exec'
  association.
  (guix-environment): If the user didn't specify a command, use the
  default shell, or use /bin/sh when a container is requested.
This commit is contained in:
David Thompson 2015-11-01 18:34:53 -05:00
parent 69b96e5eee
commit 7241c2fae6
1 changed files with 9 additions and 3 deletions

View File

@ -160,8 +160,7 @@ COMMAND or an interactive shell in that environment.\n"))
(define %default-options (define %default-options
;; Default to opening a new shell. ;; Default to opening a new shell.
`((exec . (,%default-shell)) `((system . ,(%current-system))
(system . ,(%current-system))
(substitutes? . #t) (substitutes? . #t)
(max-silent-time . 3600) (max-silent-time . 3600)
(verbosity . 0))) (verbosity . 0)))
@ -447,7 +446,14 @@ Otherwise, return the derivation for the Bash package."
(network? (assoc-ref opts 'network?)) (network? (assoc-ref opts 'network?))
(bootstrap? (assoc-ref opts 'bootstrap?)) (bootstrap? (assoc-ref opts 'bootstrap?))
(system (assoc-ref opts 'system)) (system (assoc-ref opts 'system))
(command (assoc-ref opts 'exec)) (command (or (assoc-ref opts 'exec)
;; Spawn a shell if the user didn't specify
;; anything in particular.
(if container?
;; The user's shell is likely not available
;; within the container.
'("/bin/sh")
(list %default-shell))))
(packages (options/resolve-packages opts)) (packages (options/resolve-packages opts))
(mappings (pick-all opts 'file-system-mapping)) (mappings (pick-all opts 'file-system-mapping))
(inputs (delete-duplicates (inputs (delete-duplicates