diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-01-31 21:33:08 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-02-01 08:59:13 +0100 |
commit | b8638f03471a0c45f441caef1acf2dad7c457661 (patch) | |
tree | 678b499b6cf6d1bc60174b3335d0623f18a62765 /guix/scripts | |
parent | 88ad6deda6dc25ac752074d402879594142a5a9f (diff) | |
download | gnu-guix-b8638f03471a0c45f441caef1acf2dad7c457661.tar gnu-guix-b8638f03471a0c45f441caef1acf2dad7c457661.tar.gz |
guix package: Support package transformation options.
* guix/scripts/package.scm (show-help): Call
'show-transformation-options-help'.
(%options): Append %TRANSFORMATION-OPTIONS.
(process-actions)[transform, transform-entry]: New procedures.
* doc/guix.texi (Invoking guix package): Mention package
transformations.
(Package Transformation Options): Mention 'guix package'.
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/package.scm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 02eb600c43..b93ffb0b6b 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -379,6 +379,8 @@ Install, remove, or upgrade packages in a single transaction.\n")) (newline) (show-build-options-help) (newline) + (show-transformation-options-help) + (newline) (display (_ " -h, --help display this help and exit")) (display (_ " @@ -511,7 +513,8 @@ kind of search path~%") result) #f))) - %standard-build-options)) + (append %transformation-options + %standard-build-options))) (define (options->upgrade-predicate opts) "Return a predicate based on the upgrade/do-not-upgrade regexps in OPTS @@ -789,6 +792,12 @@ processed, #f otherwise." (define bootstrap? (assoc-ref opts 'bootstrap?)) (define substitutes? (assoc-ref opts 'substitutes?)) (define profile (or (assoc-ref opts 'profile) %current-profile)) + (define transform (options->transformation opts)) + + (define (transform-entry entry) + (manifest-entry + (inherit entry) + (item (transform store (manifest-entry-item entry))))) ;; First, process roll-backs, generation removals, etc. (for-each (match-lambda @@ -803,8 +812,9 @@ processed, #f otherwise." (let* ((manifest (profile-manifest profile)) (install (options->installable opts manifest)) (remove (options->removable opts manifest)) - (transaction (manifest-transaction (install install) - (remove remove))) + (transaction (manifest-transaction + (install (map transform-entry install)) + (remove remove))) (new (manifest-perform-transaction manifest transaction))) (unless (and (null? install) (null? remove)) |