GNU bug report logs - #78477
[PATCH] teams: Add script to refresh GNOME core packages.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Keywords: patch; Done: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 78477 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer@HIDDEN> Request was from Maxim Cournoyer <maxim.cournoyer@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 May 2025 13:01:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 18 09:01:48 2025
Received: from localhost ([127.0.0.1]:56402 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uGdeF-0007lW-PE
	for submit <at> debbugs.gnu.org; Sun, 18 May 2025 09:01:48 -0400
Received: from lists.gnu.org ([2001:470:142::17]:49444)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1uGdeC-0007l4-JH
 for submit <at> debbugs.gnu.org; Sun, 18 May 2025 09:01: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 <maxim.cournoyer@HIDDEN>)
 id 1uGde0-0007Pi-GJ
 for guix-patches@HIDDEN; Sun, 18 May 2025 09:01:33 -0400
Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1uGddy-0004Ey-DY
 for guix-patches@HIDDEN; Sun, 18 May 2025 09:01:32 -0400
Received: by mail-pl1-x62e.google.com with SMTP id
 d9443c01a7336-231fc83a33aso11232375ad.0
 for <guix-patches@HIDDEN>; Sun, 18 May 2025 06:01:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1747573287; x=1748178087; darn=gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=kcsYuM8+rSlBkEx0ANm+Gn4Cr6nwomt0IiyzSPXkgoo=;
 b=WAZCfdoYJ+iv39OpgcYWEdv8e9natvAyCXh/QFGN72uHj5SF8bGwGcVYk7fAunw9ot
 VoZg/LkZnXxBv5wWFpeGL5VJPnzrY3KUrF8hkXrm+GhO0IGPZ1hMp/j/ajn9Khz2cTiV
 qTkcKJWfK+bhcbKrDk20lFHiArJFAmnoTQ9/p7LyDglmpO87VUDuJQKUXRzcboD1Lkzx
 bbIIuRUJ1pJT3MZLUdf9hNxX4GsDpCrA3Ghx4our2VRDagvvZDydxQNqxXbP9mZSKS5r
 YaBNtAbCVTqShp35m/gSl6Gm4YtJJM1yW8Fyciw3PX0lGRWGlEg6/GpUR3V6Kl0cANha
 j3TQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1747573287; x=1748178087;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=kcsYuM8+rSlBkEx0ANm+Gn4Cr6nwomt0IiyzSPXkgoo=;
 b=I8GDirJhqgXxbSk/nPlLpNRAKrx4wtljxo+oc+CrIuhNLEZLY6iYvaONprviC6GJEU
 rFSc/LOKG8q53hpNx9YbDZ3K+97LKm44TXP9/yvKhY/PVQdYZtIx3NsREPW+QspNLrzE
 BeRMH5gvvZgADpL/gmQ4WpLwJZrX2AbzRapqFO9tMelI7ijqO/lS6WYxSQUZY5inCaTG
 9M2oqhfYCpcXkWomDFJ58xWyQ6kD/t2YPBbP32yKQ9WKrRO1pP5ZAGuLNlKfgBEDdoes
 BaJYQcn0c4fFQ93TSHtPvuuPGme2mA9cGl+tUTfzKclOncEtXpxQCqidczhN3fPE+saT
 B4SQ==
X-Gm-Message-State: AOJu0YzDtAb40f6V3odoDnnS/6kxu1Y7MdV6uVURyCjeL30tWhh/k8Zy
 sin39HhtG+WzenvNJ6SrKB5MsBRZlQ48N5VgFu22JaVsGip2PSYR5n8ZCIXbQQ==
X-Gm-Gg: ASbGncvQPXJz0MNkBIrNvQWYzBAFVNkaF/SCO6Au86HcOEEjvPvBHBac5cjv6WW3zkl
 sp1SEeaXLtuhIrQLZD8vqcNppLLfRoO1UOtLdGfMGv8+XodZVse5ZdwhXYcZ3WSIiFvilyxrUhx
 0fdJWAdNc5NfJn7aXrgqCb1dz1/pxUDm4T6xKWaI5TZkTxkZCJFJdDZebhYFVkwk1hX9sXwsGoC
 1Me1ohVHYc/rj+lFXMgZ5DVKk6BkwvP6p8Gvm21SijEV3AO+InipIozyC4RhHKsTVgutlzxjwaJ
 FMVapkn17qeqo1jjmmu1eAYVLn3vqcfB+xXfXJPGwDs8+oovq/MJHsb+pv/Jx80azQZo5MglLVR
 cVXQjdA==
X-Google-Smtp-Source: AGHT+IEgt/GgxfC1tapsy1cVd/xoAYEF1cbl/55ME/plfrdsAWKIhK7yRqtT9TOzs7HcV0eGW1/nHQ==
X-Received: by 2002:a17:903:41c7:b0:22e:37b8:7972 with SMTP id
 d9443c01a7336-231de3514dcmr126493825ad.10.1747573287337; 
 Sun, 18 May 2025 06:01:27 -0700 (PDT)
Received: from localhost.localdomain ([2405:6586:be0:0:83c8:d31d:2cec:f542])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-231d4ebaf53sm43402705ad.187.2025.05.18.06.01.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 18 May 2025 06:01:26 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] teams: Add script to refresh GNOME core packages.
Date: Sun, 18 May 2025 22:01:20 +0900
Message-ID: <c36d1307dbec7649e4346cad0a76baf541aac252.1747573280.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
X-Debbugs-Cc: Liliana Marie Prikler <liliana.prikler@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Noé Lopez <noelopez@HIDDEN>, Vivien Kraus <vivien@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::62e;
 envelope-from=maxim.cournoyer@HIDDEN; helo=mail-pl1-x62e.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* etc/teams/gnome/gnome-core-refresh: New file.

