[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/09: guix package: Move 'process-actions' out of sight.
From: |
Ludovic Courtès |
Subject: |
07/09: guix package: Move 'process-actions' out of sight. |
Date: |
Mon, 30 Nov 2015 22:20:49 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 6e370175065732313c1badd10fc7e3d22de41bec
Author: Ludovic Courtès <address@hidden>
Date: Mon Nov 30 21:18:11 2015 +0200
guix package: Move 'process-actions' out of sight.
* guix/scripts/package.scm (process-actions): New procedure, moved
from...
(guix-package): ... here. Adjust accordingly.
---
guix/scripts/package.scm | 68 +++++++++++++++++++++++-----------------------
1 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 6cf0b02..5f65ed9 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -786,6 +786,39 @@ processed, #f otherwise."
(delete-generations . ,delete-generations-action)
(manifest . ,manifest-action)))
+(define (process-actions store opts)
+ "Process any install/remove/upgrade action from OPTS."
+
+ (define dry-run? (assoc-ref opts 'dry-run?))
+ (define bootstrap? (assoc-ref opts 'bootstrap?))
+ (define substitutes? (assoc-ref opts 'substitutes?))
+ (define profile (or (assoc-ref opts 'profile) %current-profile))
+
+ ;; First, process roll-backs, generation removals, etc.
+ (for-each (match-lambda
+ ((key . arg)
+ (and=> (assoc-ref %actions key)
+ (lambda (proc)
+ (proc store profile arg opts
+ #:dry-run? dry-run?)))))
+ opts)
+
+ ;; Then, process normal package installation/removal/upgrade.
+ (let* ((manifest (profile-manifest profile))
+ (install (options->installable opts manifest))
+ (remove (options->removable opts manifest))
+ (transaction (manifest-transaction (install install)
+ (remove remove)))
+ (new (manifest-perform-transaction manifest transaction)))
+
+ (unless (and (null? install) (null? remove))
+ (show-manifest-transaction store manifest transaction
+ #:dry-run? dry-run?)
+ (build-and-use-profile store profile new
+ #:bootstrap? bootstrap?
+ #:use-substitutes? substitutes?
+ #:dry-run? dry-run?))))
+
;;;
;;; Entry point.
@@ -798,39 +831,6 @@ processed, #f otherwise."
(arg-handler arg result)
(leave (_ "~A: extraneous argument~%") arg)))
- (define (process-actions opts)
- ;; Process any install/remove/upgrade action from OPTS.
-
- (define dry-run? (assoc-ref opts 'dry-run?))
- (define bootstrap? (assoc-ref opts 'bootstrap?))
- (define substitutes? (assoc-ref opts 'substitutes?))
- (define profile (or (assoc-ref opts 'profile) %current-profile))
-
- ;; First, process roll-backs, generation removals, etc.
- (for-each (match-lambda
- ((key . arg)
- (and=> (assoc-ref %actions key)
- (lambda (proc)
- (proc (%store) profile arg opts
- #:dry-run? dry-run?)))))
- opts)
-
- ;; Then, process normal package installation/removal/upgrade.
- (let* ((manifest (profile-manifest profile))
- (install (options->installable opts manifest))
- (remove (options->removable opts manifest))
- (transaction (manifest-transaction (install install)
- (remove remove)))
- (new (manifest-perform-transaction manifest transaction)))
-
- (unless (and (null? install) (null? remove))
- (show-manifest-transaction (%store) manifest transaction
- #:dry-run? dry-run?)
- (build-and-use-profile (%store) profile new
- #:bootstrap? bootstrap?
- #:use-substitutes? substitutes?
- #:dry-run? dry-run?))))
-
(let ((opts (parse-command-line args %options (list %default-options #f)
#:argument-handler handle-argument)))
(with-error-handling
@@ -844,4 +844,4 @@ processed, #f otherwise."
(if (assoc-ref opts 'bootstrap?)
%bootstrap-guile
(canonical-package guile-2.0)))))
- (process-actions opts)))))))
+ (process-actions (%store) opts)))))))
- branch master updated (ccd20fc -> 64ec0e2), Ludovic Courtès, 2015/11/30
- 01/09: guix package: Remove unnecessary use of (%store)., Ludovic Courtès, 2015/11/30
- 07/09: guix package: Move 'process-actions' out of sight.,
Ludovic Courtès <=
- 03/09: guix package: Move 'build-and-use-profile' out of sight., Ludovic Courtès, 2015/11/30
- 06/09: build: Fix detection of ARM systems., Ludovic Courtès, 2015/11/30
- 02/09: guix package: Move a couple of procedures out of sight., Ludovic Courtès, 2015/11/30
- 05/09: guix package: Formalize the list of actions., Ludovic Courtès, 2015/11/30
- 08/09: guix package: Refactor 'options->installable'., Ludovic Courtès, 2015/11/30
- 09/09: guix build: Modularize transformation handling., Ludovic Courtès, 2015/11/30
- 04/09: nls: Update 'de' translation., Ludovic Courtès, 2015/11/30