guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Fix custom build type parameter edition.


From: Mathieu Othacehe
Subject: branch master updated: Fix custom build type parameter edition.
Date: Thu, 29 Apr 2021 11:18:11 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new f7d77fc  Fix custom build type parameter edition.
f7d77fc is described below

commit f7d77fcd0a5d8883f0a8a99514e4797a146842fb
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Thu Apr 29 17:15:49 2021 +0200

    Fix custom build type parameter edition.
    
    * src/cuirass/http.scm (body->specification): Fix custom build type
    edition.
    * src/cuirass/templates.scm (specification-edit): Ditto.
    * src/static/js/cuirass.js: Ditto.
---
 src/cuirass/http.scm      | 11 +++++++++--
 src/cuirass/templates.scm |  8 +++++---
 src/static/js/cuirass.js  |  2 +-
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 73f3b06..c4e229c 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -397,8 +397,15 @@ into a specification record and return it."
                            (let ((param (assq-ref params 'param-input)))
                              (and param
                                   (not (string=? param ""))
-                                  (string-split
-                                   (uri-decode param) #\,)))))
+                                  (let ((param (string-split
+                                                (uri-decode param) #\,)))
+                                    (cond
+                                     ((eq? build 'custom)
+                                      (map
+                                       (cut with-input-from-string <> read)
+                                       param))
+                                     (else
+                                      param)))))))
          (channels (map (lambda (name url branch)
                           (channel
                            (name (string->symbol name))
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index c6962e3..567b8ee 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -561,9 +561,11 @@ the existing SPEC otherwise."
                                (hidden "true"))
                             ,(string-join
                               (map (lambda (param)
-                                     (if (symbol? param)
-                                         (symbol->string param)
-                                         param))
+                                     (cond
+                                      ((string? param)
+                                       param)
+                                      (else
+                                       (object->string param))))
                                    rest)
                               ","))))
                    (else ""))
diff --git a/src/static/js/cuirass.js b/src/static/js/cuirass.js
index 09ab199..67ea397 100644
--- a/src/static/js/cuirass.js
+++ b/src/static/js/cuirass.js
@@ -226,7 +226,7 @@ $(document).ready(function() {
             var param_select = $('.build-select');
             var param_select_cb = function(){
                 var val = param_select.val();
-                if (['packages', 'manifests'].indexOf(val) >= 0) {
+                if (['custom', 'packages', 'manifests'].indexOf(val) >= 0) {
                     input_choices.clearStore();
                     $('.param-input-row').show();
                 } else {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]