Change-Id: I7c7de6ce4689cef9c51d357e6ea3d16468078013
---
 etc/teams/gnome/gnome-core-refresh | 120 +++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)
 create mode 100755 etc/teams/gnome/gnome-core-refresh

diff --git a/etc/teams/gnome/gnome-core-refresh b/etc/teams/gnome/gnome-core-refresh
new file mode 100755
index 00000000000..785e9a08b59
--- /dev/null
+++ b/etc/teams/gnome/gnome-core-refresh
@@ -0,0 +1,120 @@
+#!/usr/bin/env -S guix repl --
+!#   ;-*- mode: scheme; -*-
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;;
+;;; This is a wrapper of 'guix refresh' that refreshes all the GNOME core
+;;; packages listed in their release engineering (releng) list to their stable
+;;; version.  Set the PARTIAL_VERSIONS environment variable to update to
+;;; compatible versions instead of exact ones.  The GNOME_RELENG_VERSIONS_URI
+;;; environment variable can also point to a different URL or file, for
+;;; example to update to a past GNOME version.  The script can be invoked as:
+;;;
+;;; $ ./pre-inst-env etc/teams/gnome/gnome-core-refresh --update
+;;; or
+;;; $ ./pre-inst-env env PARTIAL_VERSIONS=1 etc/teams/gnome/gnome-core-refresh -u
+;;;
+;;; Code:
+
+(use-modules (gnu packages)
+             (guix diagnostics)
+             (guix http-client)
+             (guix scripts refresh)
+             (guix utils)
+             (ice-9 format)
+             (ice-9 exceptions)
+             (ice-9 match)
+             (ice-9 peg)
+             (ice-9 textual-ports)
+             (srfi srfi-1))
+
+(define %gnome-releng-versions-uri
+  (make-parameter
+   (or (getenv "GNOME_RELENG_VERSIONS_URI")
+       "https://gitlab.gnome.org/GNOME/releng/-/raw/master/\
+tools/versions-stable")))
+
+(define (fetch-releng-content)
+  "Return an input port to the %GNOME-RELENG-VERSIONS-URI file."
+  (call-with-port (http-fetch/cached (%gnome-releng-versions-uri))
+    get-string-all))
+
+(define-exception-type &releng-parser-error &error
+  make-releng-parser-error releng-parser-error?)
+
+(define-peg-string-patterns "\
+releng <-- (comment / entry)* !.
+entry <-- suite C name C version C subdir NL
+suite <-- text
+name <-- text
+version <-- text
+subdir <-- text?
+text <- (!NL !C  .)*
+comment < '#' (!NL .)* NL
+C < ':'
+NL < '\n'")
+
+(define %names
+  '(("adwaita-fonts" . "font-adwaita")))
+
+(define (parse-releng data)
+  "Return DATA, a string representing the content of a GNOME releng file, and
+return the complete parse tree."
+  (let ((tree (peg:tree (match-pattern releng data))))
+    (match tree
+      (#f (raise-exception (make-releng-parser-error)))
+      (_ tree))))
+
+(define (check-package-name name)
+  "Return #t if a package corresponding to NAME exists, else #f."
+  (catch 'quit
+    (lambda ()
+      (parameterize ((guix-warning-port (%make-void-port "w")))
+        (specification->package name)
+        #t))
+    (lambda _
+      (format (current-error-port) "TODO: package ~a~%" name)
+      #f)))
+
+(define* (releng-tree->update-specs tree #:key (partial-versions?
+                                                (getenv "PARTIAL_VERSIONS")))
+  "Take TREE and return a list of package specifications.  If
+PARTIAL-VERSIONS? is true, the least significant digit in version is
+stripped and the version is prefixed with the '~' character, so that 'guix
+refresh' can automatically find the newest compatible version."
+  (match tree
+    (('releng ('entry ('suite "core") ('name name) ('version version) _) ...)
+     (filter-map (lambda (name version)
+                   (let ((name (or (assoc-ref %names name) name)))
+                     (and (check-package-name name)
+                          (if partial-versions?
+                              (let* ((parts (string-split version #\.))
+                                     (num-parts (length parts)))
+                                (if (> num-parts 1)
+                                    (format #f "~a=~~~a" name
+                                            (version-prefix version
+                                                            (1- num-parts)))
+                                    (format #f "~a=~a" name version)))
+                              (format #f "~a=~a" name version)))))
+                 name version))))
+
+(apply guix-refresh (append (cdr (command-line))
+                            (releng-tree->update-specs
+                             (parse-releng (fetch-releng-content)))))

base-commit: 6b5fc4812981f2cadffcc5d39e48cd8e02ee73af
-- 
2.49.0





Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
New bug report received and forwarded. Copy sent to liliana.prikler@HIDDEN, maxim.cournoyer@HIDDEN, noelopez@HIDDEN, vivien@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to liliana.prikler@HIDDEN, maxim.cournoyer@HIDDEN, noelopez@HIDDEN, vivien@HIDDEN, guix-patches@HIDDEN:
bug#78477; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 26 May 2025 11:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.