From: Danny Milosavljevic <dannym@scratchpost.org>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: "move-phase-after"?
Date: Tue, 6 Sep 2016 15:06:20 +0200 [thread overview]
Message-ID: <20160906150620.2b896bc9@scratchpost.org> (raw)
In-Reply-To: <20160906125449.29c60764@scratchpost.org>
Maybe something like this (has NOT been tested):
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 2988193..c2cf25d 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -517,6 +517,7 @@ following forms:
(replace <old-phase-name> <new-phase>)
(add-before <old-phase-name> <new-phase-name> <new-phase>)
(add-after <old-phase-name> <new-phase-name> <new-phase>)
+ (move-after <destination-phase-name> <source-phase-name>)
Where every <*-phase-name> is an automatically quoted symbol, and <new-phase>
an expression evaluating to a procedure."
@@ -526,7 +527,7 @@ an expression evaluating to a procedure."
phases*))
(define-syntax %modify-phases
- (syntax-rules (delete replace add-before add-after)
+ (syntax-rules (delete replace add-before add-after move-after)
((_ phases (delete old-phase-name))
(alist-delete old-phase-name phases))
((_ phases (replace old-phase-name new-phase))
@@ -534,7 +535,11 @@ an expression evaluating to a procedure."
((_ phases (add-before old-phase-name new-phase-name new-phase))
(alist-cons-before old-phase-name new-phase-name new-phase phases))
((_ phases (add-after old-phase-name new-phase-name new-phase))
- (alist-cons-after old-phase-name new-phase-name new-phase phases))))
+ (alist-cons-after old-phase-name new-phase-name new-phase phases))
+ ((_ phases (move-after a-phase-name source-phase-name))
+ (let ((source-phase (assoc-ref phases source-phase-name)))
+ (alist-cons-after a-phase-name source-phase-name source-phase
+ (alist-delete source-phase-name phases))))))
^L
;;;
I'm still not sure whether we should make something like this easy - it sounds hacky to move phases like this.
next prev parent reply other threads:[~2016-09-06 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 8:03 "move-phase-after"? Hartmut Goebel
2016-09-06 10:54 ` "move-phase-after"? Danny Milosavljevic
2016-09-06 13:06 ` Danny Milosavljevic [this message]
2016-09-07 12:20 ` "move-phase-after"? Ludovic Courtès
2016-09-08 8:11 ` "move-phase-after"? Hartmut Goebel
2016-09-06 17:11 ` "move-phase-after"? Efraim Flashner
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=20160906150620.2b896bc9@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
--cc=h.goebel@crazy-compilers.com \
/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.