aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/unrtf.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2023-11-15 15:54:41 +0100
committerRicardo Wurmus <rekado@elephly.net>2023-11-15 15:55:22 +0100
commitfd7c535d1b3264c131e3cbfcfa2089e618d397cc (patch)
treee0f9959f57b8985c8b209e77a0ad2a7ad50181bb /gnu/packages/unrtf.scm
parentbb0bc7990bd1f78d9b1317361dfa4d0ad0cbdb89 (diff)
downloadguix-fd7c535d1b3264c131e3cbfcfa2089e618d397cc.tar.gz
guix-fd7c535d1b3264c131e3cbfcfa2089e618d397cc.zip
gnu: r-matrixstats: Update to 1.1.0.
* gnu/packages/statistics.scm (r-matrixstats): Update to 1.1.0. Change-Id: I27f701d83b7dbfcc54fde2701890c69dbc5b9384
Diffstat (limited to 'gnu/packages/unrtf.scm')
0 files changed, 0 insertions, 0 deletions
rd. Finally if 'start is selected, the execution will resume at the first installer-step. The result of every COMPUTE procedures is stored in an association list, under the form: '((STEP-ID . COMPUTE-RESULT) ...) where STEP-ID is the ID field of the installer-step and COMPUTE-RESULT the result of the associated COMPUTE procedure. This result association list is passed as argument of every COMPUTE procedure. It is finally returned when the computation is over." (define (pop-result list) (cdr list)) (define (first-step? steps step) (match steps ((first-step . rest-steps) (equal? first-step step)))) (define* (skip-to-step step result #:key todo-steps done-steps) (match todo-steps ((todo . rest-todo) (let ((found? (eq? (installer-step-id todo) (installer-step-id step)))) (cond (found? (run result #:todo-steps todo-steps #:done-steps done-steps)) ((and (not found?) (null? done-steps)) (error (format #f "Step ~a not found" (installer-step-id step)))) (else (match done-steps ((prev-done ... last-done) (skip-to-step step (pop-result result) #:todo-steps (cons last-done todo-steps) #:done-steps prev-done))))))))) (define* (run result #:key todo-steps done-steps) (match todo-steps (() (reverse result)) ((step . rest-steps) (call-with-prompt 'installer-step (lambda () (installer-log-line "running step '~a'" (installer-step-id step)) (let* ((id (installer-step-id step)) (compute (installer-step-compute step)) (res (compute result done-steps))) (hash-set! %current-result id res) (run (alist-cons id res result) #:todo-steps rest-steps #:done-steps (append done-steps (list step))))) (lambda (k action) (match action ('abort (case rewind-strategy ((previous) (match done-steps (() ;; We cannot go previous the first step. Abort again to ;; 'installer-step prompt. It might be useful in the case ;; of nested run-installer-steps. (abort-to-prompt 'installer-step action)) ((prev-done ... last-done) (run (pop-result result) #:todo-steps (cons last-done todo-steps) #:done-steps prev-done)))) ((menu) (let ((goto-step (menu-proc (append done-steps (list step))))) (if (eq? goto-step step) (run result #:todo-steps todo-steps #:done-steps done-steps) (skip-to-step goto-step result #:todo-steps todo-steps #:done-steps done-steps)))) ((start) (if (null? done-steps) ;; Same as above, it makes no sense to jump to start ;; when we are at the first installer-step. Abort to ;; 'installer-step prompt again. (abort-to-prompt 'installer-step action) (run '() #:todo-steps steps #:done-steps '()))))) ('break (reverse result)))))))) ;; Ignore SIGPIPE so that we don't die if a client closes the connection ;; prematurely. (sigaction SIGPIPE SIG_IGN) (if dry-run? (run '() #:todo-steps steps #:done-steps '()) (with-server-socket (run '() #:todo-steps steps #:done-steps '())))) (define (find-step-by-id steps id) "Find and return the step in STEPS whose id is equal to ID." (find (lambda (step) (eq? (installer-step-id step) id)) steps)) (define (result-step results step-id) "Return the result of the installer-step specified by STEP-ID in RESULTS." (assoc-ref results step-id)) (define (result-step-done? results step-id) "Return #t if the installer-step specified by STEP-ID has a COMPUTE value stored in RESULTS. Return #f otherwise." (and (assoc step-id results) #t)) (define %installer-configuration-file (make-parameter "/mnt/etc/config.scm")) (define %installer-target-dir (make-parameter "/mnt")) (define (format-configuration steps results) "Return the list resulting from the application of the procedure defined in CONFIGURATION-FORMATTER field of <installer-step> on the associated result found in RESULTS." (let ((configuration (append-map (lambda (step) (let* ((step-id (installer-step-id step)) (conf-formatter (installer-step-configuration-formatter step)) (result-step (result-step results step-id))) (if (and result-step conf-formatter) (conf-formatter result-step) '()))) steps)) (modules `(,(vertical-space 1) ,(comment (G_ "\ ;; Indicate which modules to import to access the variables ;; used in this configuration.\n")) ,@(if (target-hurd?) '((use-modules (gnu) (gnu system hurd)) (use-package-modules hurd ssh)) '((use-modules (gnu)))) (use-service-modules cups desktop networking ssh xorg)))) `(,@modules ,(vertical-space 1) (operating-system ,@configuration)))) (define* (configuration->file configuration #:key (file-name (%installer-configuration-file))) "Write the given CONFIGURATION to FILE-NAME." (mkdir-p (dirname file-name)) (call-with-output-file file-name (lambda (port) ;; TRANSLATORS: This is a comment within a Scheme file. Each line must ;; start with ";; " (two semicolons and a space). Please keep line ;; length below 60 characters. (display (G_ "\ ;; This is an operating system configuration generated ;; by the graphical installer. ;; ;; Once installation is complete, you can learn and modify ;; this file to tweak the system configuration, and pass it ;; to the 'guix system reconfigure' command to effect your ;; changes.\n") port) (newline port) (pretty-print-with-comments/splice port configuration #:max-width 75 #:format-comment (lambda (c indent) ;; Localize C. (comment (G_ (comment->string c)) (comment-margin? c)))) (flush-output-port port)))) ;;; Local Variables: ;;; eval: (put 'with-server-socket 'scheme-indent-function 0) ;;; End: