From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AGQFLQKREWdlWAAAe85BDQ:P1 (envelope-from ) for ; Thu, 17 Oct 2024 22:34:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id AGQFLQKREWdlWAAAe85BDQ (envelope-from ) for ; Fri, 18 Oct 2024 00:34:42 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=i+zFwZlO; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=XoktjJbO; 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=1729204482; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=AcsH/fdjYtEfZycmGJSFEAiDp/AI/uWeWbrOxp7imN4=; b=X3lUTrv6hHMPKBYOo+6w4R+QdG7I8RqvHZi50TbYE+CwbxVglRxr+hgPykyp2wIXYdzkM0 vG9fkU3+kwLfsFf2mBr/gNkZlHKjpsJdpBow/eRCvgXs6KbHcyUQFJqDlDpdkUEZYPqyJ7 ZwEc9yfDwCwVguGz3tDHwmxdRzGlmOUyIeu2b81pifS18p/IElD0Hs7WbLG1MCyoO+anee K6gAoPeo67mr4cMx0Jia6E5h6TVaiE8ltQ+5YHbAAoK9A7P72ko6lhmaUNNLbaMdhy64Ai agal/pXjjxxkpTIroM78tXHbi7e7I6lpd4z0++o1XKY/epx7w+GaHItqFno/7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=i+zFwZlO; dkim=fail ("headers rsa verify failed") header.d=ngraves.fr header.s=ovhmo4487190-selector1 header.b=XoktjJbO; 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-Seal: i=1; s=key1; d=yhetil.org; t=1729204482; a=rsa-sha256; cv=none; b=rJa0l0bUOZm7Tmag63HjFCZzz4np0g3aaOgMnbnw5q43JhRIeGRKw2/onU919tL7phg/qc SF/jfKM9iut4ke5nELb+KuTEXpUx0t+3EPiji8HZYPjh/WEJBxZfAob7KGNIKzlY2ZQhTL Tt7Rg1+OlBcMCJnIX+hB+cfjpPw+T6YloOOyACEFaSezapPeJ1E/pywg+o5wPqR4HGc1JX /y3tIvdbz4/2qXLW6APKvvJwXW7LsHo+94CFHdWh3EqssoN03pVSsZCvoeK1WLvpWt/EUY UynwarCdJN9ZBHTKiK/JBoyqn4NUm+9NznnzUOlLfFqaHLAfetwVVkSUAMx0TQ== 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 7B4A097C8D for ; Fri, 18 Oct 2024 00:34:42 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1Z3x-0001M5-Fy; Thu, 17 Oct 2024 18:33:45 -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 1t1Z3v-0001L9-Py for guix-patches@gnu.org; Thu, 17 Oct 2024 18:33:43 -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 1t1Z3v-0001uU-HP for guix-patches@gnu.org; Thu, 17 Oct 2024 18:33:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=AcsH/fdjYtEfZycmGJSFEAiDp/AI/uWeWbrOxp7imN4=; b=i+zFwZlOYt51IHgajv5GG9E/KIlYFCsQKD1cvLZ98BxCB2ferKrpfQW2pcRqRV/Ng4awQbpVdhuu7Fl3TquFVcYIpvH2QmkUtjNO9ed5ijKEQw099wPA2oM21Bqrs1Ma0g8ngzT443Ap2w2iuDKZn8vNMt5COu6F3QhqiXvWVi0rGYxMmlRmBPYOhlUCN0LQdnt+67II5NPweOA22CPSurQW1KcAOl/tmFyGHUK5gTwnGY09rysXdt81DFyE5J6UocCoBUFVttwbrtr87NTggxOylCP/3uNDoxFXSBZuIyz1ZDrkHquLxqKqWvQ6esF/d+xDZiZYSiX7d/TMGFDG+Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1Z4G-0008Oh-Va for guix-patches@gnu.org; Thu, 17 Oct 2024 18:34:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73833] [PATCH v2 5/5] guix: refresh: Implement basic upstream-source-inputs rich updates. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Oct 2024 22:34:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73833 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 73833@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 73833-submit@debbugs.gnu.org id=B73833.172920444332257 (code B ref 73833); Thu, 17 Oct 2024 22:34:04 +0000 Received: (at 73833) by debbugs.gnu.org; 17 Oct 2024 22:34:03 +0000 Received: from localhost ([127.0.0.1]:35925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1Z4E-0008O0-IG for submit@debbugs.gnu.org; Thu, 17 Oct 2024 18:34:03 -0400 Received: from 13.mo583.mail-out.ovh.net ([87.98.182.191]:58805) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1Z3v-0008ML-EH for 73833@debbugs.gnu.org; Thu, 17 Oct 2024 18:33:47 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.9.136]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4XV2fm4Q4Dz1TCP for <73833@debbugs.gnu.org>; Thu, 17 Oct 2024 22:33:20 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-fv27r (unknown [10.108.42.247]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 62F1A1FD18; Thu, 17 Oct 2024 22:33:20 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-5b5ff79f4f-fv27r with ESMTPSA id pTLuMa+QEWeJCwAARl4Asg (envelope-from ); Thu, 17 Oct 2024 22:33:20 +0000 X-OVh-ClientIp: 90.110.172.34 Date: Fri, 18 Oct 2024 00:26:01 +0200 Message-ID: <20241017223308.27941-6-ngraves@ngraves.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241017223308.27941-1-ngraves@ngraves.fr> References: <20241017223308.27941-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10425833137750663906 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehvddguddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddruddutddrudejvddrfeegpdefjedrheelrddugedvrddutdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejfeekfeefseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=AcsH/fdjYtEfZycmGJSFEAiDp/AI/uWeWbrOxp7imN4=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1729204400; v=1; b=XoktjJbOcAE7gNhA9oT4esoNBZaNOCYKWXTST+Ihjl7HA0avcEEd2a9RBtZvdB9AVFVAH7UQ a/QmImgQhWow/vupGoNebtCrVqtOF/0N6gG2E7KQxgLwBF8ldWZys5ENWm1BlEVQovu97wwfu6r IcRteGCLju5vcpdFE00qhjaO9HGfTzIweIFSjV8RCbZMGvMMET7iavMzSPZ6W27VFBdsL0pCNS+ eHWpaXKSRWBY246t9ofBfAq2IAAxgf0+jsCYlvIY5y1ok3Gn7GRptPwubaF3D9SPjI4ndbPyrOh ISz3SC5FduY6TooL6hTfzygYZPQurgJss1iNkQ7s8Xa+Q== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 0.49 X-Spam-Score: 0.49 X-Migadu-Queue-Id: 7B4A097C8D X-TUID: ZOIzZrVRR4YW * guix/scripts/refresh.scm (options->user-updaters): Add variable. (options->update-specs)[input->update-spec]: Restrained default where the min-version and max-version have the same major+minor version. [update-specs]: Adapt user-specified packages to be aware of upstream-source-inputs version in this restrained default. This should allow to update dependent packages to the right version as opposed to the latest version. Tested in some capacity, but very alpha. This also implies that the upstream-updater-import is able to provide versions on top of packages, that the updater is able to read incomplete semver versions (such as 3.2 instead of 3.2.1), and that the upstream-inputs have their min-version and max-version set. --- guix/scripts/refresh.scm | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 810c33c786..70685ddbc1 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -229,6 +229,14 @@ (define (update-specification->update-spec spec fallback-version) (idx (update-spec (specification->package (substring spec 0 idx)) (substring spec (1+ idx)))))) +(define (options->user-updaters opts) + ;; Return the list of user-specified updaters. + (filter-map (match-lambda + (('updaters . names) + (map lookup-updater-by-name names)) + (_ #f)) + opts)) + (define (options->update-specs opts) "Return the list of records requested by OPTS, honoring options like '--recursive'." @@ -269,6 +277,14 @@ (define (keep-newest package lst) (_ (cons package lst))))) + (define (input->update-spec input) + (%update-spec + (specification->package (upstream-input-downstream-name input)) + (if (string=? (version-major+minor (upstream-input-max-version input)) + (version-major+minor (upstream-input-min-version input))) + (version-major+minor (upstream-input-max-version input)) + #f))) + (define update-specs ;; Update specs explicitly passed as command-line arguments. (match (append-map (match-lambda @@ -307,7 +323,19 @@ (define update-specs '() modules)))) (some ;user-specified packages - some))) + ;; When the user specifies updaters, and these updaters support + ;; min/max versions, updates specs so that they account for this + ;; updater. + (let ((user-updaters (options->user-updaters opts))) + (if (and user-updaters (not (unspecified? user-updaters)) + (not (null? user-updaters))) + (let* ((import (upstream-updater-import (caar user-updaters))) + (package (update-spec-package (car some))) + (version (update-spec-version (car some))) + (source (import package #:version version)) + (upstream-inputs (upstream-source-inputs source))) + (append some (map input->update-spec upstream-inputs))) + some))))) (if (assoc-ref opts 'recursive?) (mlet* %store-monad @@ -571,11 +599,7 @@ (define (parse-options) (define (options->updaters opts) ;; Return the list of updaters to use. - (match (filter-map (match-lambda - (('updaters . names) - (map lookup-updater-by-name names)) - (_ #f)) - opts) + (match (options->user-updaters opts) (() ;; Use the default updaters. (force %updaters)) -- 2.46.0