From patchwork Sat Oct 28 14:08:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 55462 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 1348E27BBE2; Sat, 28 Oct 2023 15:10:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7604127BBE9 for ; Sat, 28 Oct 2023 15:09:59 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwk0L-0000kz-IW; Sat, 28 Oct 2023 10:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwk0J-0000kI-MF for guix-patches@gnu.org; Sat, 28 Oct 2023 10:09:31 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwk0J-0000LV-Dd; Sat, 28 Oct 2023 10:09:31 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qwk0o-0001gM-Ae; Sat, 28 Oct 2023 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66793] [PATCH 3/3] time-machine: Warn when no command is given. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 28 Oct 2023 14:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66793 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66793@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 66793-submit@debbugs.gnu.org id=B66793.16985021866422 (code B ref 66793); Sat, 28 Oct 2023 14:10:02 +0000 Received: (at 66793) by debbugs.gnu.org; 28 Oct 2023 14:09:46 +0000 Received: from localhost ([127.0.0.1]:39303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Y-0001fV-7D for submit@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwk0Q-0001en-2k for 66793@debbugs.gnu.org; Sat, 28 Oct 2023 10:09:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwjzo-0000Jx-QD; Sat, 28 Oct 2023 10:09:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=562Qx4GRpp6tFHumc69gjq/M8IM2P/MZH3fl/0Xj6u0=; b=i009dA+EStvaX4Y9WKzy 3qK8Cl5/VMgPCzr9b05xuNxdwddZwF6fPRWSif2QfF/7xSzyRMcXNrjSUPnC2CQy2C+16XSqs124j 1PIaodbz0M6xqaB6UGKez9RrTt/49t7hZDV+d6r3T+o5fkFC3jJluPGN/VLLbKS3l0QAgPR5ewUkW VHpDMIZ4fEq42ahQBqeARWJ+LBV6iKVTHx6hgzh3SEKXWtuudb56khqd50BhF3zIV6pp0Nx/cHZ4R gTnIecJfb1UuaYtj2V8xS+IstX3pZUox2NoFbqQvAkBOVg7xusyDvZzXqa13eL6R4G7T6J+N9UKSG U8TPFHv4t7CsqQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 28 Oct 2023 16:08:35 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/time-machine.scm (guix-time-machine): Emit a warning when COMMAND-LINE is false. Change-Id: I26e6b608915ecaf6d9372f9b03dc5ebd1b4c68f9 --- guix/scripts/time-machine.scm | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index bd64364fa2..2c30fe7cfd 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -179,21 +179,22 @@ (define-command (guix-time-machine . args) (ref (assoc-ref opts 'ref)) (substitutes? (assoc-ref opts 'substitutes?)) (authenticate? (assoc-ref opts 'authenticate-channels?))) - (when command-line - (let* ((directory - (with-store store - (with-status-verbosity (assoc-ref opts 'verbosity) - (with-build-handler (build-notifier #:use-substitutes? - substitutes? - #:verbosity - (assoc-ref opts 'verbosity) - #:dry-run? #f) - (set-build-options-from-command-line store opts) - (cached-channel-instance store channels - #:authenticate? authenticate? - #:reference-channels - %reference-channels - #:validate-channels - validate-guix-channel))))) - (executable (string-append directory "/bin/guix"))) - (apply execl (cons* executable executable command-line)))))))) + (if command-line + (let* ((directory + (with-store store + (with-status-verbosity (assoc-ref opts 'verbosity) + (with-build-handler (build-notifier #:use-substitutes? + substitutes? + #:verbosity + (assoc-ref opts 'verbosity) + #:dry-run? #f) + (set-build-options-from-command-line store opts) + (cached-channel-instance store channels + #:authenticate? authenticate? + #:reference-channels + %reference-channels + #:validate-channels + validate-guix-channel))))) + (executable (string-append directory "/bin/guix"))) + (apply execl (cons* executable executable command-line))) + (warning (G_ "no command specified; nothing to do~%")))))))