summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-06-19 17:38:47 +0200
committerMarius Bakke <marius@gnu.org>2021-06-19 17:38:47 +0200
commit6f9a80b331ae41d142a49fbeb94b90ee587b6155 (patch)
tree2da042a6ccf5368c73d6e3d54c2ee02a62d284e4 /guix/scripts
parent6500c9a5b364616e38a7e03aa4516fc2d7cee876 (diff)
parentdece03e2b98fc1c2428c2448ce5792f813eb79bf (diff)
Merge branch 'master' into core-updates
Note: this merge actually changes the 'curl' and 'python-attrs' derivations, as part of solving caf4a7a2770ef4d05a6e18f40d602e51da749ddc and 12964df69a99de6190422c752fef65ef813f3b6b respectively. 4604d43c0e (gnu: gnutls@3.6.16: Fix cross-compilation.) was ignored because it cannot currently be tested. Conflicts: gnu/local.mk gnu/packages/aidc.scm gnu/packages/boost.scm gnu/packages/curl.scm gnu/packages/nettle.scm gnu/packages/networking.scm gnu/packages/python-xyz.scm gnu/packages/tls.scm
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/environment.scm51
-rw-r--r--guix/scripts/pack.scm2
-rw-r--r--guix/scripts/package.scm5
-rwxr-xr-xguix/scripts/substitute.scm3
4 files changed, 15 insertions, 46 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 5ceb86f7a9..6958bd6238 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -52,50 +52,9 @@
#:export (assert-container-features
guix-environment))
-;; Protect some env vars from purification. Borrowed from nix-shell.
-(define %precious-variables
- '("HOME" "USER" "LOGNAME" "DISPLAY" "TERM" "TZ" "PAGER"))
-
(define %default-shell
(or (getenv "SHELL") "/bin/sh"))
-(define (purify-environment white-list)
- "Unset all environment variables except those that match the regexps in
-WHITE-LIST and those listed in %PRECIOUS-VARIABLES. A small number of
-variables such as 'HOME' and 'USER' are left untouched."
- (for-each unsetenv
- (remove (lambda (variable)
- (or (member variable %precious-variables)
- (find (cut regexp-exec <> variable)
- white-list)))
- (match (get-environment-variables)
- (((names . _) ...)
- names)))))
-
-(define* (create-environment profile manifest
- #:key pure? (white-list '()))
- "Set the environment variables specified by MANIFEST for PROFILE. When
-PURE? is #t, unset the variables in the current environment except those that
-match the regexps in WHITE-LIST. Otherwise, augment existing environment
-variables with additional search paths."
- (when pure?
- (purify-environment white-list))
- (for-each (match-lambda
- ((($ <search-path-specification> variable _ separator) . value)
- (let ((current (getenv variable)))
- (setenv variable
- (if (and current (not pure?))
- (if separator
- (string-append value separator current)
- value)
- value)))))
- (profile-search-paths profile manifest))
-
- ;; Give users a way to know that they're in 'guix environment', so they can
- ;; adjust 'PS1' accordingly, for instance. Set it to PROFILE so users can
- ;; conveniently access its contents.
- (setenv "GUIX_ENVIRONMENT" profile))
-
(define* (show-search-paths profile manifest #:key pure?)
"Display the search paths of MANIFEST applied to PROFILE. When PURE? is #t,
do not augment existing environment variables with additional search paths."
@@ -425,8 +384,14 @@ regexps in WHITE-LIST."
;; Properly handle SIGINT, so pressing C-c in an interactive terminal
;; application works.
(sigaction SIGINT SIG_DFL)
- (create-environment profile manifest
- #:pure? pure? #:white-list white-list)
+ (load-profile profile manifest
+ #:pure? pure? #:white-list-regexps white-list)
+
+ ;; Give users a way to know that they're in 'guix environment', so they can
+ ;; adjust 'PS1' accordingly, for instance. Set it to PROFILE so users can
+ ;; conveniently access its contents.
+ (setenv "GUIX_ENVIRONMENT" profile)
+
(match command
((program . args)
(apply execlp program program args))))
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index d12fbaff6a..4c7039cce9 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -619,7 +619,7 @@ the image."
#$profile
#:repository tag
#:database #+database
- #:system (or #$target (utsname:machine (uname)))
+ #:system (or #$target %host-type)
#:environment environment
#:entry-point
#$(and entry-point
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 6db83807af..694959d326 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -1044,7 +1044,10 @@ processed, #f otherwise."
(warn-about-old-distro)
- (when (and (null? files) (manifest-transaction-null? trans))
+ (when (and (null? files) (manifest-transaction-null? trans)
+ (not (any (match-lambda
+ ((key . _) (assoc-ref %actions key)))
+ opts)))
;; We can reach this point because the user did not specify any action
;; (as in "guix package"), did not specify any package (as in "guix
;; install"), or because there's nothing to upgrade (as when running
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 44448ff3e9..3ea1c73e10 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -643,7 +643,8 @@ found."
(#f
;; This can only happen when this script is not invoked by the
;; daemon.
- '("http://ci.guix.gnu.org"))))
+ '("http://ci.guix.gnu.org"
+ "http://bordeaux.guix.gnu.org"))))
;; In order to prevent using large number of discovered local substitute
;; servers, limit the local substitute urls list size.