From patchwork Sat Jul 20 05:05:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5a6L5paH5q2m?= X-Patchwork-Id: 14726 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8B25617251; Sat, 20 Jul 2019 06:06:06 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2A4031724F for ; Sat, 20 Jul 2019 06:06:06 +0100 (BST) Received: from localhost ([::1]:49674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hohZN-00055M-Ov for patchwork@mira.cbaines.net; Sat, 20 Jul 2019 01:06:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45291) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hohZL-00053C-F3 for guix-patches@gnu.org; Sat, 20 Jul 2019 01:06:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hohZK-0002Wt-8k for guix-patches@gnu.org; Sat, 20 Jul 2019 01:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hohZK-0002Wo-4N for guix-patches@gnu.org; Sat, 20 Jul 2019 01:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hohZJ-0001Y1-TP for guix-patches@gnu.org; Sat, 20 Jul 2019 01:06:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36738] [PATCH] guix deploy: Support '--no-grafts' and '--system' Resent-From: iyzsong@member.fsf.org (=?utf-8?b?5a6L5paH5q2m?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Jul 2019 05:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36738 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36738@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15635991425922 (code B ref -1); Sat, 20 Jul 2019 05:06:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jul 2019 05:05:42 +0000 Received: from localhost ([127.0.0.1]:56731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hohYz-0001XS-NJ for submit@debbugs.gnu.org; Sat, 20 Jul 2019 01:05:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:50276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hohYy-0001XK-4Q for submit@debbugs.gnu.org; Sat, 20 Jul 2019 01:05:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45181) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hohYx-0004zH-1q for guix-patches@gnu.org; Sat, 20 Jul 2019 01:05:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hohYv-0002Ml-Q6 for guix-patches@gnu.org; Sat, 20 Jul 2019 01:05:38 -0400 Received: from rezeros.cc ([2001:19f0:7001:2f3e:5400:ff:fe84:e55d]:52476) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hohYv-0002Kn-AH for guix-patches@gnu.org; Sat, 20 Jul 2019 01:05:37 -0400 Received: from localhost (2409:8a62:373:6d20:6cef:8816:1032:4c8f [IPv6:2409:8a62:373:6d20:6cef:8816:1032:4c8f]) by rezeros.cc (OpenSMTPD) with ESMTPSA id fcf632ec (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sat, 20 Jul 2019 05:05:33 +0000 (UTC) Received: from gift (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 3eda2175 for ; Sat, 20 Jul 2019 05:05:31 +0000 (UTC) From: iyzsong@member.fsf.org (=?utf-8?b?5a6L5paH5q2m?=) Date: Sat, 20 Jul 2019 13:05:31 +0800 Message-ID: <87a7d9l2hw.fsf@member.fsf.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, this patch handle the '--no-grafts' command line option: And '--system', so I can deploy a "i686-linux" from my "x86_64-linux": Or better we can add a 'system' field to the record, so we can deploy a list of machines with different 'system'. Currently a has 'system' as a field for the , so where to put this machine/arch 'system'... From 192f96a3fa4342765db919006c35cdeb1774b62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 20 Jul 2019 12:51:45 +0800 Subject: [PATCH 2/2] deploy: Handle the '--system' command line option. * guix/scripts/deploy.scm (show-help): Add help for '--system'. (%options): Add '-s' and '--system'. (guix-deploy): Parameterize %current-system. --- guix/scripts/deploy.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index 3acd32eaa7..52bba3f3bf 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -23,6 +23,7 @@ #:use-module (guix scripts build) #:use-module (guix store) #:use-module (guix ui) + #:use-module (guix utils) #:use-module (guix grafts) #:use-module (ice-9 format) #:use-module (srfi srfi-1) @@ -41,6 +42,8 @@ (define (show-help) (display (G_ "Usage: guix deploy [OPTION] FILE... Perform the deployment specified by FILE.\n")) + (display (G_ " + -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\"")) (show-build-options-help) (newline) (display (G_ " @@ -55,10 +58,14 @@ Perform the deployment specified by FILE.\n")) (lambda args (show-help) (exit 0))) + (option '(#\s "system") #t #f + (lambda (opt name arg result) + (alist-cons 'system arg + (alist-delete 'system result eq?)))) %standard-build-options)) (define %default-options - '((system . ,(%current-system)) + `((system . ,(%current-system)) (substitutes? . #t) (build-hook? . #t) (graft? . #t) @@ -81,6 +88,7 @@ Perform the deployment specified by FILE.\n")) (set-build-options-from-command-line store opts) (for-each (lambda (machine) (info (G_ "deploying to ~a...") (machine-display-name machine)) - (parameterize ((%graft? (assq-ref opts 'graft?))) + (parameterize ((%current-system (assq-ref opts 'system)) + (%graft? (assq-ref opts 'graft?))) (run-with-store store (deploy-machine machine)))) machines)))) -- 2.19.2