From patchwork Mon Sep 2 15:33:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15264 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 E58351734D; Mon, 2 Sep 2019 16:38:58 +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,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable 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 8D24D17348 for ; Mon, 2 Sep 2019 16:38:58 +0100 (BST) Received: from localhost ([::1]:37696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oPy-0006Gf-2a for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:38:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42944) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMX-0002Ze-TI for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oMU-00057x-In for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:24 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oMU-00057f-Fi for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:22 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4oMS-0006gA-Dm for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:22 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 47/48] scripts: system: Add --target option. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Sep 2019 15:35:20 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36477@debbugs.gnu.org Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.156743849625387 (code B ref 36477); Mon, 02 Sep 2019 15:35:20 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:56 +0000 Received: from localhost ([127.0.0.1]:58837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oM4-0006bJ-3G for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLl-0006Xw-VF for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:38 -0400 Received: by mail-wr1-f68.google.com with SMTP id y8so14425556wrn.10 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rkzeyq0gaMbpHXJoKkrR7H0aWSZHsu3bNHhGLL2halc=; b=KXBnj7KG4wVRPBnrOtxQxGYYhMyGt/di3QIia1HIiQZV0tneWbDL1oJJPY7LjRm71u mziFjwvXEhoTX3iyZGCOaa1tr/LVlq4n63+lyokKmGNaEvi8UWpqiN09K9yRvOpn1rrt 9AXuYiXEnV1OolJqwV0SOG2/0vka+iLLo5rxHAPLPe90TA6gbdo9MfEGqcJi+0PuWOLw PvRdEDSz2l7t/olNW9k/NHBjf1gosHAJP7kCU2o5v7Q4GA2O0zy/91FSDrpgM4au6jx1 PFSV5En0r8Fcuf9mQ3wDWj74QPovq3m0Horhl0Ee3dxWRFVxjqNM3T/Nw7EK5FnGXCvO 7Ehg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rkzeyq0gaMbpHXJoKkrR7H0aWSZHsu3bNHhGLL2halc=; b=RCeDpwUnFf6mgGhbVvocO8+s9nHnvoHPQjdyjgSg2um9h8cdVFdYk80NVVPi6o1sWT 7xmeDpRhxpG27a0kRQFmK/E+9nmjV8UB3QAmzknBPi8xSbDwwgfTDjB8/Y4ya8C14IoW 2hD5zLYyb3dYiFzRlgLIioHME0wtW7rkfLoPsVddQBi+FO2IpuYj6kKlRLU3CkhStx5I 22v0uSBScJFp1b0ptf5thwFnApjKh++ISWsenB0vRNJxXWzVED2Wq8s/5sLDDgEa+SY0 BHX8+efa4OzM0CaL0fjTuQhUUqym0ZLtH2++QsI++2OevF/sPZxVU56QvEKpKScjSfP2 IvcA== X-Gm-Message-State: APjAAAW4p5d3HBZppOGKCQsE1LKTDKVLfddH3gqL+V2uUpg0Bmpipv8X waH2y2YwGWVWzuUOOdPAcxbQFHze X-Google-Smtp-Source: APXvYqz8gPbYH7caXzOzFpGUBEexfuDmWYeIOafN6/Je3lKGXFKdEklzTG+ESTtSJ2klvYEeDNTmqw== X-Received: by 2002:adf:fd03:: with SMTP id e3mr28393193wrr.291.1567438472252; Mon, 02 Sep 2019 08:34:32 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:34:31 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:32 +0200 Message-Id: <20190902153333.11190-48-m.othacehe@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 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: , Cc: Mathieu Othacehe Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/system.scm (%options): Add target option, (%default-options): ditto, (process-action): Rename existing target variable to target-file and pass new target variable to run-with-store procedure. --- guix/scripts/system.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 9fc3a10e98..f8040dd975 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2016 Alex Kost ;;; Copyright © 2016, 2017, 2018 Chris Marusich -;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2017, 2019 Mathieu Othacehe ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Christopher Baines ;;; @@ -929,6 +929,8 @@ Some ACTIONS support additional ARGS.\n")) --full-boot for 'vm', make a full boot sequence")) (display (G_ " --skip-checks skip file system and initrd module safety checks")) + (display (G_ " + --target=TRIPLET cross-build for TRIPLET--e.g., \"armel-linux-gnu\"")) (display (G_ " -v, --verbosity=LEVEL use the given verbosity LEVEL")) (newline) @@ -1002,6 +1004,10 @@ Some ACTIONS support additional ARGS.\n")) (lambda (opt name arg result) (alist-cons 'system arg (alist-delete 'system result eq?)))) + (option '("target") #t #f + (lambda (opt name arg result) + (alist-cons 'target arg + (alist-delete 'target result eq?)))) (option '(#\r "root") #t #f (lambda (opt name arg result) (alist-cons 'gc-root arg result))) @@ -1010,6 +1016,7 @@ Some ACTIONS support additional ARGS.\n")) (define %default-options ;; Alist of default option values. `((system . ,(%current-system)) + (target . #f) (substitutes? . #t) (build-hook? . #t) (print-build-trace? . #t) @@ -1043,6 +1050,7 @@ resulting from command-line parsing." ((x . _) x))) (expr (assoc-ref opts 'expression)) (system (assoc-ref opts 'system)) + (target (assoc-ref opts 'target)) (os (ensure-operating-system (or file expr) (cond @@ -1059,7 +1067,7 @@ resulting from command-line parsing." (dry? (assoc-ref opts 'dry-run?)) (bootloader? (assoc-ref opts 'install-bootloader?)) - (target (match args + (target-file (match args ((first second) second) (_ #f))) (bootloader-target @@ -1101,9 +1109,10 @@ resulting from command-line parsing." (_ #f)) opts) #:install-bootloader? bootloader? - #:target target + #:target target-file #:bootloader-target bootloader-target #:gc-root (assoc-ref opts 'gc-root))))) + #:target target #:system system)) (warn-about-disk-space)))