From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: "move-phase-after"? Date: Tue, 6 Sep 2016 15:06:20 +0200 Message-ID: <20160906150620.2b896bc9@scratchpost.org> References: <57CE7856.5040607@crazy-compilers.com> <20160906125449.29c60764@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhG5B-00036G-6p for guix-devel@gnu.org; Tue, 06 Sep 2016 09:06:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhG56-0000xJ-1A for guix-devel@gnu.org; Tue, 06 Sep 2016 09:06:32 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:52391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhG55-0000xF-Pj for guix-devel@gnu.org; Tue, 06 Sep 2016 09:06:27 -0400 In-Reply-To: <20160906125449.29c60764@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel 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 ) (add-before ) (add-after ) + (move-after ) Where every <*-phase-name> is an automatically quoted symbol, and 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.