guix-devel
[Top][All Lists]
Advanced

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

Re: "move-phase-after"?


From: Danny Milosavljevic
Subject: Re: "move-phase-after"?
Date: Tue, 6 Sep 2016 15:06:20 +0200

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.



reply via email to

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