all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Deck Pickard <deck.r.pickard@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH] guix: scripts: Fix GUIX_BUILD_OPTIONS handling.
Date: Fri, 5 Dec 2014 01:53:51 +0100	[thread overview]
Message-ID: <CAJ41eewKNWaw8ufRS3N6CdrK7j=isv7LKhSh3J0oUVSv8DxBUA@mail.gmail.com> (raw)
In-Reply-To: <CAJ41eeyECrUPfEhS+9puU3y0iczEeCs8JgKB8RnTRofVNOW_4w@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 100 bytes --]

Perhaps, now it WILL twerk.

Drp,
-- 
(or ((,\ (x) `(,x x)) '(,\ (x) `(,x x))) (smth (that 'like)))

[-- Attachment #1.2: Type: text/html, Size: 149 bytes --]

[-- Attachment #2: 0001-guix-scripts-Fix-GUIX_BUILD_OPTIONS-handling.patch --]
[-- Type: application/octet-stream, Size: 4903 bytes --]

From 9c27d995e1a622de8457209d40031b392538e0f8 Mon Sep 17 00:00:00 2001
From: nebuli <nebu@kipple>
Date: Fri, 5 Dec 2014 01:28:12 +0100
Subject: [PATCH] guix: scripts: Fix GUIX_BUILD_OPTIONS handling.

Appending to "raw" args broke optional parameters in 'guix package -I'
and 'guix package -A', and possibly other places.  Therefore, switch to
parsing each set of options on its own and append resulting alists
together afterwards.

* guix/scripts/archive.scm (parse-options-from): Rename from
  (parse-options) and add explicit argument.  New form of (parse-options)
  using its old algorithm via -from function.
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
---
 guix/scripts/archive.scm     | 8 ++++++--
 guix/scripts/build.scm       | 8 ++++++--
 guix/scripts/environment.scm | 9 +++++++--
 guix/scripts/package.scm     | 8 ++++++--
 guix/scripts/system.scm      | 8 ++++++--
 5 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm
index 29a3ad1..781ffc5 100644
--- a/guix/scripts/archive.scm
+++ b/guix/scripts/archive.scm
@@ -293,8 +293,12 @@ the input port."
 (define (guix-archive . args)
   (define (parse-options)
     ;; Return the alist of option values.
-    (args-fold* (append args (environment-build-options))
-                %options
+    (append (parse-options-from args)
+            (parse-options-from (environment-build-options))))
+
+  (define (parse-options-from args)
+    ;; Actual parsing takes place here.
+    (args-fold* args %options
                 (lambda (opt name arg result)
                   (leave (_ "~A: unrecognized option~%") name))
                 (lambda (arg result)
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 76a743f..26e9f42 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -401,8 +401,12 @@ arguments with packages that use the specified source."
 (define (guix-build . args)
   (define (parse-options)
     ;; Return the alist of option values.
-    (args-fold* (append args (environment-build-options))
-                %options
+    (append (parse-options-from args)
+            (parse-options-from (environment-build-options))))
+
+  (define (parse-options-from args)
+    ;; Actual parsing takes place here.
+    (args-fold* args %options
                 (lambda (opt name arg result)
                   (leave (_ "~A: unrecognized option~%") name))
                 (lambda (arg result)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index a309dfa..c388b0c 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -213,8 +213,13 @@ packages."
 ;; Entry point.
 (define (guix-environment . args)
   (define (parse-options)
-    (args-fold* (append args (environment-build-options))
-                %options
+    ;; Return the alist of option values.
+    (append (parse-options-from args)
+            (parse-options-from (environment-build-options))))
+
+  (define (parse-options-from args)
+    ;; Actual parsing takes place here.
+    (args-fold* args %options
                 (lambda (opt name arg result)
                   (leave (_ "~A: unrecognized option~%") name))
                 (lambda (arg result)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 9ff4d17..21dc66c 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -668,8 +668,12 @@ removed from MANIFEST."
 (define (guix-package . args)
   (define (parse-options)
     ;; Return the alist of option values.
-    (args-fold* (append args (environment-build-options))
-                %options
+    (append (parse-options-from args)
+            (parse-options-from (environment-build-options))))
+
+  (define (parse-options-from args)
+    ;; Actual parsing takes place here.
+    (args-fold* args %options
                 (lambda (opt name arg result arg-handler)
                   (leave (_ "~A: unrecognized option~%") name))
                 (lambda (arg result arg-handler)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8e049a4..eb987e1 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -471,8 +471,12 @@ Build the operating system declared in FILE according to ACTION.\n"))
 (define (guix-system . args)
   (define (parse-options)
     ;; Return the alist of option values.
-    (args-fold* (append args (environment-build-options))
-                %options
+    (append (parse-options-from args)
+            (parse-options-from (environment-build-options))))
+
+  (define (parse-options-from args)
+    ;; Actual parsing takes place here.
+    (args-fold* args %options
                 (lambda (opt name arg result)
                   (leave (_ "~A: unrecognized option~%") name))
                 (lambda (arg result)
-- 
2.1.2


       reply	other threads:[~2014-12-05  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJ41eeyECrUPfEhS+9puU3y0iczEeCs8JgKB8RnTRofVNOW_4w@mail.gmail.com>
2014-12-05  0:53 ` Deck Pickard [this message]
2014-12-06 15:04   ` [PATCH] guix: scripts: Fix GUIX_BUILD_OPTIONS handling Ludovic Courtès
2015-02-20 20:47     ` Bugs in parsing build options Alex Kost
2015-02-24 22:45       ` Ludovic Courtès
2015-02-25 14:38         ` Alex Kost
2015-02-25 23:05           ` Ludovic Courtès
2015-02-26 21:08             ` Alex Kost
2015-05-30 16:26             ` Alex Kost
2015-05-31 19:32               ` Ludovic Courtès
2015-06-01  6:52                 ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ41eewKNWaw8ufRS3N6CdrK7j=isv7LKhSh3J0oUVSv8DxBUA@mail.gmail.com' \
    --to=deck.r.pickard@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.