From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cNboFsxY1mQbOAEASxT56A (envelope-from ) for ; Fri, 11 Aug 2023 17:50:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6FHmFsxY1mRIiAAA9RJhRA (envelope-from ) for ; Fri, 11 Aug 2023 17:50:36 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 00B5F4D320 for ; Fri, 11 Aug 2023 17:50:36 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YZTLNGHD; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691769036; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RLstrc5fpnjJxoJLc4e+ggj5tIuvJNZjVTLO1EePrP8=; b=KIWT2Oag3W26ELWankzHOiHA7/a+GSf75CTtAixzlLcANj05neUzNgryrgnwGSEJATBPkO 1NewT92DnyRg1N0U+qNepkzw8ImgfmBvABtmubd3+VeJ/FANvjKn5CQABIEeU4lVNWruBl T5N/ZBDJmXQOv9oRLTDNhX/LfkOe47W2NLwY/7f+5PmXiolfKfKmgz/I44GT04wEcwPhPd EqOIqJkMBNDkoL7q62Dd9L2DDp7Q8Z8Rjl/TiuPuVSF7Zj/su8qKFBEsiB6zxleaqyHcf8 ofhkNsyDGmCUib/WQQ4wHoqZpDYJ9bj9Wkl5AgVzbFdsiI9nhEmH6jACfG6tMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691769036; a=rsa-sha256; cv=none; b=g5fr7dw0c3A/1hplP2Rk4QZ0XwVG5Yx3gMgRMZI6T2LBMfcfHXC4d5pSM0lu7R9MAxqa0E cGmK0Ifzf4x6bHiX+UXAABNGbtcMm977J0yF9vhT1TDNM1JnBs3VJhUxOuhIkSltyoU1OR PnS0XByu7+vFJPezbfly1vBXb+iSam64uLRQc54xjwcWZ5ebulJkr3RJ09Kxvbj/2sVJlC X7a5zRKFPubzX1YxnpSTl5DskegTm2rl2fdx9qPchcxETyXOO5ChwlDqDYhK/uAZX/5kw0 WAwHcW/Lpe/JqbmPzl0VYsVOW3YEOIZhAYTzHUrRXFRFeu6hGesY5XkLxh8Cqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YZTLNGHD; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUUAN-0006MU-0D; Fri, 11 Aug 2023 11:35:07 -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 1qUUAK-0006MH-JL for guix-patches@gnu.org; Fri, 11 Aug 2023 11:35:04 -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 1qUUAK-00031d-7S; Fri, 11 Aug 2023 11:35:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUUAH-0002ql-Qa; Fri, 11 Aug 2023 11:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65229] [PATCH 1/2] pull, time-machine: Add '-q' to ignore channel files. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: mail@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: Fri, 11 Aug 2023 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65229 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65229@debbugs.gnu.org Cc: maurice.bremond@inria.fr, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Simon Tournier , 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 65229-submit@debbugs.gnu.org id=B65229.169176809010927 (code B ref 65229); Fri, 11 Aug 2023 15:35:01 +0000 Received: (at 65229) by debbugs.gnu.org; 11 Aug 2023 15:34:50 +0000 Received: from localhost ([127.0.0.1]:47801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUUA5-0002q6-D1 for submit@debbugs.gnu.org; Fri, 11 Aug 2023 11:34:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUUA3-0002pq-OK for 65229@debbugs.gnu.org; Fri, 11 Aug 2023 11:34:48 -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 1qUU9y-0002oI-89; Fri, 11 Aug 2023 11:34:42 -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=RLstrc5fpnjJxoJLc4e+ggj5tIuvJNZjVTLO1EePrP8=; b=YZTLNGHDGIoPG3h3QZ/D Dgdk09hko3PLUaEA104tJGhwOavb6C7ghcAB7FcNrHtPozAsW58T5Ee1mq9tv7hmdcjWoxB6cvZ5k EHyScjmYDfr7bLxcC08UiisbkN9MQGMIgnBHkER2Yzy1r1uLoPep3wWo64AWjg9Ap5Td8IDwXyWyV mDNaqyNDOfHK1s9BvfOugzN2eMtdAulueHgnIaxn29tM89H98UpIuv3q1puK9ZHww3nD9qEThXnV2 BBywvvvTJTarpwUVZfInTXwKHuvPDPGqPRSqyVq9lIiy3uGzaERXR+PgA8TSKY5H+t0U2Zk2IaxV0 dm7oxI2UFxTRBQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 11 Aug 2023 17:34:18 +0200 Message-ID: <0ee5ee05ea81374342740f06915e9dadb1a92a63.1691767568.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 00B5F4D320 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -1.38 X-Spam-Score: -1.38 X-TUID: QN17cBsIxHcP From: Ludovic Courtès This also fixes . * guix/scripts/pull.scm (show-help, %options): Add '-q'. (channel-list): Honor it. * guix/scripts/time-machine.scm (show-help, %options): Add '-q'. * doc/guix.texi (Invoking guix pull, Invoking guix time-machine): Document it. Reported-by: Simon Tournier --- doc/guix.texi | 30 ++++++++++++++++++++++-------- guix/scripts/pull.scm | 14 ++++++++++++-- guix/scripts/time-machine.scm | 7 ++++++- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 409ca2ad62..ec36159de1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4801,9 +4801,11 @@ Invoking guix pull @item the @option{--channels} option; @item -the user's @file{~/.config/guix/channels.scm} file; +the user's @file{~/.config/guix/channels.scm} file, unless @option{-q} +is passed; @item -the system-wide @file{/etc/guix/channels.scm} file; +the system-wide @file{/etc/guix/channels.scm} file, unless @option{-q} +is passed; @item the built-in default channels specified in the @code{%default-channels} variable. @@ -4905,6 +4907,10 @@ Invoking guix pull evaluates to a list of channel objects. @xref{Channels}, for more information. +@item -q +Inhibit loading of the user and system channel files, +@file{~/.config/guix/channels.scm} and @file{/etc/guix/channels.scm}. + @cindex channel news @item --news @itemx -N @@ -5092,18 +5098,26 @@ Invoking guix time-machine Read the list of channels from @var{file}. @var{file} must contain Scheme code that evaluates to a list of channel objects. @xref{Channels} for more information. + +@item -q +Inhibit loading of the user and system channel files, +@file{~/.config/guix/channels.scm} and @file{/etc/guix/channels.scm}. @end table -As for @command{guix pull}, the absence of any options means that the -latest commit on the master branch will be used. The command +As for @command{guix pull}, in the absence of any options, +@command{time-machine} fetches the latest commits of the channels +specified in @file{~/.config/guix/channels.scm}, +@file{/etc/guix/channels.scm}, or the default channels; the @option{-q} +option lets you ignore these configuration files. The command: @example -guix time-machine -- build hello +guix time-machine -q -- build hello @end example -will thus build the package @code{hello} as defined in the master branch, -which is in general a newer revision of Guix than you have installed. -Time travel works in both directions! +will thus build the package @code{hello} as defined in the main branch +of Guix, without any additional channel, which is in general a newer +revision of Guix than you have installed. Time travel works in both +directions! Note that @command{guix time-machine} can trigger builds of channels and their dependencies, and these are controlled by the standard build diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index ecd264d3fa..f0d4ff36e6 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -84,6 +84,8 @@ (define (show-help) Download and deploy the latest version of Guix.\n")) (display (G_ " -C, --channels=FILE deploy the channels defined in FILE")) + (display (G_ " + -q inhibit loading of user and system 'channels.scm'")) (display (G_ " --url=URL download \"guix\" channel from the Git repository at URL")) (display (G_ " @@ -133,6 +135,9 @@ (define %options (cons* (option '(#\C "channels") #t #f (lambda (opt name arg result) (alist-cons 'channel-file arg result))) + (option '(#\q) #f #f + (lambda (opt name arg result) + (alist-cons 'ignore-channel-files? #t result))) (option '(#\l "list-generations") #f #t (lambda (opt name arg result) (cons `(query list-generations ,arg) @@ -735,6 +740,9 @@ (define (channel-list opts) (define file (assoc-ref opts 'channel-file)) + (define ignore-channel-files? + (assoc-ref opts 'ignore-channel-files?)) + (define default-file (string-append (config-directory) "/channels.scm")) @@ -750,9 +758,11 @@ (define (channel-list opts) (define channels (cond (file (load-channels file)) - ((file-exists? default-file) + ((and (not ignore-channel-files?) + (file-exists? default-file)) (load-channels default-file)) - ((file-exists? global-file) + ((and (not ignore-channel-files?) + (file-exists? global-file)) (load-channels global-file)) (else %default-channels))) diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index d7c71ef705..8afea6b35d 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Konrad Hinsen -;;; Copyright © 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2019, 2020, 2021, 2023 Ludovic Courtès ;;; Copyright © 2021 Simon Tournier ;;; ;;; This file is part of GNU Guix. @@ -51,6 +51,8 @@ (define (show-help) Execute COMMAND ARGS... in an older version of Guix.\n")) (display (G_ " -C, --channels=FILE deploy the channels defined in FILE")) + (display (G_ " + -q inhibit loading of user and system 'channels.scm'")) (display (G_ " --url=URL use the Git repository at URL")) (display (G_ " @@ -75,6 +77,9 @@ (define %options (cons* (option '(#\C "channels") #t #f (lambda (opt name arg result) (alist-cons 'channel-file arg result))) + (option '(#\q) #f #f + (lambda (opt name arg result) + (alist-cons 'ignore-channel-files? #t result))) (option '("url") #t #f (lambda (opt name arg result) (alist-cons 'repository-url arg -- 2.41.0