From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Aug 2021 23:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16290693886202 (code B ref -1); Sun, 15 Aug 2021 23:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Aug 2021 23:16:28 +0000 Received: from localhost ([127.0.0.1]:47934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPMh-0001bx-Nf for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:16:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:43464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPMc-0001bd-Cj for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:16:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFPMc-0006ea-4h for guix-patches@gnu.org; Sun, 15 Aug 2021 19:16:22 -0400 Received: from out1.migadu.com ([91.121.223.63]:57916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFPMZ-0006Xx-3S for guix-patches@gnu.org; Sun, 15 Aug 2021 19:16:21 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=fdwVozHOIoneJWc/FOIByFwOsv6rNoZsKsHyUvUXw58=; b=A+Qy9yZJI/pZC9Vp8iOUn579Zfr53G1blnjXw5a1uTHWGOObbbD6zEJ7Hw95oLXdk7k+HO RmZK4Tg6B4eZ7NRV0uekaoOODK9GrY2mE2HYZFwYOqSUNsnrjZxMpmkVDVlshuBj6U/Ut4 NxcnFJDZ4mhBgj88kKpZ4LQJU7OOY20= From: Sarah Morgensen Date: Sun, 15 Aug 2021 16:16:13 -0700 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev Received-SPF: pass client-ip=91.121.223.63; envelope-from=iskarian@mgsn.dev; helo=out1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello Guix, This is a proof-of-concept for extending `guix refresh -u` to support packages with git-fetch origins. The potential impact is large: approximately 4.5k packages use git-fetch, although only some fraction would be supported. Currently, this enables update support for (at least) any package where * github-updater finds an update, * origin-method is 'git-fetch', and * the package version is a suffix of the 'commit' field. Drawbacks currently include the fact that libgit2 doesn't (yet) support shallow checkouts [0], so the entire repository must be cloned. There is also no support for verifying commits. There should probably also be a few tests added. WDYT? [0] https://github.com/libgit2/libgit2/issues/3058 -- Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating git-fetch origins. guix/git-download.scm | 18 +++++++++++++- guix/hash.scm | 51 ++++++++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 +++---------------------- guix/import/elpa.scm | 28 ++++------------------ guix/import/go.scm | 26 +++----------------- guix/scripts/hash.scm | 29 ++++++----------------- guix/scripts/refresh.scm | 10 ++++---- guix/upstream.scm | 41 +++++++++++++++++++++++++++++++- 8 files changed, 130 insertions(+), 105 deletions(-) create mode 100644 guix/hash.scm base-commit: 12099eac1b161d364be923451d27d7d739d0f14d -- 2.31.1 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 1/4] guix hash: Extract file hashing procedures. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Aug 2021 23:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16290699327023 (code B ref 50072); Sun, 15 Aug 2021 23:26:01 +0000 Received: (at 50072) by debbugs.gnu.org; 15 Aug 2021 23:25:32 +0000 Received: from localhost ([127.0.0.1]:47939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVU-0001pD-5j for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:32 -0400 Received: from out1.migadu.com ([91.121.223.63]:59878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVS-0001p4-6V for 50072@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:31 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0WFMFSUuUYWVX08e2b+zqvIdj2OOvXmGMXdblJEeCyg=; b=Hj3SRdhXdJXsM1ywtCvt7jpZwMt76EonHF4eWORW+FRYmOWeiEWZQBd6KAMk8QvbO624cr i0Q2C+xoemwEMvhf/ANeBbHTBD890vCE9JIIBK158jkpXAQVk2KRGxmPesvesvd8iNZtXZ f+RLBB2nyPNtvWOKNs8LxQjiZe0sII0= From: Sarah Morgensen Date: Sun, 15 Aug 2021 16:25:24 -0700 Message-Id: <9ba0b798de2fdf859f94ca7b2f1ee052bceac63a.1629068119.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/scripts/hash.scm (guix-hash)[vcs-file?, file-hash]: Extract logic to... * guix/hash.scm: ...here. New file. --- guix/hash.scm | 51 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 29 ++++++------------------ 2 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 guix/hash.scm diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..8c2ab8187f --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,51 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? #t) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is true, recurse +into subdirectories of FILE, computing the combined hash of all files for +which (SELECT? FILE STAT) returns true." + (if recursive? + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index b8622373cc..353ca30c2c 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -125,16 +127,6 @@ and 'base16' ('hex' and 'hexadecimal' can be used as well).\n")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) @@ -150,18 +142,11 @@ and 'base16' ('hex' and 'hexadecimal' can be used as well).\n")) ;; Compute the hash of FILE. ;; Catch and gracefully report possible '&nar-error' conditions. (with-error-handling - (if (assoc-ref opts 'recursive?) - (let-values (((port get-hash) - (open-hash-port (assoc-ref opts 'hash-algorithm)))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (match file - ("-" (port-hash (assoc-ref opts 'hash-algorithm) - (current-input-port))) - (_ (call-with-input-file file - (cute port-hash (assoc-ref opts 'hash-algorithm) - <>))))))) + (match file + ("-" (port-hash (assoc-ref opts 'hash-algorithm) + (current-input-port))) + (_ (file-hash* #:algorithm (assoc-ref opts 'hash-algorithm) + #:recursive? (assoc-ref opts 'recursive?)))))) (match args ((file) -- 2.31.1 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 2/4] import: Factorize file hashing. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Aug 2021 23:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16290699387048 (code B ref 50072); Sun, 15 Aug 2021 23:26:02 +0000 Received: (at 50072) by debbugs.gnu.org; 15 Aug 2021 23:25:38 +0000 Received: from localhost ([127.0.0.1]:47943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVZ-0001pW-Ic for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:38 -0400 Received: from out2.migadu.com ([188.165.223.204]:47102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVW-0001pL-Gp for 50072@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:35 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7akfLvRyHvBOWqyJCG4HKD+1hne9n2Xo0apkJYmGmzY=; b=KPtZsDwr0kwJOix07b9YzqdBLYRFmDcul3feNT/EMuYAjOAxjTQrAntdUz55xoZ4BscaJD aibBAPHpGhqGo40MH7Ojqzs8n2kt7T+UYXY1/+ZLxWXHkTFmcIr0ZSykFIS22h1wsJBimY sw+7Nb/6p03I60V04zovmDv1OGPV0CM= From: Sarah Morgensen Date: Sun, 15 Aug 2021 16:25:25 -0700 Message-Id: <82bab33f2d4a03c8e83d1825648577fbae3aee7e.1629068119.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 28 ++++------------------------ guix/import/go.scm | 26 +++----------------------- 3 files changed, 10 insertions(+), 76 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index f649928c5a..ac24bc117e 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,9 +35,8 @@ #:use-module (web uri) #:use-module (guix memoization) #:use-module (guix http-client) - #:use-module (gcrypt hash) + #:use-module (guix hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -194,17 +194,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -437,16 +426,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -544,12 +523,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source)))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index c0dc5acf51..22c937ca5f 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,10 +37,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -226,27 +227,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -268,7 +248,7 @@ RECIPE." (sha256 (base32 ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + (file-hash* directory))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -379,7 +359,7 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string (file-hash* tarball)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 617a0d0e23..c6425667f8 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -25,6 +25,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -35,9 +36,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) - #:autoload (guix serialization) (write-file) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) #:use-module (ice-9 match) @@ -494,25 +493,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -531,7 +511,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source -- 2.31.1 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 3/4] refresh: Support non-tarball sources. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Aug 2021 23:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16290699407064 (code B ref 50072); Sun, 15 Aug 2021 23:26:02 +0000 Received: (at 50072) by debbugs.gnu.org; 15 Aug 2021 23:25:40 +0000 Received: from localhost ([127.0.0.1]:47946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVc-0001pr-Cs for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:40 -0400 Received: from out0.migadu.com ([94.23.1.103]:31065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVZ-0001pT-8L for 50072@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:38 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3sWwu6rP2yY7l+g2SazGbRfisouEZXzlss71KFp3gU=; b=M3pDhzn0gAYR/P6gLql49wXSbrh7B4Fk918vASVXGKs2Qg993jglgq4fruM4TMYuxAtn+J C2HQEqjSE9LSzO7TG9b8QyReAAaMuRjDGuoi5MvEf8cLYZkaQl1WL9zRO6N5gH4L61urKE apvb4MriGBP1r/4KOvf5WedHDyylgJ8= From: Sarah Morgensen Date: Sun, 15 Aug 2021 16:25:26 -0700 Message-Id: <54668cb99babc81db0edfcdf2a8fa870bde96863.1629068119.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index fb6c52a567..abb0c24e96 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -347,8 +348,7 @@ warn about packages that have no matching updater." (package-name package) (upstream-input-change-name change))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.31.1 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 15 Aug 2021 23:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16290699417072 (code B ref 50072); Sun, 15 Aug 2021 23:26:03 +0000 Received: (at 50072) by debbugs.gnu.org; 15 Aug 2021 23:25:41 +0000 Received: from localhost ([127.0.0.1]:47948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVc-0001pt-M6 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:41 -0400 Received: from out0.migadu.com ([94.23.1.103]:31077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPVa-0001pZ-D7 for 50072@debbugs.gnu.org; Sun, 15 Aug 2021 19:25:39 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SaBFF2tRm7PZlrCixzWhD5HmIJdo0elYCu26DpndMPE=; b=dYLKoTk49hRJ19rfQYYfqNKaWd9X0R6fYgzpstssHtb/XZIq3EMi172z11IVqhPsIXGsY8 xq3uPcxRKHwCpB5UknK7kd20P19lcX0xvlrbqhtgCp4g/+RPYmR287UpiPtpL58fwe0PDU xEOmetKcpXJK0zb/1cSDMete83ra7f8= From: Sarah Morgensen Date: Sun, 15 Aug 2021 16:25:27 -0700 Message-Id: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/git-download.scm (checkout-to-store): New procedure. * guix/upstream.scm (guess-version-transform) (package-update/git-fetch): New procedures. (%method-updates): Add GIT-FETCH mapping. --- guix/git-download.scm | 18 +++++++++++++++++- guix/upstream.scm | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 5e624b9ae9..a7bdc16718 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017 Mathieu Lirzin ;;; Copyright © 2017 Christopher Baines ;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +27,7 @@ #:use-module (guix records) #:use-module (guix packages) #:use-module (guix modules) + #:use-module (guix git) #:autoload (guix build-system gnu) (standard-packages) #:autoload (git bindings) (libgit2-init!) #:autoload (git repository) (repository-open @@ -53,7 +55,9 @@ git-fetch git-version git-file-name - git-predicate)) + git-predicate + + checkout-to-store)) ;;; Commentary: ;;; @@ -287,4 +291,16 @@ absolute file name and STAT is the result of 'lstat'." (#f #f))))) (const #f))) +(define* (checkout-to-store store ref #:key (log (current-error-port))) + "Checkout REF to STORE. Write progress reports to LOG. RECURSIVE? has the +same effect as the same-named parameter of 'latest-repository-commit'." + ;; XXX: (guix git) does not use shallow clones, so this will be slow + ;; for long-running repositories. + (match-record ref + (url commit recursive?) + (latest-repository-commit store url + #:ref `(tag-or-commit . ,commit) + #:recursive? recursive? + #:log-port log))) + ;;; git-download.scm ends here diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..927260cd89 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) @@ -430,9 +432,46 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define (guess-version-transform commit from-version) + "Return a one-argument proc that transforms FROM-VERSION to COMMIT, or #f +if no such transformation could be determined." + ;; Just handle prefixes for now, since that's the most common. + (if (string-suffix? from-version commit) + (let* ((version-length (string-length from-version)) + (commit-prefix (string-drop-right commit version-length))) + (lambda (version) + (string-append commit-prefix version))) + #f)) + +(define* (package-update/git-fetch store package source + #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + + (define (uri-update/git old-uri old-version url version) + (let* ((old-commit (git-reference-commit old-uri)) + (transform (guess-version-transform old-commit old-version))) + (and transform + (git-reference + (inherit old-uri) + (url url) + (commit (transform version)))))) + + ;; Only use the first element of URLS. + (match-record source + (version urls) + (let* ((old-uri (origin-uri (package-source package))) + (old-version (package-version package)) + (new-uri (uri-update/git old-uri old-version + (first urls) version))) + (if new-uri + (values version (checkout-to-store store new-uri) source) + (values #f #f #f))))) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) -- 2.31.1 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Aug 2021 10:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162911080426082 (code B ref 50072); Mon, 16 Aug 2021 10:47:01 +0000 Received: (at 50072) by debbugs.gnu.org; 16 Aug 2021 10:46:44 +0000 Received: from localhost ([127.0.0.1]:48612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFa8e-0006mW-40 for submit@debbugs.gnu.org; Mon, 16 Aug 2021 06:46:43 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:37734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFa8X-0006mI-LY for 50072@debbugs.gnu.org; Mon, 16 Aug 2021 06:46:38 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id iAmX2500E0mfAB406AmXgz; Mon, 16 Aug 2021 12:46:32 +0200 Message-ID: From: Maxime Devos Date: Mon, 16 Aug 2021 12:46:25 +0200 In-Reply-To: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-9mgKTjabCdrk2qjTMUh7" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629110792; bh=Hrbyv12u/y89xtr1hGfsNsqGzX/rZo4WgsLM0uWQY6I=; h=Subject:From:To:Date:In-Reply-To:References; b=eWARWO3vQfCHneBxhTvA6f6shcvmiwfJby2uElrnbkEr2NeKIYBdbMLjnJM04q9yA C+f6glE2MTGRJW0s52xHrJphHTQxqU1NqtDJZtMxhhbHavF3iMwZFsyBdBGoDw4+wW +fwedWbU8ortwAZ6AdguE+m6MHNiY2yO9iAWzravEKpXC+6Oza0UrG77WejI3Ob6o1 D+1hbAPgFDfJj9B5vqhfqIaiCbHpkBhi0g5CaxCLE2lyDEXuBh+xVVzIwm7pieQgW/ 0rmWdyIxD8q4xSZmuxm5g9LerCMKVerEEV1CD+p1kKLH37BEeTEtyHZ0Ggee6+/H8k 7VTDWQ9Ct3MFg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-9mgKTjabCdrk2qjTMUh7 Content-Type: multipart/mixed; boundary="=-zr7+3QxMtVYPT37XqX5g" --=-zr7+3QxMtVYPT37XqX5g Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: > * guix/git-download.scm (checkout-to-store): New procedure. > * guix/upstream.scm (guess-version-transform) > (package-update/git-fetch): New procedures. > (%method-updates): Add GIT-FETCH mapping. Does it support packages defined like (a) (define-public gnash (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") (revision "0")) (package (name "gnash") (version (git-version "0.8.11" revision commit)) (source (git-reference (url "https://example.org") (commit commit))) [...]))) and (b) (define-public gnash (package (name "gnash") (version "0.8.11") (source (git-reference (url "https://example.org") (commit commit)) [...])) ? (Maybe (a) and (b) can be used as test cases.) FWIW, I had a try at supporting git-fetch origins in "--with-latest" and "guix refresh -e" myself, and had to modify 'package-update' to replace commit strings. IIRC, it supports (b), but not (a). The patch is attached, hopefully it will be useful. Greetings, Maxime. --=-zr7+3QxMtVYPT37XqX5g Content-Disposition: inline; filename="git-fetch.patch" Content-Type: text/x-patch; name="git-fetch.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2d1aXgvaW1wb3J0L21pbmV0ZXN0LnNjbSBiL2d1aXgvaW1wb3J0L21pbmV0 ZXN0LnNjbQppbmRleCA0MjY0MzQxZDZhLi4yOTA0YzNmOTRhIDEwMDY0NAotLS0gYS9ndWl4L2lt cG9ydC9taW5ldGVzdC5zY20KKysrIGIvZ3VpeC9pbXBvcnQvbWluZXRlc3Quc2NtCkBAIC0yOTcs NyArMjk3LDcgQEAgcmVzdWx0cy4gIFRoZSByZXR1cm4gdmFsdWUgaXMgYSBsaXN0IG9mIDxwYWNr YWdlL2tleXM+IHJlY29yZHMuIgogKGRlZmluZSAobWFrZS1taW5ldGVzdC1zZXhwIGF1dGhvci9u YW1lIHZlcnNpb24gcmVwb3NpdG9yeSBjb21taXQKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnB1dHMgaG9tZS1wYWdlIHN5bm9wc2lzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZGVzY3JpcHRpb24gbWVkaWEtbGljZW5zZSBsaWNlbnNlKQotICAiUmV0dXJuIGEgUy1leHByZXNz aW9uIGZvciB0aGUgbWluZXRlc3QgcGFja2FnZSB3aXRoIHRoZSBnaXZlbiBhdXRob3IvTkFNRSwK KyAgIlJldHVybiBhIFMtZXhwcmVzc2lvbiBmb3IgdGhlIG1pbmV0ZXN0IHBhY2thZ2Ugd2l0aCB0 aGUgZ2l2ZW4gQVVUSE9SL05BTUUsCiBWRVJTSU9OLCBSRVBPU0lUT1JZLCBDT01NSVQsIElOUFVU UywgSE9NRS1QQUdFLCBTWU5PUFNJUywgREVTQ1JJUFRJT04sCiBNRURJQS1MSUNFTlNFIGFuZCBM SUNFTlNFLiIKICAgYChwYWNrYWdlCkBAIC00NTIsMyArNDUyLDM3IEBAIGxpc3Qgb2YgQVVUSE9S L05BTUUgc3RyaW5ncy4iCiAgICAgICAgICAgICAgICAgICAgICM6cmVwby0+Z3VpeC1wYWNrYWdl IG1pbmV0ZXN0LT5ndWl4LXBhY2thZ2UqCiAgICAgICAgICAgICAgICAgICAgICM6Z3VpeC1uYW1l CiAgICAgICAgICAgICAgICAgICAgIChjb21wb3NlIGNvbnRlbnRkYi0+cGFja2FnZS1uYW1lIGF1 dGhvci9uYW1lLT5uYW1lKSkpCisKKyN8CisoZGVmaW5lIChtaW5ldGVzdC1wYWNrYWdlPyBwa2cp CisgIChhbmQgKHN0cmluZy1wcmVmaXg/ICJtaW5ldGVzdC0iIChwYWNrYWdlOnBhY2thZ2UtbmFt ZSBwa2cpKQorICAgICAgIChhc3NxLXJlZiAocGFja2FnZTpwYWNrYWdlLXByb3BlcnRpZXMgcGtn KSAndXBzdHJlYW0tbmFtZSkpKQorCisoZGVmaW5lIChsYXRlc3QtbWluZXRlc3QtcmVsZWFzZSBw a2cpCisgICJSZXR1cm4gYW4gPHVwc3RyZWFtLXNvdXJjZT4gZm9yIHRoZSBsYXRlc3QgcmVsZWFz ZSBvZiB0aGUgcGFja2FnZSBQS0cuIgorICAoZGVmaW5lIHVwc3RyZWFtLW5hbWUKKyAgICAoYXNz b2MtcmVmIChwYWNrYWdlOnBhY2thZ2UtcHJvcGVydGllcyBwa2cpICd1cHN0cmVhbS1uYW1lKSkK KyAgKGRlZmluZSBjb250ZW50ZGItcGFja2FnZSAoY29udGVudGRiLWZldGNoIHVwc3RyZWFtLW5h bWUpKQorICAoZGVmaW5lIHJlbGVhc2UgKGxhdGVzdC1yZWxlYXNlIHVwc3RyZWFtLW5hbWUpKQor ICAoYW5kIGNvbnRlbnRkYi1wYWNrYWdlIHJlbGVhc2UKKyAgICAgICAoYW5kLWxldCogKChvbGQt b3JpZ2luIChwYWNrYWdlOnBhY2thZ2Utc291cmNlIHBrZykpCisgICAgICAgICAgICAgICAgICAo b2xkLXJlZmVyZW5jZSAocGFja2FnZTpvcmlnaW4tdXJpIG9sZC1vcmlnaW4pKQorICAgICAgICAg ICAgICAgICAgKGlzLWdpdD8gKGRvd25sb2FkOmdpdC1yZWZlcmVuY2U/IG9sZC1yZWZlcmVuY2Up KQorICAgICAgICAgICAgICAgICAgKGNvbW1pdCAocmVsZWFzZS1jb21taXQgcmVsZWFzZSkpKQor ICAgICAgICAgKHVwc3RyZWFtLXNvdXJjZQorICAgICAgICAgIChwYWNrYWdlIChwYWNrYWdlOnBh Y2thZ2UtbmFtZSBwa2cpKQorICAgICAgICAgICh2ZXJzaW9uIChyZWxlYXNlLXRpdGxlIHJlbGVh c2UpKQorICAgICAgICAgICh1cmxzIChkb3dubG9hZDpnaXQtcmVmZXJlbmNlCisgICAgICAgICAg ICAgICAgICh1cmwgKHBhY2thZ2UtcmVwb3NpdG9yeSBjb250ZW50ZGItcGFja2FnZSkpCisgICAg ICAgICAgICAgICAgIChjb21taXQgY29tbWl0KSkpKSkpKQorCisoZGVmaW5lICVtaW5ldGVzdC11 cGRhdGVyCisgICh1cHN0cmVhbS11cGRhdGVyCisgICAobmFtZSAnbWluZXRlc3QpCisgICAoZGVz Y3JpcHRpb24gIlVwZGF0ZXIgZm9yIE1pbmV0ZXN0IHBhY2thZ2VzIG9uIENvbnRlbnREQiIpCisg ICAocHJlZCBtaW5ldGVzdC1wYWNrYWdlPykKKyAgIChsYXRlc3QgbGF0ZXN0LW1pbmV0ZXN0LXJl bGVhc2UpKSkKK3wjCis7OyAgIzp1c2UtbW9kdWxlIChndWl4IHVwc3RyZWFtKQorOzsgICM6dXNl LW1vZHVsZSAoKGd1aXggZ2l0LWRvd25sb2FkKSAjOnByZWZpeCBkb3dubG9hZDopCis7OyAgIzp1 c2UtbW9kdWxlICgoZ3VpeCBwYWNrYWdlcykgIzpwcmVmaXggcGFja2FnZTopCmRpZmYgLS1naXQg YS9ndWl4L3NjcmlwdHMvcmVmcmVzaC5zY20gYi9ndWl4L3NjcmlwdHMvcmVmcmVzaC5zY20KaW5k ZXggZmI2YzUyYTU2Ny4uNGYzYmJiY2I5NCAxMDA2NDQKLS0tIGEvZ3VpeC9zY3JpcHRzL3JlZnJl c2guc2NtCisrKyBiL2d1aXgvc2NyaXB0cy9yZWZyZXNoLnNjbQpAQCAtMjgsOCArMjgsMTAgQEAK ICAgIzp1c2UtbW9kdWxlIChndWl4IHVpKQogICAjOnVzZS1tb2R1bGUgKGdjcnlwdCBoYXNoKQog ICAjOnVzZS1tb2R1bGUgKGd1aXggc2NyaXB0cykKKyAgIzp1c2UtbW9kdWxlIChndWl4IHNlcmlh bGl6YXRpb24pCiAgICM6dXNlLW1vZHVsZSAoKGd1aXggc2NyaXB0cyBidWlsZCkgIzpzZWxlY3Qg KCVzdGFuZGFyZC1idWlsZC1vcHRpb25zKSkKICAgIzp1c2UtbW9kdWxlIChndWl4IHN0b3JlKQor ICAjOnVzZS1tb2R1bGUgKGd1aXggYnVpbGQgdXRpbHMpCiAgICM6dXNlLW1vZHVsZSAoZ3VpeCB1 dGlscykKICAgIzp1c2UtbW9kdWxlIChndWl4IHBhY2thZ2VzKQogICAjOnVzZS1tb2R1bGUgKGd1 aXggcHJvZmlsZXMpCkBAIC0zMDcsNiArMzA5LDE3IEBAIHVwZGF0ZSB3b3VsZCB0cmlnZ2VyIGEg Y29tcGxldGUgcmVidWlsZC4iCiAgICAgICAgICAgIChHXyAibm8gdXBkYXRlciBmb3IgfmF+JSIp CiAgICAgICAgICAgIChwYWNrYWdlLW5hbWUgcGFja2FnZSkpKQogCisKKzs7IFhYWCBhZGFwdGVk IGZyb20gKGd1aXggc2NyaXB0cyBoYXNoKQorKGRlZmluZSAoZmlsZS1oYXNoIGZpbGUgc2VsZWN0 PyByZWN1cnNpdmU/KQorICA7OyBDb21wdXRlIHRoZSBoYXNoIG9mIEZJTEUuCisgIChpZiByZWN1 cnNpdmU/CisgICAgICAobGV0LXZhbHVlcyAoKChwb3J0IGdldC1oYXNoKSAob3Blbi1zaGEyNTYt cG9ydCkpKQorICAgICAgICAod3JpdGUtZmlsZSBmaWxlIHBvcnQgIzpzZWxlY3Q/IHNlbGVjdD8p CisgICAgICAgIChmb3JjZS1vdXRwdXQgcG9ydCkKKyAgICAgICAgKGdldC1oYXNoKSkKKyAgICAg IChjYWxsLXdpdGgtaW5wdXQtZmlsZSBmaWxlIHBvcnQtc2hhMjU2KSkpCisKIChkZWZpbmUqICh1 cGRhdGUtcGFja2FnZSBzdG9yZSBwYWNrYWdlIHVwZGF0ZXJzCiAgICAgICAgICAgICAgICAgICAg ICAgICAgIzprZXkgKGtleS1kb3dubG9hZCAnaW50ZXJhY3RpdmUpIHdhcm4/KQogICAiVXBkYXRl IHRoZSBzb3VyY2UgZmlsZSB0aGF0IGRlZmluZXMgUEFDS0FHRSB3aXRoIHRoZSBuZXcgdmVyc2lv bi4KQEAgLTM0Nyw4ICszNjAsOCBAQCB3YXJuIGFib3V0IHBhY2thZ2VzIHRoYXQgaGF2ZSBubyBt YXRjaGluZyB1cGRhdGVyLiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwYWNrYWdlLW5h bWUgcGFja2FnZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1cHN0cmVhbS1pbnB1dC1j aGFuZ2UtbmFtZSBjaGFuZ2UpKSkKICAgICAgICAgICAgICAgICAgKHVwc3RyZWFtLXNvdXJjZS1p bnB1dC1jaGFuZ2VzIHNvdXJjZSkpCi0gICAgICAgICAgICAgICAgKGxldCAoKGhhc2ggKGNhbGwt d2l0aC1pbnB1dC1maWxlIHRhcmJhbGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBv cnQtc2hhMjU2KSkpCisgICAgICAgICAgICAgICAgKGxldCAoKGhhc2ggKGZpbGUtaGFzaCB0YXJi YWxsIChjb25zdCAjdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChk aXJlY3RvcnktZXhpc3RzPyB0YXJiYWxsKSkpKQogICAgICAgICAgICAgICAgICAgKHVwZGF0ZS1w YWNrYWdlLXNvdXJjZSBwYWNrYWdlIHNvdXJjZSBoYXNoKSkpCiAgICAgICAgICAgICAgICh3YXJu aW5nIChHXyAifmE6IHZlcnNpb24gfmEgY291bGQgbm90IGJlIFwKIGRvd25sb2FkZWQgYW5kIGF1 dGhlbnRpY2F0ZWQ7IG5vdCB1cGRhdGluZ34lIikKZGlmZiAtLWdpdCBhL2d1aXgvdXBzdHJlYW0u c2NtIGIvZ3VpeC91cHN0cmVhbS5zY20KaW5kZXggNjMyZTllYmM0Zi4uNjFmNjdiNTdjMSAxMDA2 NDQKLS0tIGEvZ3VpeC91cHN0cmVhbS5zY20KKysrIGIvZ3VpeC91cHN0cmVhbS5zY20KQEAgLTI0 LDYgKzI0LDExIEBACiAgICM6dXNlLW1vZHVsZSAoZ3VpeCBkaXNjb3ZlcnkpCiAgICM6dXNlLW1v ZHVsZSAoKGd1aXggZG93bmxvYWQpCiAgICAgICAgICAgICAgICAgIzpzZWxlY3QgKGRvd25sb2Fk LXRvLXN0b3JlIHVybC1mZXRjaCkpCisgICM6dXNlLW1vZHVsZSAoKGd1aXggZ2l0LWRvd25sb2Fk KQorICAgICAgICAgICAgICAgICM6c2VsZWN0IChnaXQtZmV0Y2ggZ2l0LXJlZmVyZW5jZT8KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdpdC1yZWZlcmVuY2UtdXJsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnaXQtcmVmZXJlbmNlLWNvbW1pdAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2l0LXJlZmVyZW5jZS1yZWN1cnNpdmU/ KSkKICAgIzp1c2UtbW9kdWxlIChndWl4IGdudXBnKQogICAjOnVzZS1tb2R1bGUgKGd1aXggcGFj a2FnZXMpCiAgICM6dXNlLW1vZHVsZSAoZ3VpeCBkaWFnbm9zdGljcykKQEAgLTMzLDYgKzM4LDcg QEAKICAgIzp1c2UtbW9kdWxlIChndWl4IHN0b3JlKQogICAjOnVzZS1tb2R1bGUgKChndWl4IGRl cml2YXRpb25zKSAjOnNlbGVjdCAoYnVpbHQtZGVyaXZhdGlvbnMgZGVyaXZhdGlvbi0+b3V0cHV0 LXBhdGgpKQogICAjOmF1dG9sb2FkICAgKGdjcnlwdCBoYXNoKSAocG9ydC1zaGEyNTYpCisgICM6 YXV0b2xvYWQgICAoZ3VpeCBnaXQpIChsYXRlc3QtcmVwb3NpdG9yeS1jb21taXQpCiAgICM6dXNl LW1vZHVsZSAoZ3VpeCBtb25hZHMpCiAgICM6dXNlLW1vZHVsZSAoc3JmaSBzcmZpLTEpCiAgICM6 dXNlLW1vZHVsZSAoc3JmaSBzcmZpLTkpCkBAIC05Myw3ICs5OSw4IEBACiAgIHVwc3RyZWFtLXNv dXJjZT8KICAgKHBhY2thZ2UgICAgICAgIHVwc3RyZWFtLXNvdXJjZS1wYWNrYWdlKSAgICAgICAg O3N0cmluZwogICAodmVyc2lvbiAgICAgICAgdXBzdHJlYW0tc291cmNlLXZlcnNpb24pICAgICAg ICA7c3RyaW5nCi0gICh1cmxzICAgICAgICAgICB1cHN0cmVhbS1zb3VyY2UtdXJscykgICAgICAg ICAgIDtsaXN0IG9mIHN0cmluZ3MKKyAgOyBsaXN0IG9mIHN0cmluZ3Mgb3IgYSA8Z2l0LXJlZmVy ZW5jZT4KKyAgKHVybHMgICAgICAgICAgIHVwc3RyZWFtLXNvdXJjZS11cmxzKQogICAoc2lnbmF0 dXJlLXVybHMgdXBzdHJlYW0tc291cmNlLXNpZ25hdHVyZS11cmxzICA7I2YgfCBsaXN0IG9mIHN0 cmluZ3MKICAgICAgICAgICAgICAgICAgIChkZWZhdWx0ICNmKSkKICAgKGlucHV0LWNoYW5nZXMg IHVwc3RyZWFtLXNvdXJjZS1pbnB1dC1jaGFuZ2VzCkBAIC0zNjEsNiArMzY4LDExIEBAIHZhbHVl czogJ2ludGVyYWN0aXZlJyAoZGVmYXVsdCksICdhbHdheXMnLCBhbmQgJ25ldmVyJy4iCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeXN0ZW0gdGFyZ2V0 KQogICAiRG93bmxvYWQgU09VUkNFIGZyb20gaXRzIGZpcnN0IFVSTCBhbmQgbG93ZXIgaXQgYXMg YSBmaXhlZC1vdXRwdXQKIGRlcml2YXRpb24gdGhhdCB3b3VsZCBmZXRjaCBpdC4iCisgIChkZWZp bmUgdXJsCisgICAgKG1hdGNoICh1cHN0cmVhbS1zb3VyY2UtdXJscyBzb3VyY2UpCisgICAgICAo KGZpcnN0IC4gXykgZmlyc3QpCisgICAgICAoXyAocmFpc2UgKGZvcm1hdHRlZC1tZXNzYWdlCisg ICAgICAgICAgICAgICAgIChHXyAiZ2l0IG9yaWdpbnMgYXJlIHVuc3VwcG9ydGVkIGJ5IC0td2l0 aC1sYXRlc3QiKSkpKSkpCiAgIChtbGV0KiAlc3RvcmUtbW9uYWQgKCh1cmwgLT4gKGZpcnN0ICh1 cHN0cmVhbS1zb3VyY2UtdXJscyBzb3VyY2UpKSkKICAgICAgICAgICAgICAgICAgICAgICAgKHNp Z25hdHVyZQogICAgICAgICAgICAgICAgICAgICAgICAgLT4gKGFuZD0+ICh1cHN0cmVhbS1zb3Vy Y2Utc2lnbmF0dXJlLXVybHMgc291cmNlKQpAQCAtNDMwLDkgKzQ0MiwyMyBAQCBTT1VSQ0UsIGFu IDx1cHN0cmVhbS1zb3VyY2U+LiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAjOmtleS1kb3dubG9hZCBrZXktZG93bmxvYWQpKSkKICAgICAgICAgICh2YWx1ZXMgdmVy c2lvbiB0YXJiYWxsIHNvdXJjZSkpKSkpKQogCisoZGVmaW5lKiAocGFja2FnZS11cGRhdGUvZ2l0 LWZldGNoIHN0b3JlIHBhY2thZ2Ugc291cmNlICM6a2V5IGtleS1kb3dubG9hZCkKKyAgIlJldHVy biB0aGUgdmVyc2lvbiwgc291cmNlIGNvZGUgZGlyZWN0b3J5LCBhbmQgU09VUkNFLCB0byB1cGRh dGUgUEFDS0FHRSB0bworU09VUkNFLCBhbiA8dXBzdHJlYW0tc291cmNlPi4iCisgIChtYXRjaCBz b3VyY2UKKyAgICAoKCQgPHVwc3RyZWFtLXNvdXJjZT4gXyB2ZXJzaW9uIHJlZiBfKQorICAgICAo dmFsdWVzIHZlcnNpb24KKyAgICAgICAgICAgICAobGF0ZXN0LXJlcG9zaXRvcnktY29tbWl0Cisg ICAgICAgICAgICAgIHN0b3JlCisgICAgICAgICAgICAgIChnaXQtcmVmZXJlbmNlLXVybCByZWYp CisgICAgICAgICAgICAgICM6cmVmIGAoY29tbWl0IC4gLChnaXQtcmVmZXJlbmNlLWNvbW1pdCBy ZWYpKQorICAgICAgICAgICAgICAjOnJlY3Vyc2l2ZT8gKGdpdC1yZWZlcmVuY2UtcmVjdXJzaXZl PyByZWYpKQorICAgICAgICAgICAgIHNvdXJjZSkpKSkKKwogKGRlZmluZSAlbWV0aG9kLXVwZGF0 ZXMKICAgOzsgTWFwcGluZyBvZiBvcmlnaW4gbWV0aG9kcyB0byBzb3VyY2UgdXBkYXRlIHByb2Nl ZHVyZXMuCi0gIGAoKCx1cmwtZmV0Y2ggLiAscGFja2FnZS11cGRhdGUvdXJsLWZldGNoKSkpCisg IGAoKCx1cmwtZmV0Y2ggLiAscGFja2FnZS11cGRhdGUvdXJsLWZldGNoKQorICAgICgsZ2l0LWZl dGNoIC4gLHBhY2thZ2UtdXBkYXRlL2dpdC1mZXRjaCkpKQogCiAoZGVmaW5lKiAocGFja2FnZS11 cGRhdGUgc3RvcmUgcGFja2FnZQogICAgICAgICAgICAgICAgICAgICAgICAgICM6b3B0aW9uYWwg KHVwZGF0ZXJzIChmb3JjZSAldXBkYXRlcnMpKQpAQCAtNDkyLDkgKzUxOCwyMiBAQCBuZXcgdmVy c2lvbiBzdHJpbmcgaWYgYW4gdXBkYXRlIHdhcyBtYWRlLCBhbmQgI2Ygb3RoZXJ3aXNlLiIKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG9yaWdpbi1oYXNoIChwYWNrYWdlLXNvdXJjZSBw YWNrYWdlKSkpKQogICAgICAgICAgICAgICAgKG9sZC11cmwgICAgIChtYXRjaCAob3JpZ2luLXVy aSAocGFja2FnZS1zb3VyY2UgcGFja2FnZSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD8gc3RyaW5nPyB1cmwpIHVybCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo PyBnaXQtcmVmZXJlbmNlPyByZWYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdp dC1yZWZlcmVuY2UtdXJsIHJlZikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyAj ZikpKQogICAgICAgICAgICAgICAgKG5ldy11cmwgICAgIChtYXRjaCAodXBzdHJlYW0tc291cmNl LXVybHMgc291cmNlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChmaXJzdCBfIC4u LikgZmlyc3QpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZmlyc3QgXyAuLi4p IGZpcnN0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg/IGdpdC1yZWZlcmVuY2U/ IHJlZikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2l0LXJlZmVyZW5jZS11cmwg cmVmKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfICNmKSkpCisgICAgICAgICAg ICAgICAob2xkLWNvbW1pdCAgKG1hdGNoIChvcmlnaW4tdXJpIChwYWNrYWdlLXNvdXJjZSBwYWNr YWdlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPyBnaXQtcmVmZXJlbmNlPyBy ZWYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdpdC1yZWZlcmVuY2UtY29tbWl0 IHJlZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoXyAjZikpKQorICAgICAgICAg ICAgICAgKG5ldy1jb21taXQgIChtYXRjaCAodXBzdHJlYW0tc291cmNlLXVybHMgc291cmNlKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg/IGdpdC1yZWZlcmVuY2U/IHJlZikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2l0LXJlZmVyZW5jZS1jb21taXQgcmVmKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfICNmKSkpCiAgICAgICAgICAgICAgICAo ZmlsZSAgICAgICAgKGFuZD0+IChsb2NhdGlvbi1maWxlIGxvYykKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGN1dCBzZWFyY2gtcGF0aCAlbG9hZC1wYXRoIDw+KSkpKQogICAg ICAgICAgIChpZiBmaWxlCkBAIC01MDgsNiArNTQ3LDkgQEAgbmV3IHZlcnNpb24gc3RyaW5nIGlm IGFuIHVwZGF0ZSB3YXMgbWFkZSwgYW5kICNmIG90aGVyd2lzZS4iCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGVuYW1lIGZpbGUpKQogICAgICAgICAgICAg ICAgICAgICAocmVwbGFjZW1lbnRzIGAoKCxvbGQtdmVyc2lvbiAuICx2ZXJzaW9uKQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCxvbGQtaGFzaCAuICxoYXNoKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLEAoaWYgKGFuZCBvbGQtY29tbWl0IG5ldy1j b21taXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgKCgsb2xk LWNvbW1pdCAuICxuZXctY29tbWl0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcoKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICxAKGlm IChhbmQgb2xkLXVybCBuZXctdXJsKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYCgoLChkaXJuYW1lIG9sZC11cmwpIC4KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICwoZGlybmFtZSBuZXctdXJsKSkpCg== --=-zr7+3QxMtVYPT37XqX5g-- --=-9mgKTjabCdrk2qjTMUh7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYRpCAhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mtFAQC2K6AYws89maCmlssXfSbym3b2 9CG2Ima2OaxW4a7k3wD/Z1vXqq7oTCNKbFPVwtQSEH++PEd83p7UKB2LMsw+cgg= =ilA3 -----END PGP SIGNATURE----- --=-9mgKTjabCdrk2qjTMUh7-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Aug 2021 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162911894917332 (code B ref 50072); Mon, 16 Aug 2021 13:03:01 +0000 Received: (at 50072) by debbugs.gnu.org; 16 Aug 2021 13:02:29 +0000 Received: from localhost ([127.0.0.1]:48939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFcG5-0004VG-CW for submit@debbugs.gnu.org; Mon, 16 Aug 2021 09:02:29 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:48970 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFcG0-0004Ng-Ne for 50072@debbugs.gnu.org; Mon, 16 Aug 2021 09:02:27 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1629118934; bh=4xBrwGayeBXpG6wLN2y102+EPOtbsiAK7Z/wqpSDorI=; h=From:To:Subject:In-Reply-To:References:Date; b=LqScsT4fdXYvDZULhBuznqgusO/eWg8OeEz4oQRRtrzI/Hjt2tgvihHN662Jj7kQg 1/ADnhuHNFZ8LFuQTbYDou4e0IdUDYD1r4utZtM3YSGdHZvZ4lrr3KuwxPceqp+I5C 8NZKj+7GD+sWSfpRegBrlcbkWp5o2GblPllpggUU= In-Reply-To: References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> Date: Mon, 16 Aug 2021 15:02:04 +0200 Message-ID: <87wnol8rw3.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, Aug 16 2021, Maxime Devos wrote: > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetc [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, Aug 16 2021, Maxime Devos wrote: > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetc [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain On Mon, Aug 16 2021, Maxime Devos wrote: > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetch): New procedures. >> (%method-updates): Add GIT-FETCH mapping. > > Does it support packages defined like (a) > > (define-public gnash > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > (revision "0")) > (package > (name "gnash") > (version (git-version "0.8.11" revision commit)) > (source (git-reference > (url "https://example.org") IIUC, it only supports GitHub URLs at the moment. I have a WIP patch for adding support for any arbitrary Git repository[1]. [1]: --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmEaYcwVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5r9oQAI3ATDH9rGTsS0dn7stOIBBvrjqs NAfqeBKClrHTptYn+8G3AZ+XEiaqrbRGIZ8aHkXjg6mD4B7d03mUdqIu3JedYeRY Y+/iA5kE9HhohRmUwdUqCBjYYMZOO8SsrRKAUpgTu1dwIK8sb+fkwgZWG1ZYuGLU ya1zGkVfeBailLxvfpUFneKLmY0gvEryVfVoYasbiYmCLSAQxiE6aJUSLpv20FUm jdyPWwPcwhLz5n9SkPHIzoNdlBv7e/M3sG63V7wwceeNeEgIOXD/rhwHluj5GgMz qOdcUN+qkHZDB4Nh5RGqHGTahqh2EuG5Vj6pVDOagZR+30chqiMpm3Py4O2E74ul mMw7LeTROBXwDoapdCkY3YWn1LutFKW3asZR7A5OWB6wKMjNn3p9nSlZHWb2bAxp XFvOhu89oVtokQKzbCHyF99v/5/aWNXSmT0FM6tVL9j8tT0SD+7TYwEWReMaPmtA b6XsDk7dpmK6Y9hjPV3uA/FojaVjHWuJim5xQG75NcjtG2mf3A+hXgumFuznpPLY KuJklLd6HjH3BfVxrOQC3ISJa0SJxvUG/lt2LV866QBgJPjCnox9TIr4nKzTm/Tq xaIKQOzF/40TWPMZOyH2/ujmNpq2qarY6BOmah6lI/nFM47I/wcbHOqhDBDTV1B0 VseqEL6DUR1mKlHd =ViNI -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Aug 2021 18:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen , Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162913772011114 (code B ref 50072); Mon, 16 Aug 2021 18:16:02 +0000 Received: (at 50072) by debbugs.gnu.org; 16 Aug 2021 18:15:20 +0000 Received: from localhost ([127.0.0.1]:50939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFh8q-0002tB-Hk for submit@debbugs.gnu.org; Mon, 16 Aug 2021 14:15:20 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:43252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFh8n-0002t0-4h for 50072@debbugs.gnu.org; Mon, 16 Aug 2021 14:15:19 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id iJFF250050mfAB406JFFpg; Mon, 16 Aug 2021 20:15:15 +0200 Message-ID: <12f985cd431b8b8099f680a3b25ed2eb90e6b26d.camel@telenet.be> From: Maxime Devos Date: Mon, 16 Aug 2021 20:15:07 +0200 In-Reply-To: <87wnol8rw3.fsf@yoctocell.xyz> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <87wnol8rw3.fsf@yoctocell.xyz> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Wnjy/215xV3t45c6cSB/" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629137715; bh=yx3K2jknvMUYfwobNqENYOK1CSvN4GLhCxHEXri7HWk=; h=Subject:From:To:Date:In-Reply-To:References; b=jCVZOL+KU07IKB0wxtERVsqX4d/DhSvL6enZ7SMLSNzoybGTWaznK0AZDxslXz8f4 oeZns+WL3b9KhVvnzcbKueohcC3IIY+quQmfEZl/fcPY/KiFMaKPbqhpMaeqxYCacM IgJEuJ7UaOsZtfchNsPjG4GcZm2FaVlYuFwP4kLYQzRO8BqIMNzQCWClHjsSGPTCFb qEo0YhyDBiCIwGxXY2I3dA0l8cKTAdfiBTGkiAVmPCh1RXpMqk+/nQk4lzlfo8svMD i9b7BRYaepY7necPLnD0V2z5ldijpODLgAkj5GY+FUH5DC9h4+aidxFImGOlCQW+Oc VpeFVPFNuXF1w== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-Wnjy/215xV3t45c6cSB/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xinglu Chen schreef op ma 16-08-2021 om 15:02 [+0200]: > On Mon, Aug 16 2021, Maxime Devos wrote: >=20 > > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: > > > * guix/git-download.scm (checkout-to-store): New procedure. > > > * guix/upstream.scm (guess-version-transform) > > > (package-update/git-fetch): New procedures. > > > (%method-updates): Add GIT-FETCH mapping. > >=20 > > Does it support packages defined like (a) > >=20 > > (define-public gnash > > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > > (revision "0")) > > (package > > (name "gnash") > > (version (git-version "0.8.11" revision commit)) > > (source (git-reference > > (url "https://example.org") >=20 > IIUC, it only supports GitHub URLs at the moment. I have a WIP patch > for adding support for any arbitrary Git repository[1]. This patch series doesn't mention GitHub anywhere (except in the patch series description) so I don't think it only supports GitHub URLs. Admittedly, only one updater, "github", currently produces git-reference URLs, but I sent a patch series [2] that adds an importer which produces git-reference URLs and the corresponding updater (see =E2=80=98git-fetch.pa= tch=E2=80=99) produces appropriate git-reference objects. [2]: . Greetings, Maxime. --=-Wnjy/215xV3t45c6cSB/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYRqrKxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hj2AQDWxLAJXlGpJDkETEBgpnyP1iqC LTkAy45kWUZkOdqY1AD6A2CMB630ENX8F2HOy6f9iMU1h6G/+xqqCy7ltH39AwI= =487y -----END PGP SIGNATURE----- --=-Wnjy/215xV3t45c6cSB/-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Aug 2021 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Xinglu Chen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162914381621221 (code B ref 50072); Mon, 16 Aug 2021 19:57:01 +0000 Received: (at 50072) by debbugs.gnu.org; 16 Aug 2021 19:56:56 +0000 Received: from localhost ([127.0.0.1]:51079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFij9-0005WC-JI for submit@debbugs.gnu.org; Mon, 16 Aug 2021 15:56:56 -0400 Received: from out1.migadu.com ([91.121.223.63]:17779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFij6-0005W2-HF for 50072@debbugs.gnu.org; Mon, 16 Aug 2021 15:56:54 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629143810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XcPzAOGC3MLrGTlnAIv+DLhlnggw2fMpY0o03x7a+Hw=; b=DNeb0tYuw5dCQCHQlCGNjXV5JCA2fchfmNg56SltBRorJQCYse6Egz/2dN3wChuDq8BTeb PSFcpfY6kUb8ouuoTKnpCTPEWQmiqNaB24EzGZGOVypPDT513jVJW1dE1R04T6Y98oYWZS FW8MKJmBL3p0vdmC+MhjQawuC88dysY= From: Sarah Morgensen References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> Date: Mon, 16 Aug 2021 12:56:46 -0700 In-Reply-To: (Maxime Devos's message of "Mon, 16 Aug 2021 12:46:25 +0200") Message-ID: <86fsv9jh8h.fsf_-_@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Maxime, Thanks for taking a look at this. :) Maxime Devos writes: > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetch): New procedures. >> (%method-updates): Add GIT-FETCH mapping. > > Does it support packages defined like (a) > > (define-public gnash > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > (revision "0")) > (package > (name "gnash") > (version (git-version "0.8.11" revision commit)) > (source (git-reference > (url "https://example.org") > (commit commit))) > [...]))) No, it doesn't. Since the commit definition isn't part of the actual package definition, the current code has no way of updating it. It would require a rewrite of the edit-in-place logic with probably a lot of special-casing. There are currently ~1250 package which use this format, though, so it could be worth it... Perhaps what we actually need is a better idiom to express this situation. Package properties ('git-commit)? A 'git-version*'? --8<---------------cut here---------------start------------->8--- (define (git-version* version revision) (let* ((source (package-source this-package)) (commit (git-reference-commit (origin-uri source)))) (git-version version revision commit))) --8<---------------cut here---------------end--------------->8--- I'm not sure if binding order would be an issue with that. > and (b) > > (define-public gnash > (package > (name "gnash") > (version "0.8.11") > (source (git-reference > (url "https://example.org") > (commit commit)) > [...])) > ? Is this missing a definition for commit? If it's like above, the same applies. Or if you mean --8<---------------cut here---------------start------------->8--- (source (git-reference (url "https://example.org") (commit "583ccbc1275c7701dc4843ec12142ff86bb305b")) --8<---------------cut here---------------end--------------->8--- Then that wouldn't be too hard to support. There seem to be ~136 packages with this idiom. > (Maybe (a) and (b) can be used as test cases.) > > FWIW, I had a try at supporting git-fetch origins in "--with-latest" and > "guix refresh -e" myself, and had to modify 'package-update' to replace > commit strings. IIRC, it supports (b), but not (a). The patch is > attached, hopefully it will be useful. > > Greetings, > Maxime. > > diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm > index 4264341d6a..2904c3f94a 100644 > --- a/guix/import/minetest.scm > +++ b/guix/import/minetest.scm > @@ -297,7 +297,7 @@ results. The return value is a list of records." > (define (make-minetest-sexp author/name version repository commit > inputs home-page synopsis > description media-license license) > - "Return a S-expression for the minetest package with the given author/NAME, > + "Return a S-expression for the minetest package with the given AUTHOR/NAME, > VERSION, REPOSITORY, COMMIT, INPUTS, HOME-PAGE, SYNOPSIS, DESCRIPTION, > MEDIA-LICENSE and LICENSE." > `(package > @@ -452,3 +452,37 @@ list of AUTHOR/NAME strings." > #:repo->guix-package minetest->guix-package* > #:guix-name > (compose contentdb->package-name author/name->name))) > + > +#| > +(define (minetest-package? pkg) > + (and (string-prefix? "minetest-" (package:package-name pkg)) > + (assq-ref (package:package-properties pkg) 'upstream-name))) > + > +(define (latest-minetest-release pkg) > + "Return an for the latest release of the package PKG." > + (define upstream-name > + (assoc-ref (package:package-properties pkg) 'upstream-name)) > + (define contentdb-package (contentdb-fetch upstream-name)) > + (define release (latest-release upstream-name)) > + (and contentdb-package release > + (and-let* ((old-origin (package:package-source pkg)) > + (old-reference (package:origin-uri old-origin)) > + (is-git? (download:git-reference? old-reference)) > + (commit (release-commit release))) > + (upstream-source > + (package (package:package-name pkg)) > + (version (release-title release)) > + (urls (download:git-reference > + (url (package-repository contentdb-package)) > + (commit commit))))))) Aha! This is actually what should be done, having the updater put the git-reference into upstream-source, since the updater is going to know better how to manipulate the uri. > + > +(define %minetest-updater > + (upstream-updater > + (name 'minetest) > + (description "Updater for Minetest packages on ContentDB") > + (pred minetest-package?) > + (latest latest-minetest-release))) > +|# > +;; #:use-module (guix upstream) > +;; #:use-module ((guix git-download) #:prefix download:) > +;; #:use-module ((guix packages) #:prefix package:) > diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm > index fb6c52a567..4f3bbbcb94 100644 > --- a/guix/scripts/refresh.scm > +++ b/guix/scripts/refresh.scm > @@ -28,8 +28,10 @@ > #:use-module (guix ui) > #:use-module (gcrypt hash) > #:use-module (guix scripts) > + #:use-module (guix serialization) > #:use-module ((guix scripts build) #:select (%standard-build-options)) > #:use-module (guix store) > + #:use-module (guix build utils) > #:use-module (guix utils) > #:use-module (guix packages) > #:use-module (guix profiles) > @@ -307,6 +309,17 @@ update would trigger a complete rebuild." > (G_ "no updater for ~a~%") > (package-name package))) > > + > +;; XXX adapted from (guix scripts hash) > +(define (file-hash file select? recursive?) > + ;; Compute the hash of FILE. > + (if recursive? > + (let-values (((port get-hash) (open-sha256-port))) > + (write-file file port #:select? select?) > + (force-output port) > + (get-hash)) > + (call-with-input-file file port-sha256))) > + > (define* (update-package store package updaters > #:key (key-download 'interactive) warn?) > "Update the source file that defines PACKAGE with the new version. > @@ -347,8 +360,8 @@ warn about packages that have no matching updater." > (package-name package) > (upstream-input-change-name change))) > (upstream-source-input-changes source)) > - (let ((hash (call-with-input-file tarball > - port-sha256))) > + (let ((hash (file-hash tarball (const #t) > + (directory-exists? tarball)))) > (update-package-source package source hash))) > (warning (G_ "~a: version ~a could not be \ > downloaded and authenticated; not updating~%") > diff --git a/guix/upstream.scm b/guix/upstream.scm > index 632e9ebc4f..61f67b57c1 100644 > --- a/guix/upstream.scm > +++ b/guix/upstream.scm > @@ -24,6 +24,11 @@ > #:use-module (guix discovery) > #:use-module ((guix download) > #:select (download-to-store url-fetch)) > + #:use-module ((guix git-download) > + #:select (git-fetch git-reference? > + git-reference-url > + git-reference-commit > + git-reference-recursive?)) > #:use-module (guix gnupg) > #:use-module (guix packages) > #:use-module (guix diagnostics) > @@ -33,6 +38,7 @@ > #:use-module (guix store) > #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) > #:autoload (gcrypt hash) (port-sha256) > + #:autoload (guix git) (latest-repository-commit) > #:use-module (guix monads) > #:use-module (srfi srfi-1) > #:use-module (srfi srfi-9) > @@ -93,7 +99,8 @@ > upstream-source? > (package upstream-source-package) ;string > (version upstream-source-version) ;string > - (urls upstream-source-urls) ;list of strings > + ; list of strings or a > + (urls upstream-source-urls) Is it possible for an updater to want to return a list of ? I'm still not sure what the purpose of multiple urls is, since nearly everthing seems to just take (first urls)... > (signature-urls upstream-source-signature-urls ;#f | list of strings > (default #f)) > (input-changes upstream-source-input-changes > @@ -361,6 +368,11 @@ values: 'interactive' (default), 'always', and 'never'." > system target) > "Download SOURCE from its first URL and lower it as a fixed-output > derivation that would fetch it." > + (define url > + (match (upstream-source-urls source) > + ((first . _) first) > + (_ (raise (formatted-message > + (G_ "git origins are unsupported by --with-latest")))))) > (mlet* %store-monad ((url -> (first (upstream-source-urls source))) > (signature > -> (and=> (upstream-source-signature-urls source) > @@ -430,9 +442,23 @@ SOURCE, an ." > #:key-download key-download))) > (values version tarball source)))))) What is this 'upstream-source-compiler' actually used for? I couldn't figure that out, so I just left it untouched. > > +(define* (package-update/git-fetch store package source #:key key-download) > + "Return the version, source code directory, and SOURCE, to update PACKAGE to > +SOURCE, an ." > + (match source > + (($ _ version ref _) > + (values version > + (latest-repository-commit > + store > + (git-reference-url ref) > + #:ref `(commit . ,(git-reference-commit ref)) > + #:recursive? (git-reference-recursive? ref)) > + source)))) > + > (define %method-updates > ;; Mapping of origin methods to source update procedures. > - `((,url-fetch . ,package-update/url-fetch))) > + `((,url-fetch . ,package-update/url-fetch) > + (,git-fetch . ,package-update/git-fetch))) > > (define* (package-update store package > #:optional (updaters (force %updaters)) > @@ -492,9 +518,22 @@ new version string if an update was made, and #f otherwise." > (origin-hash (package-source package)))) > (old-url (match (origin-uri (package-source package)) > ((? string? url) url) > + ((? git-reference? ref) > + (git-reference-url ref)) > (_ #f))) > (new-url (match (upstream-source-urls source) > - ((first _ ...) first))) > + ((first _ ...) first) > + ((? git-reference? ref) > + (git-reference-url ref)) > + (_ #f))) > + (old-commit (match (origin-uri (package-source package)) > + ((? git-reference? ref) > + (git-reference-commit ref)) > + (_ #f))) > + (new-commit (match (upstream-source-urls source) > + ((? git-reference? ref) > + (git-reference-commit ref)) > + (_ #f))) > (file (and=> (location-file loc) > (cut search-path %load-path <>)))) > (if file > @@ -508,6 +547,9 @@ new version string if an update was made, and #f otherwise." > 'filename file)) > (replacements `((,old-version . ,version) > (,old-hash . ,hash) > + ,@(if (and old-commit new-commit) > + `((,old-commit . ,new-commit)) > + '()) > ,@(if (and old-url new-url) > `((,(dirname old-url) . > ,(dirname new-url))) Thanks for sharing your work; it was very helpful! -- Sarah From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 17 Aug 2021 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: Xinglu Chen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162919552014956 (code B ref 50072); Tue, 17 Aug 2021 10:19:01 +0000 Received: (at 50072) by debbugs.gnu.org; 17 Aug 2021 10:18:40 +0000 Received: from localhost ([127.0.0.1]:51756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFwB6-0003tA-26 for submit@debbugs.gnu.org; Tue, 17 Aug 2021 06:18:40 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:52772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFwB2-0003sz-Ia for 50072@debbugs.gnu.org; Tue, 17 Aug 2021 06:18:38 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by andre.telenet-ops.be with bizsmtp id iaJa2500Q0mfAB401aJarM; Tue, 17 Aug 2021 12:18:35 +0200 Message-ID: <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> From: Maxime Devos Date: Tue, 17 Aug 2021 12:18:28 +0200 In-Reply-To: <86fsv9jh8h.fsf_-_@mgsn.dev> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86fsv9jh8h.fsf_-_@mgsn.dev> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-AH/+dNebwLIhoKM5nARb" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629195515; bh=jp/2pHV0Tj+XdZ8epX9Lk/Ju5XEcEvgfdciAka6dwoU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=DEJu7rOhh2GLqJb3l5lCTbNpl9SmQOrPT0yc6Z8ssoxV3lMjlsPxijxAAH0fuVxfs c1O31sv+9JHVaDfjrV2pLAcpiXzW5P4foK4Unth8V4bzbPXPGw5cvLQaWck6giBv/u UMisq9UdhMgFogonJ737Tpp0Zm3+5KBUvaojYkLYkbTZvWdJWXzAqLvEBAenBcEx/W qA5s5MZPvbQZ+EiL/HZVPcJWv57cXI/nYEYcfYesdPywFi7zl7hAc45mccTCBFAQ2L J9GilvNOpVVUb0Gx+FJ4HvJI5RLIsMiD3lhCkVtC+47LGJ+4fV+RFlXzlVYRXtAhdo radGMTVcyaX7w== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-AH/+dNebwLIhoKM5nARb Content-Type: multipart/mixed; boundary="=-yiIn7AhCV0N/+pc8ogPA" --=-yiIn7AhCV0N/+pc8ogPA Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sarah Morgensen schreef op ma 16-08-2021 om 12:56 [-0700]: > Hi Maxime, >=20 > Thanks for taking a look at this. :) >=20 > Maxime Devos writes: >=20 > > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: > > > * guix/git-download.scm (checkout-to-store): New procedure. > > > * guix/upstream.scm (guess-version-transform) > > > (package-update/git-fetch): New procedures. > > > (%method-updates): Add GIT-FETCH mapping. > >=20 > > Does it support packages defined like (a) > >=20 > > (define-public gnash > > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > > (revision "0")) > > (package > > (name "gnash") > > (version (git-version "0.8.11" revision commit)) > > (source (git-reference > > (url "https://example.org") > > (commit commit))) > > [...]))) >=20 > No, it doesn't. Since the commit definition isn't part of the actual > package definition, the current code has no way of updating it. It > would require a rewrite of the edit-in-place logic with probably a lot > of special-casing. Perhaps a 'surrounding-expression-location' procedure can be defined? (define (surrounding-expression-location inner-location) "Determine the location of the S-expression that surrounds the S-expressi= on at INNER-LOCATION, or #false if the inner S-expression is at the top-level.= " ??? Something like 'read', but in reverse, maybe? Doesn't need to support every construct, just "string without escapes" an= d (parentheses other-things) might be good enough in practice for now) Seems tricky to implement, but it would be more robust than relying on conventions like =E2=80=98the surrounding 'let' can be found by moving t= wo columns and two lines backwards=E2=80=99. Or see another method (let&) below that = is actually implemented ... > There are currently ~1250 package which use this format, though, so it > could be worth it... Perhaps what we actually need is a better idiom to > express this situation. Package properties ('git-commit)? A 'git-versio= n*'? >=20 > --8<---------------cut here---------------start------------->8--- > (define (git-version* version revision) > (let* ((source (package-source this-package)) > (commit (git-reference-commit (origin-uri source)))) > (git-version version revision commit))) > --8<---------------cut here---------------end--------------->8--- >=20 > I'm not sure if binding order would be an issue with that. The 'file-name' field of 'origin' is not thunked, and refers to the 'versio= n' field of the 'package' (also not thunked). If 'version' would use the 'git= -version*' from above, then there would be a loop (I'm having the 'gnash' package in m= ind, see "guix edit gnash"). And git-version* cannot be a procedure, it must be= a macro, as it used 'this-package', which can only be expanded inside a package defi= nition. Alternatively, what do you think of a let& macro, that adjusts the inner ex= pression to have the source location of the 'let&' form: (define-syntax with-source-location (lambda (s) (syntax-case s () ((_ (exp . exp*) source) "Expand to (EXP . EXP*), but with the source location replaced by the source location of SOURCE." (datum->syntax s (cons #'exp #'exp*) #:source (syntax-source #'sourc= e)))))) (define-syntax let& (lambda (s) "Like 'let', but let the inner expression have the location of the 'let&' form when it is expanded. Only a single inner expression is allowed." (syntax-case s () ((_ bindings exp) #'(let bindings (with-source-location exp s)))))) That way, 'update-package-source' doesn't need to know about the surroundin= g 'let' form; it would simply use 'edit-expression' as usual (though somethin= g like ,@(if (and old-commit new-commit) `((,old-commit . ,new-commit)) '()) would need to be added, and something to replace =E2=80=98(revision "N")=E2= =80=99 with =E2=80=98(revision "N+1")=E2=80=99.) A complete example is attached (a.scm). The previous usages of (let ((commit ...) (revision ...)) ...) would need to be adjusted to use let& instead (build-aux/update-guix-package.scm needs to be adjusted as well). Personally, I'd go with the 'let&' form > > and (b) > >=20 > > (define-public gnash > > (package > > (name "gnash") > > (version "0.8.11") > > (source (git-reference > > (url "https://example.org") > > (commit commit)) > > [...])) > > ? >=20 > Is this missing a definition for commit? If it's like above, the same > applies. Or if you mean >=20 > --8<---------------cut here---------------start------------->8--- > (source (git-reference > (url "https://example.org") > (commit "583ccbc1275c7701dc4843ec12142ff86bb305b")) > --8<---------------cut here---------------end--------------->8--- The latter. > Then that wouldn't be too hard to support. There seem to be ~136 > packages with this idiom. FWIW, the patch I sent modified 'update-package-source' to replace the commit in this case (b) (but not case (a)). > > [the patch Maxime sent] > >=20 > > upstream-source? > > (package upstream-source-package) ;string > > (version upstream-source-version) ;string > > - (urls upstream-source-urls) ;list of strings > > + ; list of strings or a > > + (urls upstream-source-urls) >=20 > Is it possible for an updater to want to return a list of > ? No, 'git-fetch' from (guix git-download) only accepts a single object, it doesn't support lists of . It will throw a type error if a list is passed. Compare with 'url-fetch*', which does accept a = list of URLs (in which case it will fall-back to the second, the third, the four= th ... entry when the first entry gives a 404 or something). > I'm still not sure what the purpose of multiple urls > is, since nearly everthing seems to just take (first urls)... As I understand it, the second, third, fourth ... URL (when using url-fetch= ) are fall-backs. Also, (guix upstream) sometimes distinguishes between the different URLs, see e.g. package-update/url-fetch, which will try to choose= a tarball with the same kind of extension (.zip, .tar.gz, .tar.xz, ...) as th= e original URI. > > (signature-urls upstream-source-signature-urls ;#f | list of string= s > > (default #f)) > > (input-changes upstream-source-input-changes > > @@ -361,6 +368,11 @@ values: 'interactive' (default), 'always', and 'ne= ver'." > > system target) > > "Download SOURCE from its first URL and lower it as a fixed-output > > derivation that would fetch it." > > + (define url > > + (match (upstream-source-urls source) > > + ((first . _) first) > > + (_ (raise (formatted-message > > + (G_ "git origins are unsupported by --with-latest")))= ))) > > (mlet* %store-monad ((url -> (first (upstream-source-urls source))) > > (signature > > -> (and=3D> (upstream-source-signature-urls so= urce) > > @@ -430,9 +442,23 @@ SOURCE, an ." > > #:key-download key-download))) > > (values version tarball source)))))) >=20 > What is this 'upstream-source-compiler' actually used for? I couldn't > figure that out, so I just left it untouched. It is used to =E2=80=98lower=E2=80=99 objects. More spec= ifically, transform-package-latest from (guix transformations) will sometimes replace the 'source' of a package with a object, and 'upstream-source-compiler' is used to turn the into a (fixed-output) derivation that can be built into a /gnu/store/...-checkout or /gnu/store/...-version.tar.gz file in the store. Greetings, Maxime --=-yiIn7AhCV0N/+pc8ogPA Content-Disposition: inline; filename="a.scm" Content-Type: text/x-scheme; name="a.scm"; charset="UTF-8" Content-Transfer-Encoding: base64 Ozs7IEdOVSBHdWl4IC0tLSBGdW5jdGlvbmFsIHBhY2thZ2UgbWFuYWdlbWVudCBmb3IgR05VCjs7 OyBDb3B5cmlnaHQgwqkgMjAyMSBNYXhpbWUgRGV2b3MgPG1heGltZWRldm9zQHRlbGVuZXQuYmU+ Cjs7Owo7OzsgVGhpcyBmaWxlIGlzIHBhcnQgb2YgR05VIEd1aXguCjs7Owo7OzsgR05VIEd1aXgg aXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBp dAo7OzsgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBh cyBwdWJsaXNoZWQgYnkKOzs7IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2 ZXJzaW9uIDMgb2YgdGhlIExpY2Vuc2UsIG9yIChhdAo7OzsgeW91ciBvcHRpb24pIGFueSBsYXRl ciB2ZXJzaW9uLgo7OzsKOzs7IEdOVSBHdWl4IGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo YXQgaXQgd2lsbCBiZSB1c2VmdWwsIGJ1dAo7OzsgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhv dXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgo7OzsgTUVSQ0hBTlRBQklMSVRZIG9yIEZJ VE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQo7OzsgR05VIEdlbmVyYWwg UHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KOzs7Cjs7OyBZb3Ugc2hvdWxkIGhhdmUg cmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQo7OzsgYWxv bmcgd2l0aCBHTlUgR3VpeC4gIElmIG5vdCwgc2VlIDxodHRwOi8vd3d3LmdudS5vcmcvbGljZW5z ZXMvPi4KCih1c2UtbW9kdWxlcyAoZ3VpeCBwYWNrYWdlcykKICAgICAgICAgICAgIChnbnUgcGFj a2FnZXMgYW5pbWF0aW9uKQogICAgICAgICAgICAgKGd1aXggZ2l0LWRvd25sb2FkKSkKCihkZWZp bmUtc3ludGF4IHdpdGgtc291cmNlLWxvY2F0aW9uCiAgKGxhbWJkYSAocykKICAgIChzeW50YXgt Y2FzZSBzICgpCiAgICAgICgoXyAoZXhwIC4gZXhwKikgc291cmNlKQogICAgICAgIkV4cGFuZCB0 byAoRVhQIC4gRVhQKiksIGJ1dCB3aXRoIHRoZSBzb3VyY2UgbG9jYXRpb24gcmVwbGFjZWQKYnkg dGhlIHNvdXJjZSBsb2NhdGlvbiBvZiBTT1VSQ0UuIgogICAgICAgKGRhdHVtLT5zeW50YXggcyAo Y29ucyAjJ2V4cCAjJ2V4cCopICM6c291cmNlIChzeW50YXgtc291cmNlICMnc291cmNlKSkpKSkp CgooZGVmaW5lLXN5bnRheCBsZXQmCiAgKGxhbWJkYSAocykKICAgICJMaWtlICdsZXQnLCBidXQg bGV0IHRoZSBpbm5lciBleHByZXNzaW9uIGhhdmUgdGhlIGxvY2F0aW9uCm9mIHRoZSAnbGV0Jicg Zm9ybSB3aGVuIGl0IGlzIGV4cGFuZGVkLiAgT25seSBhIHNpbmdsZSBpbm5lcgpleHByZXNzaW9u IGlzIGFsbG93ZWQuIgogICAgKHN5bnRheC1jYXNlIHMgKCkKICAgICAgKChfIGJpbmRpbmdzIGV4 cCkKICAgICAgICMnKGxldCBiaW5kaW5ncwogICAgICAgICAgICh3aXRoLXNvdXJjZS1sb2NhdGlv biBleHAgcykpKSkpKQoKCihkZWZpbmUtcHVibGljIGduYXNoMgogIDs7IFRoZSBsYXN0IHRhZ2dl ZCByZWxlYXNlIG9mIEduYXNoIHdhcyBpbiAyMDEzLgogIChsZXQmICgoY29tbWl0ICI1ODNjY2Jj MTI3NWM3NzAxZGM0ODQzZWMxMjE0MmZmODZiYjMwNWI0IikKICAgICAgICAgKHJldmlzaW9uICIw IikpCiAgICAocGFja2FnZQogICAgICAoaW5oZXJpdCBnbmFzaCkKICAgICAgKG5hbWUgImduYXNo MiIpCiAgICAgICh2ZXJzaW9uIChnaXQtdmVyc2lvbiAiMC44LjExIiByZXZpc2lvbiBjb21taXQp KQogICAgICAoc291cmNlCiAgICAgICAob3JpZ2luCiAgICAgICAgIChtZXRob2QgZ2l0LWZldGNo KQogICAgICAgICAodXJpIChnaXQtcmVmZXJlbmNlCiAgICAgICAgICAgICAgICh1cmwgImh0dHBz Oi8vZ2l0LnNhdmFubmFoLmdudS5vcmcvZ2l0L2duYXNoLmdpdC8iKQogICAgICAgICAgICAgICAo Y29tbWl0IGNvbW1pdCkpKQogICAgICAgICAoZmlsZS1uYW1lIChnaXQtZmlsZS1uYW1lIG5hbWUg dmVyc2lvbikpCiAgICAgICAgIChwYXRjaGVzIChzZWFyY2gtcGF0Y2hlcyAiZ25hc2gtZml4LWdp ZmxpYi12ZXJzaW9uLnBhdGNoIikpCiAgICAgICAgIChzaGEyNTYKICAgICAgICAgIChiYXNlMzIg IjBmaDBibGpuMGk2eXB5aDZsOTlhZmk4NTVwN2tpN2xtODY5bnExcWo2azhocnJ3aG1mcnkiKSkp KSkpKQoKKGZvcm1hdCAjdCAib2xkOiB+YX4lIiAocGFja2FnZS1sb2NhdGlvbiBnbmFzaCkpCihm b3JtYXQgI3QgIm5ldzogfmF+JSIgKHBhY2thZ2UtbG9jYXRpb24gZ25hc2gyKSkKOzsgXiBpdCBz YXlzIGNvbHVtbiAyLCB3aGljaCBpcyB0aGUgY29sdW1uIG9mIHRoZSBsZXQmIGZvcm0uCg== --=-yiIn7AhCV0N/+pc8ogPA-- --=-AH/+dNebwLIhoKM5nARb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYRuM9BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sCHAP9xBj75KhXqSDRyCSSQFyATroZ3 K22ko8hK0JHF1DtoFAD/U7vAsQq8rQXjBlwMe2f+W0O55HD6OTDRwZ99pKRdwwo= =BfS0 -----END PGP SIGNATURE----- --=-AH/+dNebwLIhoKM5nARb-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 Aug 2021 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.162929795413896 (code B ref 50072); Wed, 18 Aug 2021 14:46:02 +0000 Received: (at 50072) by debbugs.gnu.org; 18 Aug 2021 14:45:54 +0000 Received: from localhost ([127.0.0.1]:57209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGMpB-0003Xu-Kc for submit@debbugs.gnu.org; Wed, 18 Aug 2021 10:45:53 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:58368 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGMp5-0003Lk-Ek for 50072@debbugs.gnu.org; Wed, 18 Aug 2021 10:45:48 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1629297932; bh=Pbsr4GAOeBvVspx8pYJkYdGlGX0xZ/d5bmOPe8s/DZI=; h=From:To:Subject:In-Reply-To:References:Date; b=g/V8d767FNKL3PiY5FxDc54Qy9TZi13IkcgRQxzvvsql/EnSYdQk+9hOhhNw6fep9 F097GVho4u4kTuyfbwO2hmLMR37/ws2l3W6PvvgFquWbWWjpFMRr/Ui1LhWZbru6fW 9Wr1bhQ9KCXBrSSyjslL33SsYOCS5HoOEwL7FJmU= In-Reply-To: <12f985cd431b8b8099f680a3b25ed2eb90e6b26d.camel@telenet.be> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <87wnol8rw3.fsf@yoctocell.xyz> <12f985cd431b8b8099f680a3b25ed2eb90e6b26d.camel@telenet.be> Date: Wed, 18 Aug 2021 16:45:11 +0200 Message-ID: <878s0yke14.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, Aug 16 2021, Maxime Devos wrote: > Xinglu Chen schreef op ma 16-08-2021 om 15:02 [+0200]: >> On Mon, Aug 16 2021, Maxime Devos wrote: >> >> > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> > > * guix/git-download.scm ( [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, Aug 16 2021, Maxime Devos wrote: > Xinglu Chen schreef op ma 16-08-2021 om 15:02 [+0200]: >> On Mon, Aug 16 2021, Maxime Devos wrote: >> >> > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> > > * guix/git-download.scm ( [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Aug 16 2021, Maxime Devos wrote: > Xinglu Chen schreef op ma 16-08-2021 om 15:02 [+0200]: >> On Mon, Aug 16 2021, Maxime Devos wrote: >>=20 >> > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> > > * guix/git-download.scm (checkout-to-store): New procedure. >> > > * guix/upstream.scm (guess-version-transform) >> > > (package-update/git-fetch): New procedures. >> > > (%method-updates): Add GIT-FETCH mapping. >> >=20 >> > Does it support packages defined like (a) >> >=20 >> > (define-public gnash >> > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") >> > (revision "0")) >> > (package >> > (name "gnash") >> > (version (git-version "0.8.11" revision commit)) >> > (source (git-reference >> > (url "https://example.org") >>=20 >> IIUC, it only supports GitHub URLs at the moment. I have a WIP patch >> for adding support for any arbitrary Git repository[1]. > > This patch series doesn't mention GitHub anywhere (except in the patch > series description) so I don't think it only supports GitHub URLs. > Admittedly, only one updater, "github", currently produces git-reference > URLs, That was what I was referring to, sorry for not making it clearer. Only the =E2=80=98github=E2=80=99 updater can update =E2=80=98git-fetch=E2= =80=99 origins; =3D> only GitHub URLs can are recognized by the =E2=80=98github=E2=80=99 up= dater; =3D> thus, only packages hosted on GitHub can be updated. > but I sent a patch series [2] that adds an importer which produces > git-reference URLs and the corresponding updater (see =E2=80=98git-fetch.= patch=E2=80=99) > produces appropriate git-reference objects. > > [2]: . I haven=E2=80=99t looked at the patches yet, but that looks very cool! :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmEdHPcVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5iSgQAIzTNsUOYtetadiDvv7HCvaXGbG4 RSC+bJmKVaayMPBsOcSPOIkiT+YwYambXyGSZqyyuxc6oSbBXtmuUHxD63tpoYIJ NMutoH8f4GLsJxLwojZP+OWoduIC8cQtyxr24KJyqN58tIkFgg+QYihGPktg9CsN XI8AurDzCA8DFnT1r6sDM3+5zQV7PTKBvRavPh6bJDvUQgh7m3rNOu7rfC8XGcO7 VAOIHni8TW66MKcgXHDVLlSxzG9Ab0OhpaTSOKhcNNc0dGjrp4jR+CMqjR8Yg+bO 7JB6fWfEYJRxjHV27NslJ26qn7NgpXEIDoXUSxAT7C0qQ81Xv0RCavV7ZT6USb0R NpQCNcblrV0maoYP2aQPSvKNSTTI9t19Z5jBghQZ0iuIUpu6lhf12BULemR+Pv3O 6yy9m3OOLvaMJRzQjs4BmVqHaUMaYrpNODl6f3TrBEWW6eBaV6YU5qm4Ub+u8glM fCiiCexYjMeJZhftS3M5FQnWMMk31Li+11uuixT73kARVW3ukNZothcQAX3KSG0d +jP/gPeunZ0EwAAlVYEmo8A8h6MZtyP8DMlAo0fvc7XuTeMbSnD9Dx/DsTb4niOj SWi7zeqxJS6koXAFd3KnOZ6steMEBZZuBvak74UOMVK0cK/y0Pm3k/gG86VmufF9 j/jetFShbiDluYa6 =Ct9e -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 30 Aug 2021 21:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: Xinglu Chen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.1630359393507 (code B ref 50072); Mon, 30 Aug 2021 21:37:02 +0000 Received: (at 50072) by debbugs.gnu.org; 30 Aug 2021 21:36:33 +0000 Received: from localhost ([127.0.0.1]:60524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKoxE-000086-Pw for submit@debbugs.gnu.org; Mon, 30 Aug 2021 17:36:33 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:60426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKoxD-00007w-6R for 50072@debbugs.gnu.org; Mon, 30 Aug 2021 17:36:31 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by andre.telenet-ops.be with bizsmtp id nxcV250010mfAB401xcV83; Mon, 30 Aug 2021 23:36:29 +0200 Message-ID: <2c76cd38605f4358df29ed0d464a8f5512b1b662.camel@telenet.be> From: Maxime Devos Date: Mon, 30 Aug 2021 23:36:28 +0200 In-Reply-To: <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86fsv9jh8h.fsf_-_@mgsn.dev> <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-2SRZl0L+QxP2qcI0kBXc" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630359389; bh=2haoJGEyEXryPRNsEylaoN7w6eEKtjHUIhKYdkC2zTs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lki+YMZLgGfbTltLk/9GQHq6BC38Ms4FZOK+RjlwjuOgKaN5KUZsuEDUdJa+vKPPS 68aB1/RH3rSdJAbujO4nRZZEjXXRbQcvEGAVuaDH/0RkGgQs8RQWyts431/yeUtbHx Idl9nV9RfvTVDN1k9c8B3Pkfr6OAJg0/7aiIfPauf5MjUA4JL7rlTa4ao4XgaDUSGo rtdZQkR5SANAawih2Mds+7/V6und3bjQ176MUsrGA5RvXs4KfKoaPPqxfb1bs1CVZ4 0D0/cL0INN21HIsoH5OdRac7RBy5piQbRr0vCFuMcN93p32GMx7vxyF6/IL3sl9fiS SP83IuE1PFMKg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-2SRZl0L+QxP2qcI0kBXc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxime Devos schreef op di 17-08-2021 om 12:18 [+0200]: > [... stuff about let&, let*&, supporting packages like: > > > (define-public gnash > > > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > > > (revision "0")) > > > (package > > > (name "gnash") > > > (version (git-version "0.8.11" revision commit)) > > > (source (git-reference > > > (url "https://example.org") > > > (commit commit))) > > > [...]))) > > ... > ... by fudging the source locations ...] I went ahead and send a patch replacing 'let' with 'let&': . Greetings, Maxime. --=-2SRZl0L+QxP2qcI0kBXc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYS1PXBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7h2rAP0VJi/wmuk0zSVG122dfNY7jHOM b27we11DqPJz77yfpgEA8Io5XvYfNa2WMyAt84BkSWyM/IlMlsrnLUtm9ImBcQM= =P2nY -----END PGP SIGNATURE----- --=-2SRZl0L+QxP2qcI0kBXc-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 10:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , Xinglu Chen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163092381832585 (code B ref 50072); Mon, 06 Sep 2021 10:24:01 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Sep 2021 10:23:38 +0000 Received: from localhost ([127.0.0.1]:52025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBmo-0008TR-Uj for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:23:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBmn-0008TD-RL for 50072@debbugs.gnu.org; Mon, 06 Sep 2021 06:23:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34512) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNBmg-0005Lu-18; Mon, 06 Sep 2021 06:23:26 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47198 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNBmf-0005sm-Oj; Mon, 06 Sep 2021 06:23:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86fsv9jh8h.fsf_-_@mgsn.dev> <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> Date: Mon, 06 Sep 2021 12:23:23 +0200 In-Reply-To: <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> (Maxime Devos's message of "Tue, 17 Aug 2021 12:18:28 +0200") Message-ID: <87k0ju80kk.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Maxime Devos skribis: > Sarah Morgensen schreef op ma 16-08-2021 om 12:56 [-0700]: >> Hi Maxime, >>=20 >> Thanks for taking a look at this. :) >>=20 >> Maxime Devos writes: >>=20 >> > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> > > * guix/git-download.scm (checkout-to-store): New procedure. >> > > * guix/upstream.scm (guess-version-transform) >> > > (package-update/git-fetch): New procedures. >> > > (%method-updates): Add GIT-FETCH mapping. >> >=20 >> > Does it support packages defined like (a) >> >=20 >> > (define-public gnash >> > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") >> > (revision "0")) >> > (package >> > (name "gnash") >> > (version (git-version "0.8.11" revision commit)) >> > (source (git-reference >> > (url "https://example.org") >> > (commit commit))) >> > [...]))) >>=20 >> No, it doesn't. Since the commit definition isn't part of the actual >> package definition, the current code has no way of updating it. It >> would require a rewrite of the edit-in-place logic with probably a lot >> of special-casing. > > Perhaps a 'surrounding-expression-location' procedure can be defined? > > (define (surrounding-expression-location inner-location) > "Determine the location of the S-expression that surrounds the S-expres= sion > at INNER-LOCATION, or #false if the inner S-expression is at the top-leve= l." > ??? Something like 'read', but in reverse, maybe? > Doesn't need to support every construct, just "string without escapes" = and > (parentheses other-things) might be good enough in practice for now) > > Seems tricky to implement, but it would be more robust than relying > on conventions like =E2=80=98the surrounding 'let' can be found by moving= two columns > and two lines backwards=E2=80=99. Or see another method (let&) below tha= t is actually > implemented ... I think we can work incrementally. It wouldn=E2=80=99t be unreasonable to = start with a =E2=80=98definition-location=E2=80=99 procedure that would work in a= way similar to =E2=80=98package-field-location=E2=80=99 (essentially =E2=80=98read=E2= =80=99 each top-level sexp of the file and record the location of the one that immediately precedes the package location.) But maybe the discussion in will give us something nice. Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 10:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16309240911212 (code B ref 50072); Mon, 06 Sep 2021 10:29:01 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Sep 2021 10:28:11 +0000 Received: from localhost ([127.0.0.1]:52043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBrG-0000JU-Ux for submit@debbugs.gnu.org; Mon, 06 Sep 2021 06:28:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNBrF-0000JH-QZ for 50072@debbugs.gnu.org; Mon, 06 Sep 2021 06:28:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34870) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNBrA-00015F-Kd; Mon, 06 Sep 2021 06:28:04 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=47200 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNBqr-0000Yf-O9; Mon, 06 Sep 2021 06:27:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> Date: Mon, 06 Sep 2021 12:27:42 +0200 In-Reply-To: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> (Sarah Morgensen's message of "Sun, 15 Aug 2021 16:25:27 -0700") Message-ID: <87fsui80dd.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Sarah, I like this patch series. :-) Sarah Morgensen skribis: > * guix/git-download.scm (checkout-to-store): New procedure. > * guix/upstream.scm (guess-version-transform) > (package-update/git-fetch): New procedures. > (%method-updates): Add GIT-FETCH mapping. This LGTM. Nitpick: > +(define* (checkout-to-store store ref #:key (log (current-error-port))) > + "Checkout REF to STORE. Write progress reports to LOG. RECURSIVE? ha= s the > +same effect as the same-named parameter of 'latest-repository-commit'." > + ;; XXX: (guix git) does not use shallow clones, so this will be slow > + ;; for long-running repositories. > + (match-record ref [...] > + ;; Only use the first element of URLS. > + (match-record source > + (version urls) I=E2=80=99d use the record acceesors in this cases rather than =E2=80=98mat= ch-record=E2=80=99; currently =E2=80=98match-record=E2=80=99 is not super efficient and I find = it slightly less readable when you=E2=80=99re just accessing a couple of fields. Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 11:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Sarah Morgensen , Xinglu Chen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163092886818266 (code B ref 50072); Mon, 06 Sep 2021 11:48:02 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Sep 2021 11:47:48 +0000 Received: from localhost ([127.0.0.1]:52208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mND6J-0004kY-VA for submit@debbugs.gnu.org; Mon, 06 Sep 2021 07:47:48 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:55228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mND6H-0004kJ-EO for 50072@debbugs.gnu.org; Mon, 06 Sep 2021 07:47:46 -0400 Received: from butterfly.local ([188.188.57.172]) by michel.telenet-ops.be with bizsmtp id qbni250053ix9AL06bniSq; Mon, 06 Sep 2021 13:47:43 +0200 Message-ID: <10996c63a8690ceea6c88a5fc88ddabad7b000dd.camel@telenet.be> From: Maxime Devos Date: Mon, 06 Sep 2021 13:47:35 +0200 In-Reply-To: <87k0ju80kk.fsf_-_@gnu.org> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86fsv9jh8h.fsf_-_@mgsn.dev> <7986923ce7712dc341e859e62675abee12072922.camel@telenet.be> <87k0ju80kk.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-v5Hhn2n+7sUb2T2OY7dt" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630928863; bh=+wgEu9X7wVJIzWD/KjNKPrKL7CGeR9Fe11JK3/vWzq4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KNtzuNSN5MsmsNen0vw5N6ysNiJ1yNdt7of3z7Q0hutN6D2o4uN7rAkOOamron42s UAsdJLDZo1H38PXxx/uICTubxJoGetZGnFHC7T2v0h1AxFF3RzYU+Wu8Ogyl5+XthS lGBM0e6wabAKHwQw22dweve0l+3L9/7ZObqJlxoPmyoeMdbt/xp93QZz0J0RAbHbGL zuIFVyTseHB0GIeQwDQe80en1Edy3v1UomZ80B+7fABMqNKJ92oqQ1ScOime/C510+ kkYtlsfVwzSsAqqei59Y0GxjhXaogpoDnEHDd2+hWGQBKep9MuvXvnBYjquWZDeuOa WauI2ZuJpvJzQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-v5Hhn2n+7sUb2T2OY7dt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Ludovic Court=C3=A8s schreef op ma 06-09-2021 om 12:23 [+0200]: > > > >=20 > > > > [...] > > > > Does it support packages defined like (a) > > > >=20 > > > > (define-public gnash > > > > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > > > > (revision "0")) > > > > (package > > > > (name "gnash") > > > > (version (git-version "0.8.11" revision commit)) > > > > (source (git-reference > > > > (url "https://example.org") > > > > (commit commit))) > > > > [...]))) > > >=20 > > > No, it doesn't. Since the commit definition isn't part of the actual > > > package definition, the current code has no way of updating it. It > > > would require a rewrite of the edit-in-place logic with probably a lo= t > > > of special-casing. > >=20 > > Perhaps a 'surrounding-expression-location' procedure can be defined? > >=20 > > (define (surrounding-expression-location inner-location) > > "Determine the location of the S-expression that surrounds the S-expr= ession > > at INNER-LOCATION, or #false if the inner S-expression is at the top-le= vel." > > ??? Something like 'read', but in reverse, maybe? > > Doesn't need to support every construct, just "string without escapes= " and > > (parentheses other-things) might be good enough in practice for now) > >=20 > > Seems tricky to implement, but it would be more robust than relying > > on conventions like =E2=80=98the surrounding 'let' can be found by movi= ng two columns > > and two lines backwards=E2=80=99. Or see another method (let&) below t= hat is actually > > implemented ... >=20 > I think we can work incrementally. It wouldn=E2=80=99t be unreasonable t= o start > with a =E2=80=98definition-location=E2=80=99 procedure that would work in= a way similar > to =E2=80=98package-field-location=E2=80=99 (essentially =E2=80=98read=E2= =80=99 each top-level sexp of > the file and record the location of the one that immediately precedes > the package location.) =E2=80=98package-field-location=E2=80=99 (currently) doesn't work like that= . Currently, it extracts the location from the package, opens the file, uses a procedure 'goto' that works like 'seek' except that it accepts line and column number= s instead of byte offsets. What you proposed could work, though it seems a bit inefficient to me. Asking upstream for an update probably takes a lot more time though. > But maybe the discussion in will > give us something nice. Greetings, Maxime --=-v5Hhn2n+7sUb2T2OY7dt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTX/1xccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ophAQC7GSfWH0C/M+dLr8Jkdg0mny/r yoG85v0kcMpD6jIk/AD+MgzJwEj1oLYkRndZc9Ql4ILaODgpj0tHD0orEEKA/gk= =koNy -----END PGP SIGNATURE----- --=-v5Hhn2n+7sUb2T2OY7dt-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 01:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163097737519280 (code B ref 50072); Tue, 07 Sep 2021 01:17:02 +0000 Received: (at 50072) by debbugs.gnu.org; 7 Sep 2021 01:16:15 +0000 Received: from localhost ([127.0.0.1]:54861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNPih-00050t-FZ for submit@debbugs.gnu.org; Mon, 06 Sep 2021 21:16:15 -0400 Received: from out0.migadu.com ([94.23.1.103]:58996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNPid-00050i-SB for 50072@debbugs.gnu.org; Mon, 06 Sep 2021 21:16:13 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1630977370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8iyvOhaY+3kNs84M8MiKXnW9p8M5JIIje9zC1QfALbc=; b=RDOlMmEUscGwwLv1AmShUgkF9OabDNc05xRhDf0FOHrSlvSQgvBOsuG8K5wt1s5IK8IXrD jOvdo7GbQaUdW0wC77xQ+Q3dgrEW8WrUOxEmr/0ssb0E1lTOdoUFOp3qUhc3ls1g243gsj JbBwAX/59hkSPRxIFiuyTsqrkrI6lSc= From: Sarah Morgensen References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> Date: Mon, 06 Sep 2021 18:16:08 -0700 In-Reply-To: (Maxime Devos's message of "Mon, 16 Aug 2021 12:46:25 +0200 (3 weeks, 14 hours, 27 minutes ago)") Message-ID: <86mtopi3s7.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Maxime, Maxime Devos writes: > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetch): New procedures. >> (%method-updates): Add GIT-FETCH mapping. > > Does it support packages defined like (a) > > (define-public gnash > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > (revision "0")) > (package > (name "gnash") > (version (git-version "0.8.11" revision commit)) > (source (git-reference > (url "https://example.org") > (commit commit))) > [...]))) Thinking about this again, since updaters typically returns actual versions (tags) instead of commits, how much would such a feature be used? OTOH, I could definitely see use for an ability to update packages like these to proper versions (removing the surrounding 'let') but that's probably more rare and may not be worth the implementation effort. -- SEarah From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 02:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163098000723354 (code B ref 50072); Tue, 07 Sep 2021 02:01:01 +0000 Received: (at 50072) by debbugs.gnu.org; 7 Sep 2021 02:00:07 +0000 Received: from localhost ([127.0.0.1]:54880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNQP8-00064b-Rq for submit@debbugs.gnu.org; Mon, 06 Sep 2021 22:00:07 -0400 Received: from out2.migadu.com ([188.165.223.204]:20950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNQP5-00063G-67 for 50072@debbugs.gnu.org; Mon, 06 Sep 2021 22:00:04 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1630980001; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=sD4XhDKWWQF65W3dGTImGWwLVGH3Ic6CCmA7eteB6vE=; b=kgA6Tqo2QJE8t/TRhMmPfBuf3qMZk1DSeg6Yb7CyCu9AH7mrgijxuCOaIyzqaD+7gVjTLO i0/trvhW1Ta/KRo9VV7i4G6o4cE7TjH1c43msJ8U9+unHOP8jfOyPl3it221Oso7N7JY5E IzFIi3DmWFjCvONpTJzXHHNTd4uqNyo= From: Sarah Morgensen References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <87fsui80dd.fsf_-_@gnu.org> Date: Mon, 06 Sep 2021 18:59:59 -0700 In-Reply-To: <87fsui80dd.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 06 Sep 2021 12:27:42 +0200 (14 hours, 48 minutes, 39 seconds ago)") Message-ID: <86k0jti1r4.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo, Ludovic Court=C3=A8s writes: > Hi Sarah, > > I like this patch series. :-) Thanks for taking a look! > > Sarah Morgensen skribis: > >> * guix/git-download.scm (checkout-to-store): New procedure. >> * guix/upstream.scm (guess-version-transform) >> (package-update/git-fetch): New procedures. >> (%method-updates): Add GIT-FETCH mapping. > > This LGTM. Thanks. WDYT about pre-emptively adding support for non-url URIs as well? That is, 1. change "urls" in to "uri" 2. in 'git-fetch' a) if the upstream-source-uri is a git-reference, just use it as-is rather than guessing the tag b) if it's not, return an 'upstream-source' with a git-reference URI=20 3. update 'upstream-source-compiler' to work for git-reference URIs. If there are no objections, I think I'll make those changes and send that as a proper patch. > > Nitpick: > >> +(define* (checkout-to-store store ref #:key (log (current-error-port))) >> + "Checkout REF to STORE. Write progress reports to LOG. RECURSIVE? h= as the >> +same effect as the same-named parameter of 'latest-repository-commit'." >> + ;; XXX: (guix git) does not use shallow clones, so this will be slow >> + ;; for long-running repositories. >> + (match-record ref > > [...] > >> + ;; Only use the first element of URLS. >> + (match-record source >> + (version urls) > > I=E2=80=99d use the record acceesors in this cases rather than =E2=80=98m= atch-record=E2=80=99; > currently =E2=80=98match-record=E2=80=99 is not super efficient and I fin= d it slightly > less readable when you=E2=80=99re just accessing a couple of fields. Fair. I got a little excited to discover new syntax :) -- Sarah From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 10:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163100884715849 (code B ref 50072); Tue, 07 Sep 2021 10:01:02 +0000 Received: (at 50072) by debbugs.gnu.org; 7 Sep 2021 10:00:47 +0000 Received: from localhost ([127.0.0.1]:55449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNXuI-00047Z-Vi for submit@debbugs.gnu.org; Tue, 07 Sep 2021 06:00:47 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:37340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNXuH-00047O-2y for 50072@debbugs.gnu.org; Tue, 07 Sep 2021 06:00:45 -0400 Received: from butterfly.local ([188.188.3.227]) by laurent.telenet-ops.be with bizsmtp id qy0i2500W4tskic01y0jej; Tue, 07 Sep 2021 12:00:43 +0200 Message-ID: <470a95f159120d14384c3096cff91e3ce8d3c6c8.camel@telenet.be> From: Maxime Devos Date: Tue, 07 Sep 2021 12:00:42 +0200 In-Reply-To: <86mtopi3s7.fsf@mgsn.dev> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86mtopi3s7.fsf@mgsn.dev> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-3W3wFcBMFBedcZevcPSQ" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1631008843; bh=IYUU/W/pUIzsQ3BLfyq7oDgDZA3jUENYJlyUusxNxq8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Tuh9TXNkMnT+iHVtAphzuU+tkt7JbeFBsgWHRydn34gDQ4V37ya1DgJ7+lcvLvTGJ WY+DUYYjWmTFWOmHAScZkyE1iazUnLPDT3pJGlEMEkFSqBfr7UFyBvx/WDxtXj/6ZP iuAWWbBc8PxVG60vzPfHDbwBm8semKtkQy3tLRl8P28KH/nIinFBFCzrSa5dWLyALa M7fOAr/uUI1BOsncJQGFJwCafeDtUBrAlUbKme74RUCYmDvBe1242izOEnGmHtEhIz k5e3SpG4VN0eMNThwratSDWXVp/Z9odyKjp6FlaFcgfex8lwmvCPlxWf2FkggauD2/ bTGxQJPmmQYzQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-3W3wFcBMFBedcZevcPSQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sarah Morgensen schreef op ma 06-09-2021 om 18:16 [-0700]: > Hi Maxime, >=20 > Maxime Devos writes: >=20 > > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: > > > * guix/git-download.scm (checkout-to-store): New procedure. > > > * guix/upstream.scm (guess-version-transform) > > > (package-update/git-fetch): New procedures. > > > (%method-updates): Add GIT-FETCH mapping. > >=20 > > Does it support packages defined like (a) > >=20 > > (define-public gnash > > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") > > (revision "0")) > > (package > > (name "gnash") > > (version (git-version "0.8.11" revision commit)) > > (source (git-reference > > (url "https://example.org") > > (commit commit))) > > [...]))) >=20 > Thinking about this again, since updaters typically returns actual > versions (tags) instead of commits, how much would such a > feature be used? The minetest updater returns version numbers. It also returns a git-reference object, which includes the commit. Just returning a version number often isn't sufficient, because many repositories of minetest mods do not keep version tags. See . Greetings, Maxime. --=-3W3wFcBMFBedcZevcPSQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTc4ShccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oCxAP9Ij02MwmdqzRHO0untiA8XMwvQ 5mIZFI/F4rGBs+bFVAEA/HGbTDWV65zhq7GRhx3iSkL8dQ7TNZLaOhn1KKNnpAc= =OfIQ -----END PGP SIGNATURE----- --=-3W3wFcBMFBedcZevcPSQ-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 17:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163103707419363 (code B ref 50072); Tue, 07 Sep 2021 17:52:02 +0000 Received: (at 50072) by debbugs.gnu.org; 7 Sep 2021 17:51:14 +0000 Received: from localhost ([127.0.0.1]:57619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNfFa-00052F-4g for submit@debbugs.gnu.org; Tue, 07 Sep 2021 13:51:14 -0400 Received: from out2.migadu.com ([188.165.223.204]:49079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNfFX-000523-HF for 50072@debbugs.gnu.org; Tue, 07 Sep 2021 13:51:13 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631037069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QIdr60V2P+5C2KDeHFspc05pxRDAl/xo9dSTP4pIkJA=; b=Dk0ztGNlblTrUvutaRpoZazPQI9Zb2tT31YpPSuinuX/A63PpaDHfnHdQnMUJWlUxm3/KE 3+69/4TS2DUCRVj3d5GgtWagUO3sHYTNGiMm4/MCJjulRFGCsZ1d3CQiTmbOnuxD+zRtRg s1kiqVBjuK/dkypJ1W6lI7EA882jt/g= From: Sarah Morgensen References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86mtopi3s7.fsf@mgsn.dev> <470a95f159120d14384c3096cff91e3ce8d3c6c8.camel@telenet.be> Date: Tue, 07 Sep 2021 10:51:07 -0700 In-Reply-To: <470a95f159120d14384c3096cff91e3ce8d3c6c8.camel@telenet.be> (Maxime Devos's message of "Tue, 07 Sep 2021 12:00:42 +0200 (7 hours, 45 minutes, 41 seconds ago)") Message-ID: <86a6koi8ac.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Maxime Devos writes: > Sarah Morgensen schreef op ma 06-09-2021 om 18:16 [-0700]: >> Hi Maxime, >> >> Maxime Devos writes: >> >> > Sarah Morgensen schreef op zo 15-08-2021 om 16:25 [-0700]: >> > > * guix/git-download.scm (checkout-to-store): New procedure. >> > > * guix/upstream.scm (guess-version-transform) >> > > (package-update/git-fetch): New procedures. >> > > (%method-updates): Add GIT-FETCH mapping. >> > >> > Does it support packages defined like (a) >> > >> > (define-public gnash >> > (let ((commit "583ccbc1275c7701dc4843ec12142ff86bb305b4") >> > (revision "0")) >> > (package >> > (name "gnash") >> > (version (git-version "0.8.11" revision commit)) >> > (source (git-reference >> > (url "https://example.org") >> > (commit commit))) >> > [...]))) >> >> Thinking about this again, since updaters typically returns actual >> versions (tags) instead of commits, how much would such a >> feature be used? > > The minetest updater returns version numbers. > It also returns a git-reference object, which includes the commit. > Just returning a version number often isn't sufficient, > because many repositories of minetest mods do not keep version tags. Thanks for the explanation. So there is a version number indicated elsewhere than in the tags for some minetest packages? (Is this data in the package's git repo or in e.g. minetest repo metadata?) That is, the minetest updater always uses "blessed versions" (not just random commits), such that "revision" will always be "0"? Are current minetest packages like this formatted like 'gnash' above? > See . That's the message I quoted ;) -- Sarah From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 4/4] upstream: Support updating git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163104832315584 (code B ref 50072); Tue, 07 Sep 2021 20:59:02 +0000 Received: (at 50072) by debbugs.gnu.org; 7 Sep 2021 20:58:43 +0000 Received: from localhost ([127.0.0.1]:57940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNiB0-00043H-Qb for submit@debbugs.gnu.org; Tue, 07 Sep 2021 16:58:43 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:37842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNiAx-000437-CP for 50072@debbugs.gnu.org; Tue, 07 Sep 2021 16:58:41 -0400 Received: from butterfly.local ([188.188.3.227]) by xavier.telenet-ops.be with bizsmtp id r8yd250024tskic018ydrQ; Tue, 07 Sep 2021 22:58:37 +0200 Message-ID: <7905b183a5865bb597b10f8440074efa463ab544.camel@telenet.be> From: Maxime Devos Date: Tue, 07 Sep 2021 22:58:08 +0200 In-Reply-To: <86a6koi8ac.fsf@mgsn.dev> References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <86mtopi3s7.fsf@mgsn.dev> <470a95f159120d14384c3096cff91e3ce8d3c6c8.camel@telenet.be> <86a6koi8ac.fsf@mgsn.dev> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-dN7HVihbf6YFaANDYARA" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1631048317; bh=qUtpXVN7QUUaLSws7/ZeU/uLq+H/llwyZRuH0agtzVg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cnMZu8IV01pSc5QgKY1r9BfCZxa3BHHvd7srgUWCGjp1iIsRomqvsDcgYGvZTDscM +d0m/AwLLG0n6mJQbe09OCaEvm6mfJ5xOPXweYN5oCvVSVRaFHeCPFLMVyF4nB88lM tLsR1KzkKX5FHL6IqV9ACHBiUamzGkGayngA3F46q2x8aBd0S9mAu4bh/zQk7rh+7s YJGmaCn9aaw0HeO0HTrRS6A5HLx+dWKiGvPWiU6lP7jxuuBbqQlDGqbEyaXOQEg1S2 B/G0IWkRlOOuS8WMSC520WMBHDKoUegJb35G5TCJDaGdaaBj3i6rfi/hqMUP1YOLP3 bwfOsqwmXx3Ow== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-dN7HVihbf6YFaANDYARA Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sarah Morgensen schreef op di 07-09-2021 om 10:51 [-0700]: > So there is a version number indicated elsewhere than in the tags for > some minetest packages? (Is this data in the package's git repo or in > e.g. minetest repo metadata?) That is, the minetest updater always uses > "blessed versions" (not just random commits), such that "revision" will > always be "0"? The minetest importer looks at ContentDB. E.g., for Jeija/mesecons: https://content.minetest.net/packages/Jeija/mesecons/. It doesn't look at git tags at all. It only clones the git repository to compute the hash. Strictly speaking, ContentDB only has =E2=80=98release titles=E2=80=99, and= not =E2=80=98version numbers=E2=80=99. Release titles are usually version numbers or dates. In the former case, a= ll is well. In the latter case, there isn't much the importer/updater can do abo= ut that, so it will use the date even though it isn't a =E2=80=98proper version numb= er=E2=80=99. Releases on ContentDB are ordered. The importer and refresher always use t= he latest release, not some random commit. ContentDB has a mapping from relea= ses to their commits, which the importer and refresher uses. So, yes, there are =E2=80=98blessed versions=E2=80=99. However, due to par= ticularities of how minetest mods are released, revision won't always be 0, because there are minetest mods that make a new release on ContentDB without a corresponding version bump (e.g. minetest-ethereal, minetest-mesecons, minetest-throwing, minetest-throwing-arrows). > Are current minetest packages like this formatted like 'gnash' above? About a third are formatted like 'gnash' (let ((commit ...) (revision ...))= ...)). Greetings, Maxime --=-dN7HVihbf6YFaANDYARA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTfSYBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lPAAQCDu0xEAeybas2f1Y3lnGkGYxJK 9NbcMQWMRRWX6bmLvgD/Wkkcowr0BIACPDCucoDP4n2KqS/W+PHletLtFJ+xNQ8= =mgxY -----END PGP SIGNATURE----- --=-dN7HVihbf6YFaANDYARA-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 21:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163295097629755 (code B ref 50072); Wed, 29 Sep 2021 21:30:01 +0000 Received: (at 50072) by debbugs.gnu.org; 29 Sep 2021 21:29:36 +0000 Received: from localhost ([127.0.0.1]:50504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVh8j-0007jb-4C for submit@debbugs.gnu.org; Wed, 29 Sep 2021 17:29:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVh8T-0007ip-Jo for 50072@debbugs.gnu.org; Wed, 29 Sep 2021 17:29:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46104) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVh8O-0000Yo-5Y; Wed, 29 Sep 2021 17:29:00 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36424 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVh8N-0006vB-Ns; Wed, 29 Sep 2021 17:29:00 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <87fsui80dd.fsf_-_@gnu.org> <86k0jti1r4.fsf@mgsn.dev> Date: Wed, 29 Sep 2021 23:28:57 +0200 In-Reply-To: <86k0jti1r4.fsf@mgsn.dev> (Sarah Morgensen's message of "Mon, 06 Sep 2021 18:59:59 -0700") Message-ID: <87a6jv6pgm.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Sarah, I just noticed I hadn=E2=80=99t answered this message=E2=80=A6 Sarah Morgensen skribis: > Ludovic Court=C3=A8s writes: [...] >> Sarah Morgensen skribis: >> >>> * guix/git-download.scm (checkout-to-store): New procedure. >>> * guix/upstream.scm (guess-version-transform) >>> (package-update/git-fetch): New procedures. >>> (%method-updates): Add GIT-FETCH mapping. >> >> This LGTM. > > Thanks. WDYT about pre-emptively adding support for non-url URIs as > well? That is, > > 1. change "urls" in to "uri" > > 2. in 'git-fetch' > > a) if the upstream-source-uri is a git-reference, just use it as-is > rather than guessing the tag > > b) if it's not, return an 'upstream-source' with a git-reference URI=20 > > 3. update 'upstream-source-compiler' to work for git-reference URIs. > > If there are no objections, I think I'll make those changes and send > that as a proper patch. That sounds like a good idea. We=E2=80=99ll need to check users of =E2=80=98upstream-source-urls=E2=80=99 & co. and see whether/how they can d= eal with generalized =E2=80=9CURIs=E2=80=9D. That said, perhaps it can come after this patch series, which I think was mostly waiting on =E2=80=98package-definition-location=E2=80=99 initial= ly? Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Nov 2021 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.163716139424926 (code B ref 50072); Wed, 17 Nov 2021 15:04:02 +0000 Received: (at 50072) by debbugs.gnu.org; 17 Nov 2021 15:03:14 +0000 Received: from localhost ([127.0.0.1]:33444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnMSv-0006Tv-Rd for submit@debbugs.gnu.org; Wed, 17 Nov 2021 10:03:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnMSu-0006TS-4s for 50072@debbugs.gnu.org; Wed, 17 Nov 2021 10:03:12 -0500 Received: from [2001:470:142:3::e] (port=34950 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnMSo-0002qY-LO; Wed, 17 Nov 2021 10:03:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=w1moGtBiozGM2BE5wZOkQLY+JWD7x3t1Zn9mWWqxfqk=; b=lLa+QD671nxBgBqQtFZq isC4itqdIGHddWvzpRiOE5+gL4QatZPhD2LGHZB8NlouTy6puxWT8/y/vP36qYyAbeBjpin4GsY7H QP7KtcaL+pwUK5hxFTP5j95KqQ4dgGAJ9T+YSIn7vjSZbc0GyIn0MW9fEB15F3J3BQp85fXmWKeo2 881KEnzVWzqqUedlI7KARUN23/6PWoIWd4EZmRLaPF4iNVDEdgUTBcE4FEu4ITkOsIHZZ6mmVaLCq Rs4KGxkTVARzym/BIozOVocX/cwZS/mVMHBUxdCmip9A1FearsfYmzI31h0KdbNwcpdHqVt3uP5U7 nTCxHjsYxjd+ag==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53972 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnMSo-0008Uj-Dw; Wed, 17 Nov 2021 10:03:06 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <8d1ae518b23fac5b15812a30b11df1c360ab3fbf.1629068119.git.iskarian@mgsn.dev> <87fsui80dd.fsf_-_@gnu.org> <86k0jti1r4.fsf@mgsn.dev> <87a6jv6pgm.fsf_-_@gnu.org> Date: Wed, 17 Nov 2021 16:03:02 +0100 In-Reply-To: <87a6jv6pgm.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Wed, 29 Sep 2021 23:28:57 +0200") Message-ID: <878rxmx1sp.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Sarah, Friendly reminder about this patch set: https://issues.guix.gnu.org/50072 To me, it=E2=80=99s pretty much ready now that we can use =E2=80=98package-definition-location=E2=80=99 so that =E2=80=98guix refresh= -u=E2=80=99 edits the right bits. If you=E2=80=99re not able to work on it these days, I can tweak it for =E2=80=98package-definition-location=E2=80=99 use and push it on your behal= f. Let me know! Thanks, Ludo=E2=80=99. Ludovic Court=C3=A8s skribis: > Hi Sarah, > > I just noticed I hadn=E2=80=99t answered this message=E2=80=A6 > > Sarah Morgensen skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> Sarah Morgensen skribis: >>> >>>> * guix/git-download.scm (checkout-to-store): New procedure. >>>> * guix/upstream.scm (guess-version-transform) >>>> (package-update/git-fetch): New procedures. >>>> (%method-updates): Add GIT-FETCH mapping. >>> >>> This LGTM. >> >> Thanks. WDYT about pre-emptively adding support for non-url URIs as >> well? That is, >> >> 1. change "urls" in to "uri" >> >> 2. in 'git-fetch' >> >> a) if the upstream-source-uri is a git-reference, just use it as-is >> rather than guessing the tag >> >> b) if it's not, return an 'upstream-source' with a git-reference URI=20 >> >> 3. update 'upstream-source-compiler' to work for git-reference URIs. >> >> If there are no objections, I think I'll make those changes and send >> that as a proper patch. > > That sounds like a good idea. We=E2=80=99ll need to check users of > =E2=80=98upstream-source-urls=E2=80=99 & co. and see whether/how they can= deal with > generalized =E2=80=9CURIs=E2=80=9D. > > That said, perhaps it can come after this patch series, which I think > was mostly waiting on =E2=80=98package-definition-location=E2=80=99 initi= ally? > > Thanks, > Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164105852625082 (code B ref 50072); Sat, 01 Jan 2022 17:36:02 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 17:35:26 +0000 Received: from localhost ([127.0.0.1]:59254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3iHu-0006WU-0z for submit@debbugs.gnu.org; Sat, 01 Jan 2022 12:35:26 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:50346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3iHr-0006WI-IY for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 12:35:24 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id dVbM2600P4UW6Th01VbMcZ; Sat, 01 Jan 2022 18:35:22 +0100 Message-ID: <33e7ca24fb1704d03007c4e6eff76a25d6b5e5fe.camel@telenet.be> From: Maxime Devos Date: Sat, 01 Jan 2022 17:35:17 +0000 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-t8qEWy4cUPDlAuH6frd0" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641058522; bh=xqZR29vhI9mvRZHWWEKQLm3Di57P/rvptJJKGb0Ae+0=; h=Subject:From:To:Date; b=Fks9PyCERmkBbJTXjhzHtVihJPnEgiqQNMeJ14clBs9b5upCk5bKpf6aoG4uc2nSP cuf8EhNxC/RCk27SASVdkZShnAKGbbPguf36ryLsZJ+KajWWU1OTU0MPXj/vRsiy80 DJET3cZ0XbAJjMwSO3T9Axh8/MFY/DGD+scm7vkiud6bUcmGS9nCCB7M6huE78efPv LyaxmOgxTpV4egqMIt9khD+8K1KHqOGQdJygxOnyqgk0HRpDk5BBLNCLaXdiErbfg8 tVnx7iOMOaBikrBkeFlMNd5n7kns1Mk8YUKlsp+5AJPjMbWgrlE3Q7qoJpXArAS1HM QHfZKcS9nV2kA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-t8qEWy4cUPDlAuH6frd0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I'm currently unifying the patches of Sarah and me, changing the minetest and generic-git updater so "guix refresh -u" works. I'll send them when they are tested. Greetings, Maxime. --=-t8qEWy4cUPDlAuH6frd0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdCQ1RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hhbAP9YZwOFBJ88oa0H/DhtpdPtkzRg 0gjGttlvuG99RMRBAgEAmDWJjphAU9/qLP9WKgkh3bKqbesZDQPJHT7x6jOSFgM= =CG4Z -----END PGP SIGNATURE----- --=-t8qEWy4cUPDlAuH6frd0-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 3/4] refresh: Support non-tarball sources. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959112230 (code B ref 50072); Sat, 01 Jan 2022 20:40:02 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:51 +0000 Received: from localhost ([127.0.0.1]:59461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAN-0003B6-8r for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:51 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Ah-3H for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:50 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06YfnkH; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:39 +0000 Message-Id: <20220101203940.149517-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220101203940.149517-1-maximedevos@telenet.be> References: <20220101203940.149517-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=1C9ahprOwcy10Tnk5guGYz+QxZ/hL2vALCXNKEI79wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FKdn9ZFqw8pxmg2m/zKR+EIuxbCcapC+z2jJGo7GS/aTMMf1G/nWxGYcUPHz6K8/f yWZXIVLz4WROwwJpl+elwbhGhoMtRZfSbq9MKlHSwFby5X6HONr0Y9Jx/XBATG+Xdd nj4udm/sEKRJ0jjzlgBUD52n3Yb3PgVTzu3Vp3Ftigm1wxJvQ2wDGxWGIR+5A5XABK 1wyHejDLoK7UK1qhgY8J24xvGOaQf3Cy2FwSsuEHDpVZFPk2bO7Pr2RNJPdzRuv6JG ViwRDGGv/oAYLibPst0C5fZiNoBX/V6Lx7dB/O1YZ7mDxHxyLQrRb0DIAwBTOMBwRM 5Op3xp2u+Oxyw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 8806f0f740..68bb9040d8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -363,8 +364,7 @@ warn about packages that have no matching updater." (info loc (G_ "~a: consider removing this propagated input: ~a~%") name change-name)))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 0/4] Add upstream updater for git-fetch origins References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959212238 (code B ref 50072); Sat, 01 Jan 2022 20:40:02 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:52 +0000 Received: from localhost ([127.0.0.1]:59463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAN-0003BD-TB for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:52 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Aj-Bi for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:50 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06Yfmk4; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:36 +0000 Message-Id: <20220101203940.149517-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=4TR2TRkDnZZ5VrHGZQLlq3IsEXRDkWwR3rnuo+l5pM4=; h=From:To:Cc:Subject:Date; b=EKz3jyQIGL1h9TrTuVwG+5Nt2gTDhPTj64K2T3OuB0/xMDDE85Thv/VnHiUY8Zn6r gGxte6EgHUGA9cG9scota+zGk4IRKo3A2MTQhcOb8GTQxPVtu8ZSebVyyuX2VS7EPL UqZUsGlwV40LjNAIXUNgyCJJerEEeHnFdBTOz/4vbDTpVM2Psjaf7R28sGPQjb9tNJ AYEiB1a51Ei4/u+QRdySwA3zQUQyo7PlW577iReZbhGZ866/pMfm396gcvlIe6qcpV YLsNM+XFp//zDx1pxES82sAE6Mq4lqM+fgLevmvoKccCa8MsXwum9GQHuVtzj6gdM0 8DiGmoVPUkl4g== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi, This is a combination of Sarah's patches and the patch I wrote. Some differences: 'guix/hash.scm' is added to Makefile.am. I modified the 'generic-git' and 'minetest' updater to return 'git-reference' objects. There's no guess-version-transform procedure. Due to letting updaters return git-reference objects, guessing isn't necessary. This also allows using commits. In contrast to my original version, it not only supports commits, but also tags (using 'tag-or-commit'), like in Sarah's version. I didn't use checkout-to-store, because it is used in only a single location and is only a basic wrapper around latest-repository-commit. I didn't look at testing if (let ((commit ...) (revision ...)) (package ...)) works. If it doesn't, that could be implemented in a separate patch. '--with-latest' with a git source fails with a nice error message. Some tests: $ make check # no failures $ ./pre-inst-env guix refresh minetest-mobs-animal -u --type=generic-git The result seems largely reasonable: the version changed, and the commit changed to a new tag. However, the URL changed from mixed case to lowercase. Maybe a todo for later: use the original URL if it only changed in case. Also, the version switched from YYYY-MM-DD to YYYY.MM.DD. Maybe change the minetest importer to use the latter, to keep minetest and generic-git consistent? TODO for later! A bug: the sha256 hash isn't updated. I don't know why. I investigated a little, and it turns out that 'latest-repository-commit' is called with the new tag, but the store item corresponds the old commit. Weird! $ # undo the update $ ./pre-inst-env guix refresh minetest-mobs-animal -u --type=minetest No problems at all (except the mixed case -> lowercase). The commit and sha256/base32 are updated! $ ./pre-inst-env guix build minetest-mobs-animal This builds successfully. $ # undo changes $ ./pre-inst-env guix build minetest-mobs-animal --with-latest=minetest-mobs-animal It fails gracefully with: guix build: error: git origins are unsupported by --with-latest Also, do tarball origins still function? They do: $ # move GNU "hello" to an earlier version, then do $ ./pre-inst-env guix build hello --with-latest=hello This build hello@2.10 -- the output path is the same as before moving 'hello' to an earlier version. $ ./pre-inst-env guix refresh -u hello The version is updated to @2.10, but sha256 isn't changed? Seems like a bug, but it doesn't appear to be a regression. Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating 'git-fetch' origins. Makefile.am | 1 + guix/hash.scm | 51 ++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 ++------------------- guix/import/elpa.scm | 29 +++---------------- guix/import/git.scm | 22 +++++++++------ guix/import/go.scm | 25 ++--------------- guix/import/minetest.scm | 24 +++++++--------- guix/scripts/hash.scm | 18 ++---------- guix/scripts/refresh.scm | 10 +++---- guix/upstream.scm | 60 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++--- 11 files changed, 151 insertions(+), 128 deletions(-) create mode 100644 guix/hash.scm base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 2/4] import: Factorize file hashing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959712257 (code B ref 50072); Sat, 01 Jan 2022 20:40:03 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:57 +0000 Received: from localhost ([127.0.0.1]:59465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAO-0003BL-8s for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:57 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Ag-36 for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:51 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06YfnkE; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:38 +0000 Message-Id: <20220101203940.149517-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220101203940.149517-1-maximedevos@telenet.be> References: <20220101203940.149517-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=RXKwd85pZUV2ji75cmi30gVSGgIyuezvD1aR1EKaga0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rkOfIVf9LAppzXL8v/zvbIhdASN6azn64KMuewVRMoxJttuFMHt/XK2XKYiInjd4L dZxbSjPZzTnVszI+sY+VpTJ2LWSEmNO992UiSKKZN7SWhvHx3cx3/FifUyKsA5SK1W 6WFBcsn3D8WObLW+w3EBIrsnWqHzFEtzI+sIaza0iwZyeHEgZU/hvl8dXN5xA8Z1kM a7iHJKp84sA8FXphRakwxtzEcczXHB4M4ur01OK4ul5KHvhx3qj3dSRLNCp48Y1hDr IoXtazPdGzPkKBNXjv1PdZlNleAk7N2CtpcKFGnKMFqS/L3GJtHctcQhDXbofidTWI N0Sk8q9xdAvQg== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->o [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.137.88 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. * guix/import/minetest.scm (file-hash): Remove procedure. (make-minetest-sexp): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 29 ++++------------------------- guix/import/go.scm | 25 +++---------------------- guix/import/minetest.scm | 18 +++++++----------- 4 files changed, 17 insertions(+), 87 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 1389576cad..69f4533da7 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,10 +36,9 @@ #:use-module (guix memoization) #:use-module (guix http-client) #:use-module (guix diagnostics) + #:use-module (guix hash) #:use-module (guix i18n) - #:use-module (gcrypt hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -196,17 +196,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -464,16 +453,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -571,12 +550,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source)))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..c1f40ed915 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -229,27 +230,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -270,8 +250,7 @@ RECIPE." (commit ,commit))) (sha256 (base32 - ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + ,(bytevector->nix-base32-string (file-hash* directory))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -380,7 +359,7 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string (file-hash* tarball)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 26dbc34b63..ea999d290c 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -26,6 +26,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -36,11 +37,10 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) #:autoload (guix serialization) (write-file) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:use-module (ice-9 match) #:use-module (ice-9 peg) #:use-module (ice-9 rdelim) @@ -499,25 +499,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -536,7 +517,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index abddd885ee..44671d8480 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module (guix base32) #:use-module (guix git) #:use-module ((guix git-download) #:prefix download:) + #:use-module (guix hash) #:use-module (guix store) #:export (%default-sort-key %contentdb-api @@ -286,14 +287,6 @@ results. The return value is a list of records." (with-store store (latest-repository-commit store url #:ref ref))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file) - "Compute the hash of FILE." - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port) - (force-output port) - (get-hash))) - (define (make-minetest-sexp author/name version repository commit inputs home-page synopsis description media-license license) @@ -314,9 +307,12 @@ MEDIA-LICENSE and LICENSE." ;; The git commit is not always available. ,(and commit (bytevector->nix-base32-string - (file-hash + (file-hash* (download-git-repository repository - `(commit . ,commit))))))) + `(commit . ,commit)) + ;; 'download-git-repository' already filtered out the '.git' + ;; directory. + #:select? (const #true)))))) (file-name (git-file-name name version)))) (build-system minetest-mod-build-system) ,@(maybe-propagated-inputs (map contentdb->package-name inputs)) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 1/4] guix hash: Extract file hashing procedures. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959712264 (code B ref 50072); Sat, 01 Jan 2022 20:40:03 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:57 +0000 Received: from localhost ([127.0.0.1]:59467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAT-0003Be-5K for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:57 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Ak-Bs for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:51 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06YfnkB; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:37 +0000 Message-Id: <20220101203940.149517-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220101203940.149517-1-maximedevos@telenet.be> References: <20220101203940.149517-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=datHYzL0SVd0rwUCzuWszTQqKpojPeEL4RGz2j9hH1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VNadx7TYJS+teRei0C1Ri8+UqLAo2ROvZrr3CZ0GaytqXuo/etZYU/KIAFS5nlvuT A/MA+l33nxki3vhP7LA/pEgNB8sGbVwgdUMj6DEt7RV2bPNIfIlIHp/oyNcvWuaDqG JqGSILtiigIpjFeS8P3in8fdqdpIKExVAZnL6/weHFfnNTN9okp1cKT///suHkBCye GKL9U3uShwyBsctHkvZyFS9Rkfqupy3xITlfR4wwCzyKo4MFPdQXLPL5JMx1WpaSdk debMVbMPJTb3uDvExAinXrc1kwubAzOQkp7eNuhAaP/4e6VrK3MdqJfoDFUkBKU7kv gG5mJ5h3mJ8Lw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/hash.scm (guix-hash)[vcs-file?, file-hash]: Extract logic to... * guix/hash.scm: ...here. New file. --- Makefile.am | 1 + guix/hash.scm | 51 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 18 +++------------ 3 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 guix/hash.scm diff --git a/Makefile.am b/Makefile.am index 8c5682a1c6..bc3d0087d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,6 +99,7 @@ MODULES = \ guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..8c2ab8187f --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,51 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? #t) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is true, recurse +into subdirectories of FILE, computing the combined hash of all files for +which (SELECT? FILE STAT) returns true." + (if recursive? + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..168450d668 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -46,11 +48,7 @@ (define* (nar-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) - (let-values (((port get-hash) - (open-hash-port algorithm))) - (write-file file port #:select? select?) - (force-output port) - (get-hash))) + (file-hash* file #:algorithm algorithm #:select? select?)) (define* (default-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) @@ -181,16 +179,6 @@ use '--serializer' instead~%")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 4/4] upstream: Support updating 'git-fetch' origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959812271 (code B ref 50072); Sat, 01 Jan 2022 20:40:04 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:58 +0000 Received: from localhost ([127.0.0.1]:59469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAT-0003Bl-Je for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:58 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Ai-36 for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:54 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06YfnkP; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:40 +0000 Message-Id: <20220101203940.149517-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220101203940.149517-1-maximedevos@telenet.be> References: <20220101203940.149517-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=piqveXyl/U9vmoG/ROFsFuzs3/uReMmo25hpTwa0WIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iJ6TdfGoj/8b9ldPTWKRa8IrdozeIqYAF4wlnuGQ2YrD2ZVaknDmdbSMTGCB12VjE J7dYlxfbqumiz4rdmnPHs/DdhLOA0/hzHy+AHuABCKwyvSh8JA681UVTCBj9husu/v j6lfZ+VyGpE3Mj25hNbJlOyw9GNzRXpU5BMS9wF1CDuKM8lt9re0sLgqWEq2IfuHeB qOkgH7O5UclyKCVnhDWtE6Ts8cb7feboMajDPWy+lxdfqyVBRPg+jfJZH8z7a5HrSY BPlKrPQRtbH1L7RZiU5LN2L5QRgS+yTxE66ApqgQGOwP7YzWjvN7TneWAal4NpsrL1 pSZSf7kM0DNVg== X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/upstream.scm (package-update/git-fetch): New procedure. ()[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler): Bail out gracefully if the source is a git origin. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos --- guix/import/git.scm | 22 +++++++++------ guix/import/minetest.scm | 6 ++-- guix/upstream.scm | 60 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++--- 4 files changed, 74 insertions(+), 21 deletions(-) diff --git a/guix/import/git.scm b/guix/import/git.scm index 1eb219f3fe..4cf404677c 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (%generic-git-updater ;; For tests. @@ -172,21 +174,21 @@ repository at URL." (values version tag))))))) (define (latest-git-tag-version package) - "Given a PACKAGE, return the latest version of it, or #f if the latest version -could not be determined." + "Given a PACKAGE, return the latest version of it and the corresponding git +tag, or #false and #false if the latest version could not be determined." (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c)) (warning (or (package-field-location package 'source) (package-location package)) (G_ "~a for ~a~%") (condition-message c) (package-name package)) - #f) + (values #f #f)) ((eq? (exception-kind c) 'git-error) (warning (or (package-field-location package 'source) (package-location package)) (G_ "failed to fetch Git repository for ~a~%") (package-name package)) - #f)) + (values #f #f))) (let* ((source (package-source package)) (url (git-reference-url (origin-uri source))) (property (cute assq-ref (package-properties package) <>))) @@ -208,14 +210,16 @@ could not be determined." "Return an for the latest release of PACKAGE." (let* ((name (package-name package)) (old-version (package-version package)) - (url (git-reference-url (origin-uri (package-source package)))) - (new-version (latest-git-tag-version package))) - - (and new-version + (old-reference (origin-uri (package-source package))) + (new-version new-version-tag (latest-git-tag-version package))) + (and new-version new-version-tag (upstream-source (package name) (version new-version) - (urls (list url)))))) + (urls (git-reference + (url (git-reference-url old-reference)) + (commit new-version-tag) + (recursive? (git-reference-recursive? old-reference)))))))) (define %generic-git-updater (upstream-updater diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index 44671d8480..9df13e45ae 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -503,9 +503,9 @@ or #false if the latest release couldn't be determined." (upstream-source (package (package:package-name pkg)) (version (release-version release)) - (urls (list (download:git-reference - (url (package-repository contentdb-package)) - (commit (release-commit release)))))))) + (urls (download:git-reference + (url (package-repository contentdb-package)) + (commit (release-commit release))))))) (define %minetest-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..0df2e78d30 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,8 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,12 +26,14 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix base32) #:use-module (guix gexp) + #:use-module (guix git) #:use-module (guix store) #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) #:autoload (gcrypt hash) (port-sha256) @@ -93,7 +97,7 @@ upstream-source? (package upstream-source-package) ;string (version upstream-source-version) ;string - (urls upstream-source-urls) ;list of strings + (urls upstream-source-urls) ;list of strings|git-reference (signature-urls upstream-source-signature-urls ;#f | list of strings (default #f)) (input-changes upstream-source-input-changes @@ -361,8 +365,12 @@ values: 'interactive' (default), 'always', and 'never'." system target) "Download SOURCE from its first URL and lower it as a fixed-output derivation that would fetch it." - (mlet* %store-monad ((url -> (first (upstream-source-urls source))) - (signature + (define url + (match (upstream-source-urls source) + ((first . _) first) + (_ (raise (formatted-message + (G_ "git origins are unsupported by --with-latest")))))) + (mlet* %store-monad ((signature -> (and=> (upstream-source-signature-urls source) first)) (tarball ((store-lift download-tarball) url signature))) @@ -430,9 +438,35 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define (guess-version-transform commit from-version) + "Return a one-argument proc that transforms FROM-VERSION to COMMIT, or #f +if no such transformation could be determined." + ;; Just handle prefixes for now, since that's the most common. + (if (string-suffix? from-version commit) + (let* ((version-length (string-length from-version)) + (commit-prefix (string-drop-right commit version-length))) + (lambda (version) + (string-append commit-prefix version))) + #f)) + +(define* (package-update/git-fetch store package source #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + ;; TODO: it would be nice to authenticate commits, e.g. with + ;; "guix git authenticate" or a list of permitted signing keys. + (define ref (upstream-source-urls source)) ; a + (values (upstream-source-version source) + (latest-repository-commit + store + (git-reference-url ref) + #:ref `(tag-or-commit . ,(git-reference-commit ref)) + #:recursive? (git-reference-recursive? ref)) + source)) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) @@ -492,9 +526,22 @@ new version string if an update was made, and #f otherwise." (origin-hash (package-source package)))) (old-url (match (origin-uri (package-source package)) ((? string? url) url) + ((? git-reference? ref) + (git-reference-url ref)) (_ #f))) (new-url (match (upstream-source-urls source) - ((first _ ...) first))) + ((first _ ...) first) + ((? git-reference? ref) + (git-reference-url ref)) + (_ #f))) + (old-commit (match (origin-uri (package-source package)) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) + (new-commit (match (upstream-source-urls source) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) (file (and=> (location-file loc) (cut search-path %load-path <>)))) (if file @@ -508,6 +555,9 @@ new version string if an update was made, and #f otherwise." 'filename file)) (replacements `((,old-version . ,version) (,old-hash . ,hash) + ,@(if (and old-commit new-commit) + `((,old-commit . ,new-commit)) + '()) ,@(if (and old-url new-url) `((,(dirname old-url) . ,(dirname new-url))) diff --git a/tests/minetest.scm b/tests/minetest.scm index 77b9aa928f..cbb9e83889 100644 --- a/tests/minetest.scm +++ b/tests/minetest.scm @@ -387,10 +387,9 @@ during a dynamic extent where that package is available on ContentDB." ;; Update detection (define (upstream-source->sexp upstream-source) - (define urls (upstream-source-urls upstream-source)) - (unless (= 1 (length urls)) - (error "only a single URL is expected")) - (define url (first urls)) + (define url (upstream-source-urls upstream-source)) + (unless (git-reference? url) + (error "a is expected")) `(,(upstream-source-package upstream-source) ,(upstream-source-version upstream-source) ,(git-reference-url url) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 3/4] refresh: Support non-tarball sources. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Jan 2022 13:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164121813115657 (code B ref 50072); Mon, 03 Jan 2022 13:56:01 +0000 Received: (at 50072) by debbugs.gnu.org; 3 Jan 2022 13:55:31 +0000 Received: from localhost ([127.0.0.1]:34442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4NoA-00044S-Oe for submit@debbugs.gnu.org; Mon, 03 Jan 2022 08:55:30 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:58240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4No7-00044C-Ce for 50072@debbugs.gnu.org; Mon, 03 Jan 2022 08:55:28 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id EB62316B; Mon, 3 Jan 2022 14:55:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id klDrmj7b73O7; Mon, 3 Jan 2022 14:55:20 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id AB568120; Mon, 3 Jan 2022 14:55:19 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220101203940.149517-1-maximedevos@telenet.be> <20220101203940.149517-4-maximedevos@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?UTF-8?Q?Niv=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 03 Jan 2022 14:55:19 +0100 In-Reply-To: <20220101203940.149517-4-maximedevos@telenet.be> (Maxime Devos's message of "Sat, 1 Jan 2022 20:39:39 +0000") Message-ID: <87o84sly9k.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: EB62316B X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Maxime, Thanks for the updated patch set! Overall it LGTM. I found this one bug: Maxime Devos skribis: > From: Sarah Morgensen > > * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of > 'port-sha256'. Rename TARBALL to OUTPUT. [...] > - (let ((hash (call-with-input-file tarball > - port-sha256))) > + (let ((hash (file-hash* output))) This is incorrect because =E2=80=98file-hash*=E2=80=99 defaults to #:recurs= ive? #t (IOW it computes the hash of a nar containing OUTPUT instead of the hash of OUTPUT). You can see the problem for instance by running: ./pre-inst-env guix refresh -u mailutils && \ ./pre-inst-env guix build -S mailutils # hash mismatch error I think we need to check whether OUTPUT is a file or a directory and pass #:recursive? accordingly. WDYT? Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 4/4] upstream: Support updating 'git-fetch' origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Jan 2022 14:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164121856216464 (code B ref 50072); Mon, 03 Jan 2022 14:03:01 +0000 Received: (at 50072) by debbugs.gnu.org; 3 Jan 2022 14:02:42 +0000 Received: from localhost ([127.0.0.1]:34447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4Nv8-0004HU-G8 for submit@debbugs.gnu.org; Mon, 03 Jan 2022 09:02:42 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:58454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4Nv6-0004HD-5J for 50072@debbugs.gnu.org; Mon, 03 Jan 2022 09:02:40 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E9F82363; Mon, 3 Jan 2022 15:02:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HAxj7ubfAadx; Mon, 3 Jan 2022 15:02:33 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E7B54120; Mon, 3 Jan 2022 15:02:32 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220101203940.149517-1-maximedevos@telenet.be> <20220101203940.149517-5-maximedevos@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?UTF-8?Q?Niv=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 03 Jan 2022 15:02:32 +0100 In-Reply-To: <20220101203940.149517-5-maximedevos@telenet.be> (Maxime Devos's message of "Sat, 1 Jan 2022 20:39:40 +0000") Message-ID: <87h7aklxxj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: E9F82363 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Maxime Devos skribis: > From: Sarah Morgensen > > Updaters need to be modified to return 'git-reference' objects. > This patch modifies the 'generic-git' and 'minetest' updater, > but others might need to be modified as well. > > * guix/upstream.scm (package-update/git-fetch): New procedure. > ()[urls]: Document it can be a 'git-reference'. > (%method-updates): Add 'git-fetch' mapping. > (update-package-source): Support 'git-reference' sources. > (upstream-source-compiler): Bail out gracefully if the source is a git > origin. > * guix/import/git.scm > (latest-git-tag-version): Always return two values and document that th= e tag > is returned as well. > (latest-git-release)[urls]: Use the 'git-reference' instead of the > repository URL. > * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the > 'git-reference' in a list. > * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. > > Co-authored-by: Maxime Devos [...] > system target) > "Download SOURCE from its first URL and lower it as a fixed-output > derivation that would fetch it." > - (mlet* %store-monad ((url -> (first (upstream-source-urls source))) > - (signature > + (define url > + (match (upstream-source-urls source) > + ((first . _) first) > + (_ (raise (formatted-message > + (G_ "git origins are unsupported by --with-latest")))))) We should probably not refer to =E2=80=98--with-latest=E2=80=99 in =E2=80=98upstream-source-compiler=E2=80=99 to keep things separate. > +(define* (package-update/git-fetch store package source #:key key-downlo= ad) > + "Return the version, checkout, and SOURCE, to update PACKAGE to > +SOURCE, an ." > + ;; TODO: it would be nice to authenticate commits, e.g. with > + ;; "guix git authenticate" or a list of permitted signing keys. > + (define ref (upstream-source-urls source)) ; a > + (values (upstream-source-version source) > + (latest-repository-commit It=E2=80=99s a bummer that no longer models things correc= tly: =E2=80=98urls=E2=80=99 can be either a list of URLs or a , a= s can be seen in the two examples above, and =E2=80=98signature-urls=E2=80=99 is meaningl= ess for Git origins. We can probably leave it for a future patch series, but I think we should do something about it. In particular, as the comment notes, IWBN to make provisions to allow for tag signature verification, which is probably the most widespread practice. Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 1/4] guix hash: Extract file hashing procedures. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 15:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164130898916358 (code B ref 50072); Tue, 04 Jan 2022 15:10:01 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 15:09:49 +0000 Received: from localhost ([127.0.0.1]:38442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRZ-0004FW-6c for submit@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:48 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:40110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRX-0004F4-6y for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:44 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ef9g2600W4UW6Th06f9hSi; Tue, 04 Jan 2022 16:09:41 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 15:09:34 +0000 Message-Id: <20220104150937.35872-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104150937.35872-1-maximedevos@telenet.be> References: <20220104150937.35872-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641308981; bh=i9yb7nh1nBUy1tiYhhqR0CWJ3JVd+uJc5NmKjxoYf0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ezw8ODvHeDPC0Va5vpyaelFrqXX/yzfl/dsUSXx1RESlaYzobhmMaOyDlLE5uvqVp KFJvcWUrOXeMbcPD8QlMqw93WL7OnZOTIgNXpCIuLZjpKnD92deHYogurThlc7RbyJ sjnbvHTnQnPkcqOMHOyqUhu6CoFwaL7bwCzpZnIp/wW5ApOG8g0ZSh8nM4E2GVbE7F qlcyNuHpGCF5O+XdghyeXgS/+jbEMzqgUEWU3ok3XjDcWKbki5MJKs0LslnzKncuGA 60+/wgkAB5XZLQ8yRUWqeOwAybefrZmLrK9WAmALrwxqz2fUAQ9VYx/SvJs7vp1XV7 FGx9U0VqYUSSQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Sarah Morgensen * guix/scripts/hash.scm (guix-hash)[vcs-file?] (nar-hash, default-hash): Extract hashing logic to... * guix/hash.scm (vcs-file?, file-hash*): ... these new procedures in this new file. Modified-by: Maxime Devos --- Makefile.am | 1 + guix/hash.scm | 68 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 22 +++----------- 3 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 guix/hash.scm diff --git a/Makefile.am b/Makefile.am index 8c5682a1c6..bc3d0087d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,6 +99,7 @@ MODULES = \ guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..19cbc41ad1 --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? 'auto) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is #true or 'auto', +recurse into subdirectories of FILE, computing the combined hash (nar hash) of +all files for which (SELECT? FILE STAT) returns true. + +Symbolic links are not dereferenced unless RECURSIVE? is false. + +This procedure must only be used under controlled circumstances; +the detection of symbolic links in FILE is racy. + +Keep in mind that the hash of a regular file depends on RECURSIVE?: +if the recursive hash is desired, it must be set to #true. Otherwise, it must +be set to #false or 'auto'. In most situations, the non-recursive hash is desired +for regular files." + (if (or (eq? recursive? #true) + (and (eq? recursive? 'auto) + ;; Don't change this to (eq? 'directory ...), because otherwise + ;; if 'file' denotes a symbolic link, the 'file-hash' below + ;; would dereference it -- dereferencing symbolic links would + ;; open an avoidable can of potential worms. + (not (eq? 'regular (stat:type (lstat file)))))) + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..28d587b944 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -46,20 +48,14 @@ (define* (nar-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) - (let-values (((port get-hash) - (open-hash-port algorithm))) - (write-file file port #:select? select?) - (force-output port) - (get-hash))) + (file-hash* file #:algorithm algorithm #:select? select? #:recursive? #true)) (define* (default-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) (match file ("-" (port-hash algorithm (current-input-port))) - (_ - (call-with-input-file file - (cute port-hash algorithm <>))))) + (_ (file-hash* file #:algorithm algorithm #:recursive? #false)))) (define* (git-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) @@ -181,16 +177,6 @@ use '--serializer' instead~%")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 2/4] import: Factorize file hashing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164130899316369 (code B ref 50072); Tue, 04 Jan 2022 15:10:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 15:09:53 +0000 Received: from localhost ([127.0.0.1]:38444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRc-0004Fn-Sv for submit@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:53 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:40120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRX-0004F6-6v for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:44 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ef9g2600W4UW6Th06f9hSr; Tue, 04 Jan 2022 16:09:41 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 15:09:35 +0000 Message-Id: <20220104150937.35872-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104150937.35872-1-maximedevos@telenet.be> References: <20220104150937.35872-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641308981; bh=pToVcY6tyNJdA8to9CMlcbffGWezAHQB9+uOz7gou4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LdBMHrkP11N1kcxdHNDpgjSYrgRACy3Y7S6qN/DfTmxrUARMx/YkSKohhNGM54J88 XV2gtXFfvmh0K4NBA3QLOigqYIYunxT+hTlVrfQnFD/I18COA9cPoGziYpAxDdVnWi 5N6dI0NS6XEr0msU6IxqAHlPJtR1EAEEUM0dJTIU0E2YBoUvzZbcfyI8TR4N7FXbiT Xykf1fw7y+DU/8LQJGIMvovBgo8NYbfNjOHlLVZ3ER2Ds4egAq2azkX6K7fITv30Xr yPGMXI/vdanKqEKOeefrvU6w45DcuGoQg5nd/aPiPo3emUaFmIFZScoG4n1HOz1/kc J9Lj8VRT3YJbQ== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->o [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.137.88 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. * guix/import/minetest.scm (file-hash): Remove procedure. (make-minetest-sexp): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 29 +++++------------------------ guix/import/go.scm | 25 +++---------------------- guix/import/minetest.scm | 19 ++++++++----------- 4 files changed, 19 insertions(+), 86 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 1389576cad..b61402078d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,10 +36,9 @@ #:use-module (guix memoization) #:use-module (guix http-client) #:use-module (guix diagnostics) + #:use-module (guix hash) #:use-module (guix i18n) - #:use-module (gcrypt hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -196,17 +196,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -464,16 +453,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -571,12 +550,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source #:recursive? (or git? hg?))))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..c5167eacb5 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -229,27 +230,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -271,7 +251,7 @@ RECIPE." (sha256 (base32 ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + (file-hash* directory #:recursive? #true))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -380,7 +360,8 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string + (file-hash* tarball #:recursive? #false)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 26dbc34b63..c7673e6a1a 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -26,6 +26,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -36,11 +37,10 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) #:autoload (guix serialization) (write-file) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:use-module (ice-9 match) #:use-module (ice-9 peg) #:use-module (ice-9 rdelim) @@ -499,25 +499,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -536,7 +517,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm #:recursive? #true))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index abddd885ee..a7bdbfebca 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module (guix base32) #:use-module (guix git) #:use-module ((guix git-download) #:prefix download:) + #:use-module (guix hash) #:use-module (guix store) #:export (%default-sort-key %contentdb-api @@ -286,14 +287,6 @@ results. The return value is a list of records." (with-store store (latest-repository-commit store url #:ref ref))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file) - "Compute the hash of FILE." - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port) - (force-output port) - (get-hash))) - (define (make-minetest-sexp author/name version repository commit inputs home-page synopsis description media-license license) @@ -314,9 +307,13 @@ MEDIA-LICENSE and LICENSE." ;; The git commit is not always available. ,(and commit (bytevector->nix-base32-string - (file-hash + (file-hash* (download-git-repository repository - `(commit . ,commit))))))) + `(commit . ,commit)) + ;; 'download-git-repository' already filtered out the '.git' + ;; directory. + #:select? (const #true) + #:recursive? #true))))) (file-name (git-file-name name version)))) (build-system minetest-mod-build-system) ,@(maybe-propagated-inputs (map contentdb->package-name inputs)) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 0/4] Add upstream updater for git-fetch origins References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 15:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164130899416378 (code B ref 50072); Tue, 04 Jan 2022 15:10:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 15:09:54 +0000 Received: from localhost ([127.0.0.1]:38446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRh-0004Fy-QU for submit@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:54 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:40098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRX-0004F3-72 for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:44 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ef9g2600W4UW6Th06f9hSY; Tue, 04 Jan 2022 16:09:41 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 15:09:33 +0000 Message-Id: <20220104150937.35872-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641308981; bh=JMdLdqd9HilnxtP8Yy8+yylK7pTOng54sLr8byIkMEo=; h=From:To:Cc:Subject:Date; b=WwEWdY78J8O08lPeEJTWDkWww4hoVm9LHih1/UfOql6oZ+o0zCmElNcjPMTXwpE/t j9RoJZwAxyw27jGQtNROaxPGR/91Dflk7p6mBqUwsmhDDXC0KG/junPfwcmUsP5YdT EYyLOdFT0yvzUjT0qOY+/TiP5sxMkPvDWfmjndEpl8ttLwPTEgwIAcofcRs+UPAnHH hU+0wV+Y1Xo1aiExCb6C6Tf8YXoVcuWfRv4k0iwvgcMOAb/NvHgmznI5xcr0ukq+Sm NlD1VZcRY8qrHqLKnx8dh8TtmZGdSzwLh62Ot0n0jhbCOYlkDMEbBJtTiphguQ5IQS 3WDZbrL4koJbw== X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) The following changes were made since v2: * file-hash* has been modified to, by default, only compute nar hash if the file is a directory. * Most uses of file-hash* have been modified to explicitely set #:recursive? #false or #:recursive? #true * the compiler has been modified to support git-fetch origins. However, it is broken, and I don't know how to resolve the issue. (Except perhaps by using latest-repository-commit directly but that shouldn't be necessary, since objects are lowerable?) * 'guess-version-transform' has been removed, since it is unused. Checklist: - [x] make check There's one test failure: FAIL: tests/guix-pack-relocatable.sh guix pack: error: profile contains conflicting entries for python-numpy guix pack: error: first entry: python-numpy@1.21.3 /gnu/store/9dd0zkkwl45rmsa7b6vjb1747l57aw4y-python-numpy-1.21.3R guix pack: error: second entry: python-numpy@1.20.3 /gnu/store/mlccgh05bf8cdinq0ilpvpdmsspq36pv-python-numpy-1.20.3R guix pack: error: ... propagated from python-matplotlib@3.4.3 guix pack: error: ... propagated from python-scipy@1.7.3 guix/build/syscalls.scm:2271:8: In procedure terminal-window-size: In procedure terminal-window-size: Inappropriate ioctl for device (This is from within Emacs.) It seems unrelated to this patch series; - [ ] guix build --source minetest-unified-inventory --with-latest=minetest-unified-inventory This causes Wrong type to apply: #< url: "https://github.com/minetest-mods/unified_inventory" branch: #f commit: "d6688872c84417d2f61d6f5e607aea39d78920aa" recursive?: #f> but I don't know how to resolve this. - [x] guix refresh minetest-unified-inventory -t minetest - [x] guix refresh -t minetest -u minetest-unified-inventory Version, hash and commit seem ok. - [x] move "hello" to earlier version, do "guix refresh hello" An update '2.9' -> '2.10' is available. - [ ] guix refresh -u hello gpgv: Signature made Sun Nov 16 12:08:37 2014 UTC gpgv: using RSA key A9553245FDE9B739 gpgv: Can't check signature: No public key Would you like to add this key to keyring '$HOME/.config/guix/upstream/trustedkeys.kbx'? yes gpg: key A9553245FDE9B739: new key but contains no user ID - skipped gpg: Total number processed: 1 gpg: w/o user IDs: 1 gpgv: Signature made Sun Nov 16 12:08:37 2014 UTC gpgv: using RSA key A9553245FDE9B739 gpgv: Can't check signature: No public key guix refresh: warning: signature verification failed for 'mirror://gnu/hello/hello-2.10.tar.gz' (key: A9553245FDE9B739) guix refresh: warning: hello: version 2.10 could not be downloaded and authenticated; not updating Failure seems unrelated to patch series. - [x] "./pre-inst-env guix download mirror://gnu/hello/hello-2.10.tar.gz" and "./pre-inst-env guix hash /gnu/store/STUFF" return the same hash - [x] ./pre-inst-env guix hash -r $(./pre-inst-env guix build --source minetest-mesecons) returns the hash in the minetest-mesecons package Also a warning: ‘--recursive is deprecated, use --serializer' instead, but 'guix hash --help' doesn't tell what the argument of '--serializer' can be so I think I'll stick with '-r' for now. Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating and fetching 'git-fetch' origins. Makefile.am | 1 + guix/git.scm | 14 ++++++++- guix/hash.scm | 68 ++++++++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 ++----------------- guix/import/elpa.scm | 29 +++-------------- guix/import/git.scm | 22 +++++++------ guix/import/go.scm | 25 ++------------- guix/import/minetest.scm | 25 +++++++-------- guix/scripts/hash.scm | 22 +++---------- guix/scripts/refresh.scm | 10 +++--- guix/upstream.scm | 68 +++++++++++++++++++++++++++++++++++----- tests/minetest.scm | 7 ++--- 12 files changed, 190 insertions(+), 133 deletions(-) create mode 100644 guix/hash.scm base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 3/4] refresh: Support non-tarball sources. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 15:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164130899416385 (code B ref 50072); Tue, 04 Jan 2022 15:10:03 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 15:09:54 +0000 Received: from localhost ([127.0.0.1]:38448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRi-0004G7-6y for submit@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:54 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:40132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRX-0004F7-Ty for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:45 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ef9g2600W4UW6Th06f9hSu; Tue, 04 Jan 2022 16:09:41 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 15:09:36 +0000 Message-Id: <20220104150937.35872-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104150937.35872-1-maximedevos@telenet.be> References: <20220104150937.35872-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641308981; bh=1C9ahprOwcy10Tnk5guGYz+QxZ/hL2vALCXNKEI79wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Bp2w2GFiG4Ts/sYFXSxseb16fN1VXWRBBJ5iqbHaonnOB4iQ52YwCnrtiuGH268Od fuxyU8tWjByVV7X9hzygwlYCcPrr1RphKonEp2q5a3hFgmflcTLljpQEaL8x+h4NXH 3uOiK1TlLKvbgJbnr4yezImTgec4gnlxCQltxJYAFxOLsCtnux1s7eY07mRm1x/4tA hWmY5hooMpWh8j5wMCTq1Dj96hGQV0B662g39PCQdUxuz8gM3yCeE/PSnr7Mq+XOqu BOPM/rAQhUm+pvMARRM9DBfv6kpuXQJVj/+/Pjw92dIXQKwOCo3VSg2NAx051kiy5f daqa2+xf9JZJw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 8806f0f740..68bb9040d8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -363,8 +364,7 @@ warn about packages that have no matching updater." (info loc (G_ "~a: consider removing this propagated input: ~a~%") name change-name)))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 4/4] upstream: Support updating and fetching 'git-fetch' origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 15:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164130899516392 (code B ref 50072); Tue, 04 Jan 2022 15:10:03 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 15:09:55 +0000 Received: from localhost ([127.0.0.1]:38450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRi-0004GE-H8 for submit@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:55 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:40150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4lRX-0004F8-Ty for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 10:09:48 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ef9g2600W4UW6Th06f9hSy; Tue, 04 Jan 2022 16:09:41 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 15:09:37 +0000 Message-Id: <20220104150937.35872-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104150937.35872-1-maximedevos@telenet.be> References: <20220104150937.35872-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641308982; bh=QiD3exeARFKTO8aRSuAVLT6rafXwAxA/gqtoRI66V1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JZC8R5URCP5ZP+bpAOhrcs8nDNsielIGDDEdRerK/AKJE1bdPzrrztkQSwa/8BSc5 tUEOXAys2Kuk5Io67N4DL5zJ4JDRpIUru+hQ3Mu8Zkpj/AAFW6IOXVFYX/2YrJdWOz qQyGakHiVBVanAeP9BnE3dLXB61dnegRRoKkw3UxWtXBMc3BEp5A/PLG454xJ7w7+3 EB92ubN+O/GaFXYJur6DT1obwGvl5M4gh/nzSPll7LoAzBNYh2TlP3FLJLrNtAqtbv /VOijX/VEceLrMDxmdYJGDO2wAYZo10rUtc9dzLf/OWHDkGRcFQny26oMyV5dmBZRS QqX28hz7kFZRA== X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/git.scm (git-reference->git-checkout): New procedure. * guix/upstream.scm (package-update/git-fetch): New procedure. ()[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler/url-fetch): Split off from ... (upstream-source-compiler): ... this, and call ... (upstream-source-compiler/git-fetch): ... this new procedure if the URL field contains a 'git-reference'. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos --- guix/git.scm | 14 ++++++++- guix/import/git.scm | 22 +++++++------ guix/import/minetest.scm | 6 ++-- guix/upstream.scm | 68 +++++++++++++++++++++++++++++++++++----- tests/minetest.scm | 7 ++--- 5 files changed, 93 insertions(+), 24 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dc2ca1be84..43e85a5026 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2021 Kyle Meyer ;;; Copyright © 2021 Marius Bakke +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,8 @@ #:use-module (guix utils) #:use-module (guix records) #:use-module (guix gexp) + #:autoload (guix git-download) + (git-reference-url git-reference-commit git-reference-recursive?) #:use-module (guix sets) #:use-module ((guix diagnostics) #:select (leave warning)) #:use-module (guix progress) @@ -65,7 +68,9 @@ git-checkout-url git-checkout-branch git-checkout-commit - git-checkout-recursive?)) + git-checkout-recursive? + + git-reference->git-checkout)) (define %repository-cache-directory (make-parameter (string-append (cache-directory #:ensure? #f) @@ -672,6 +677,13 @@ is true, limit to only refs/tags." (commit git-checkout-commit (default #f)) ;#f | tag | commit (recursive? git-checkout-recursive? (default #f))) +(define (git-reference->git-checkout reference) + "Convert the REFERENCE to an equivalent ." + (git-checkout + (url (git-reference-url reference)) + (commit (git-reference-commit reference)) + (recursive? (git-reference-recursive? reference)))) + (define* (latest-repository-commit* url #:key ref recursive? log-port) ;; Monadic variant of 'latest-repository-commit'. (lambda (store) diff --git a/guix/import/git.scm b/guix/import/git.scm index 1eb219f3fe..4cf404677c 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (%generic-git-updater ;; For tests. @@ -172,21 +174,21 @@ repository at URL." (values version tag))))))) (define (latest-git-tag-version package) - "Given a PACKAGE, return the latest version of it, or #f if the latest version -could not be determined." + "Given a PACKAGE, return the latest version of it and the corresponding git +tag, or #false and #false if the latest version could not be determined." (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c)) (warning (or (package-field-location package 'source) (package-location package)) (G_ "~a for ~a~%") (condition-message c) (package-name package)) - #f) + (values #f #f)) ((eq? (exception-kind c) 'git-error) (warning (or (package-field-location package 'source) (package-location package)) (G_ "failed to fetch Git repository for ~a~%") (package-name package)) - #f)) + (values #f #f))) (let* ((source (package-source package)) (url (git-reference-url (origin-uri source))) (property (cute assq-ref (package-properties package) <>))) @@ -208,14 +210,16 @@ could not be determined." "Return an for the latest release of PACKAGE." (let* ((name (package-name package)) (old-version (package-version package)) - (url (git-reference-url (origin-uri (package-source package)))) - (new-version (latest-git-tag-version package))) - - (and new-version + (old-reference (origin-uri (package-source package))) + (new-version new-version-tag (latest-git-tag-version package))) + (and new-version new-version-tag (upstream-source (package name) (version new-version) - (urls (list url)))))) + (urls (git-reference + (url (git-reference-url old-reference)) + (commit new-version-tag) + (recursive? (git-reference-recursive? old-reference)))))))) (define %generic-git-updater (upstream-updater diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index a7bdbfebca..3b2cdcdcac 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -504,9 +504,9 @@ or #false if the latest release couldn't be determined." (upstream-source (package (package:package-name pkg)) (version (release-version release)) - (urls (list (download:git-reference - (url (package-repository contentdb-package)) - (commit (release-commit release)))))))) + (urls (download:git-reference + (url (package-repository contentdb-package)) + (commit (release-commit release))))))) (define %minetest-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..bb6db2cedb 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,8 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,12 +26,14 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix base32) #:use-module (guix gexp) + #:use-module (guix git) #:use-module (guix store) #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) #:autoload (gcrypt hash) (port-sha256) @@ -93,7 +97,7 @@ upstream-source? (package upstream-source-package) ;string (version upstream-source-version) ;string - (urls upstream-source-urls) ;list of strings + (urls upstream-source-urls) ;list of strings|git-reference (signature-urls upstream-source-signature-urls ;#f | list of strings (default #f)) (input-changes upstream-source-input-changes @@ -357,10 +361,20 @@ values: 'interactive' (default), 'always', and 'never'." data url) #f))))))) -(define-gexp-compiler (upstream-source-compiler (source ) - system target) - "Download SOURCE from its first URL and lower it as a fixed-output -derivation that would fetch it." +(define (upstream-source-compiler/git-fetch source system target) + "Lower SOURCE, an using git." + ;; TODO: it would be nice to support provenance tracking, as + ;; in 'upstream-source-compiler/url-fetch'. + ;; + ;; TODO: this causes + ;; + ;; ‘Wrong type to apply: #< url: "https://github.com/minetest-mods/unified_inventory" branch: #f commit: "d6688872c84417d2f61d6f5e607aea39d78920aa" recursive?: #f>’? + ;; (Another error results if it is wrapped in a 'return'.) + (git-reference->git-checkout (upstream-source-urls source))) + +(define (upstream-source-compiler/url-fetch source system target) + "Lower SOURCE, an pointing to a tarball, as a +fixed-output derivation that would fetch it, and verify its authenticity." (mlet* %store-monad ((url -> (first (upstream-source-urls source))) (signature -> (and=> (upstream-source-signature-urls source) @@ -378,6 +392,15 @@ derivation that would fetch it." (url-fetch url 'sha256 hash (store-path-package-name tarball) #:system system)))) +(define-gexp-compiler (upstream-source-compiler (source ) + system target) + "Download SOURCE and verify its authenticity if possible. When feasible, +lower it as a fixed-output derivation that would fetch it, to improve +provenance tracking." + (if (git-reference? (upstream-source-urls source)) + (upstream-source-compiler/git-fetch source system target) + (upstream-source-compiler/url-fetch source system target))) + (define (find2 pred lst1 lst2) "Like 'find', but operate on items from both LST1 and LST2. Return two values: the item from LST1 and the item from LST2 that match PRED." @@ -430,9 +453,24 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define* (package-update/git-fetch store package source #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + ;; TODO: it would be nice to authenticate commits, e.g. with + ;; "guix git authenticate" or a list of permitted signing keys. + (define ref (upstream-source-urls source)) ; a + (values (upstream-source-version source) + (latest-repository-commit + store + (git-reference-url ref) + #:ref `(tag-or-commit . ,(git-reference-commit ref)) + #:recursive? (git-reference-recursive? ref)) + source)) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) @@ -492,9 +530,22 @@ new version string if an update was made, and #f otherwise." (origin-hash (package-source package)))) (old-url (match (origin-uri (package-source package)) ((? string? url) url) + ((? git-reference? ref) + (git-reference-url ref)) (_ #f))) (new-url (match (upstream-source-urls source) - ((first _ ...) first))) + ((first _ ...) first) + ((? git-reference? ref) + (git-reference-url ref)) + (_ #f))) + (old-commit (match (origin-uri (package-source package)) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) + (new-commit (match (upstream-source-urls source) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) (file (and=> (location-file loc) (cut search-path %load-path <>)))) (if file @@ -508,6 +559,9 @@ new version string if an update was made, and #f otherwise." 'filename file)) (replacements `((,old-version . ,version) (,old-hash . ,hash) + ,@(if (and old-commit new-commit) + `((,old-commit . ,new-commit)) + '()) ,@(if (and old-url new-url) `((,(dirname old-url) . ,(dirname new-url))) diff --git a/tests/minetest.scm b/tests/minetest.scm index 77b9aa928f..cbb9e83889 100644 --- a/tests/minetest.scm +++ b/tests/minetest.scm @@ -387,10 +387,9 @@ during a dynamic extent where that package is available on ContentDB." ;; Update detection (define (upstream-source->sexp upstream-source) - (define urls (upstream-source-urls upstream-source)) - (unless (= 1 (length urls)) - (error "only a single URL is expected")) - (define url (first urls)) + (define url (upstream-source-urls upstream-source)) + (unless (git-reference? url) + (error "a is expected")) `(,(upstream-source-package upstream-source) ,(upstream-source-version upstream-source) ,(git-reference-url url) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v3 0/4] Add upstream updater for git-fetch origins Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132311516852 (code B ref 50072); Tue, 04 Jan 2022 19:06:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 19:05:15 +0000 Received: from localhost ([127.0.0.1]:38738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4p7S-0004Nk-PV for submit@debbugs.gnu.org; Tue, 04 Jan 2022 14:05:14 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:50898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4p7N-0004NU-9V for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 14:05:12 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ej572600K4UW6Th06j57uT; Tue, 04 Jan 2022 20:05:07 +0100 Message-ID: <13761a088afab728d9e0b390533648c99b409824.camel@telenet.be> From: Maxime Devos Date: Tue, 04 Jan 2022 19:05:03 +0000 In-Reply-To: <20220104150937.35872-1-maximedevos@telenet.be> References: <20220104150937.35872-1-maximedevos@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-0KfoN59VlyFg3jhS1xhV" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641323107; bh=pjo20Hc9k2lBGBDd2TmPDBmLyhNA8ItqG1VQXr8iZdE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=kTQuqnmSE8PkkOHhYiHIQP40ox8YbA0PzKy2xILkJZJo8KztVWzEpHT/mI1tTKnc7 wnesFF+4wEmO+iwkgWocCEweRMYNzanQwCdXKOCbzVKf8m/lUSLN9Bn5B1M5oQSDgM xXYEi0ioeY+SJLsMGLjk3GLWvqueAvv80WXfzJpvSUGuYamT49B0y4Gv+qJ9ymuxqD snAvKhcTtEEpKfY2o55hWdYQL9UNHqWA+9idwh0Tjo/fmS9zN9WsJO1iNrvOeIuGJY RBryiFbtFtC0egLEq7eW3/ZcmM8i3abIso0u+6pC3Ng72jSWviZ3k4o7XkMBfVmI1W Q4JObU13cDLUA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-0KfoN59VlyFg3jhS1xhV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxime Devos schreef op di 04-01-2022 om 15:09 [+0000]: > =C2=A0 * the compiler has been modified to support git-= fetch > =C2=A0=C2=A0=C2=A0 origins. >=20 > =C2=A0=C2=A0=C2=A0 However, it is broken, and I don't know how to resolve= the issue. > =C2=A0=C2=A0=C2=A0 (Except perhaps by using latest-repository-commit dire= ctly but that > =C2=A0=C2=A0=C2=A0 shouldn't be necessary, since objects a= re lowerable?) I think I have an idea how to solve this. Will send a v4 later --=-0KfoN59VlyFg3jhS1xhV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdSaXxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7u2rAP90Ms3Df8ESR7bSBjuFq5hNpwsw FasX3LwO+Yj7V2GG3QEAkp5MXFsztZpj2SmAMdv+h+7FndOgDphCpzs0L0Pf/wk= =OmBU -----END PGP SIGNATURE----- --=-0KfoN59VlyFg3jhS1xhV-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v4 2/4] import: Factorize file hashing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132681931023 (code B ref 50072); Tue, 04 Jan 2022 20:07:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 20:06:59 +0000 Received: from localhost ([127.0.0.1]:38799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q58-000844-Cx for submit@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:59 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q56-00083f-3e for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:53 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ek6q260014UW6Th06k6q5r; Tue, 04 Jan 2022 21:06:50 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 20:06:41 +0000 Message-Id: <20220104200643.43374-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104200643.43374-1-maximedevos@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641326810; bh=pToVcY6tyNJdA8to9CMlcbffGWezAHQB9+uOz7gou4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MKHSbVoHJbAWTqQoDesTUYk3Uc3Qu+Cpt1movwcXBCFcSMz7UDnawy3A0dyj14yQm QoASd/oPueXAol3qBn2Uzjbj9/5vRdoNtd8Qz65z2FfCQEKD3ui1wUnDovNY7yP5WZ qfsBznEf/c3+fO0QRyzLjJE8X6SE2dluGj4Qnc1xByzbGvjFge2CiWw2Thevpa0Evn LH8adCqBUkRmZn7tfY3aHcJntJ0i/lJswH694SobAZRqXG7RtR16PKQlWZ1j2p6Exw mvQ5s6x0b6jUdYSMCFpZypMD689ZmuNxOQmCP5Q4OgBT79jQsKyMN9/w+Y6ErkgQaw TmBaK0WMu+z3w== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->o [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.137.88 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. * guix/import/minetest.scm (file-hash): Remove procedure. (make-minetest-sexp): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 29 +++++------------------------ guix/import/go.scm | 25 +++---------------------- guix/import/minetest.scm | 19 ++++++++----------- 4 files changed, 19 insertions(+), 86 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 1389576cad..b61402078d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,10 +36,9 @@ #:use-module (guix memoization) #:use-module (guix http-client) #:use-module (guix diagnostics) + #:use-module (guix hash) #:use-module (guix i18n) - #:use-module (gcrypt hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -196,17 +196,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -464,16 +453,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -571,12 +550,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source #:recursive? (or git? hg?))))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..c5167eacb5 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -229,27 +230,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -271,7 +251,7 @@ RECIPE." (sha256 (base32 ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + (file-hash* directory #:recursive? #true))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -380,7 +360,8 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string + (file-hash* tarball #:recursive? #false)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 26dbc34b63..c7673e6a1a 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -26,6 +26,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -36,11 +37,10 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) #:autoload (guix serialization) (write-file) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:use-module (ice-9 match) #:use-module (ice-9 peg) #:use-module (ice-9 rdelim) @@ -499,25 +499,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -536,7 +517,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm #:recursive? #true))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index abddd885ee..a7bdbfebca 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module (guix base32) #:use-module (guix git) #:use-module ((guix git-download) #:prefix download:) + #:use-module (guix hash) #:use-module (guix store) #:export (%default-sort-key %contentdb-api @@ -286,14 +287,6 @@ results. The return value is a list of records." (with-store store (latest-repository-commit store url #:ref ref))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file) - "Compute the hash of FILE." - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port) - (force-output port) - (get-hash))) - (define (make-minetest-sexp author/name version repository commit inputs home-page synopsis description media-license license) @@ -314,9 +307,13 @@ MEDIA-LICENSE and LICENSE." ;; The git commit is not always available. ,(and commit (bytevector->nix-base32-string - (file-hash + (file-hash* (download-git-repository repository - `(commit . ,commit))))))) + `(commit . ,commit)) + ;; 'download-git-repository' already filtered out the '.git' + ;; directory. + #:select? (const #true) + #:recursive? #true))))) (file-name (git-file-name name version)))) (build-system minetest-mod-build-system) ,@(maybe-propagated-inputs (map contentdb->package-name inputs)) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v4 1/4] guix hash: Extract file hashing procedures. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132682031032 (code B ref 50072); Tue, 04 Jan 2022 20:07:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 20:07:00 +0000 Received: from localhost ([127.0.0.1]:38801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q5D-00084K-IX for submit@debbugs.gnu.org; Tue, 04 Jan 2022 15:07:00 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q56-00083e-3H for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:53 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ek6q260014UW6Th06k6q5m; Tue, 04 Jan 2022 21:06:50 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 20:06:40 +0000 Message-Id: <20220104200643.43374-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104200643.43374-1-maximedevos@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641326810; bh=i9yb7nh1nBUy1tiYhhqR0CWJ3JVd+uJc5NmKjxoYf0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EEZbBeebeOrVtRmFroCCtV65TOKzdaJuFoTHeofNlnoztvJBtrgo62n6e7vWLQupP IJukbu6q/a+LRNN9edSSgqTbwQhc8DddKySk/YgWBERRpORmCU/ayAKv2139KSd1Jc 75UiY64PMDyInvsgcC2A5sKIaTunHpWR4Mi+SVXMb0bHW3vA6hV0Udo712vS/OiHRn zacAYtYZcbQXlh7Pm+qIRWDJqgVHtetBf1YSnFY9op6o2MdeMb51RXgK2omeGe1L5R v1tAEHQbxWyFN6ZZ/H8Ged7dAOkarQK9d/ERjRVTPYwi+18WPg8PUBLk+t2uMf6Lf3 mZTqYTtnE9euQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/hash.scm (guix-hash)[vcs-file?] (nar-hash, default-hash): Extract hashing logic to... * guix/hash.scm (vcs-file?, file-hash*): ... these new procedures in this new file. Modified-by: Maxime Devos --- Makefile.am | 1 + guix/hash.scm | 68 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 22 +++----------- 3 files changed, 73 insertions(+), 18 deletions(-) create mode 100644 guix/hash.scm diff --git a/Makefile.am b/Makefile.am index 8c5682a1c6..bc3d0087d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,6 +99,7 @@ MODULES = \ guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..19cbc41ad1 --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? 'auto) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is #true or 'auto', +recurse into subdirectories of FILE, computing the combined hash (nar hash) of +all files for which (SELECT? FILE STAT) returns true. + +Symbolic links are not dereferenced unless RECURSIVE? is false. + +This procedure must only be used under controlled circumstances; +the detection of symbolic links in FILE is racy. + +Keep in mind that the hash of a regular file depends on RECURSIVE?: +if the recursive hash is desired, it must be set to #true. Otherwise, it must +be set to #false or 'auto'. In most situations, the non-recursive hash is desired +for regular files." + (if (or (eq? recursive? #true) + (and (eq? recursive? 'auto) + ;; Don't change this to (eq? 'directory ...), because otherwise + ;; if 'file' denotes a symbolic link, the 'file-hash' below + ;; would dereference it -- dereferencing symbolic links would + ;; open an avoidable can of potential worms. + (not (eq? 'regular (stat:type (lstat file)))))) + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..28d587b944 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -46,20 +48,14 @@ (define* (nar-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) - (let-values (((port get-hash) - (open-hash-port algorithm))) - (write-file file port #:select? select?) - (force-output port) - (get-hash))) + (file-hash* file #:algorithm algorithm #:select? select? #:recursive? #true)) (define* (default-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) (match file ("-" (port-hash algorithm (current-input-port))) - (_ - (call-with-input-file file - (cute port-hash algorithm <>))))) + (_ (file-hash* file #:algorithm algorithm #:recursive? #false)))) (define* (git-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) @@ -181,16 +177,6 @@ use '--serializer' instead~%")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v4 3/4] refresh: Support non-tarball sources. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132682031039 (code B ref 50072); Tue, 04 Jan 2022 20:07:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 20:07:00 +0000 Received: from localhost ([127.0.0.1]:38803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q5E-00084T-CU for submit@debbugs.gnu.org; Tue, 04 Jan 2022 15:07:00 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q56-00083g-3g for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:54 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ek6q260014UW6Th06k6q5u; Tue, 04 Jan 2022 21:06:50 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 20:06:42 +0000 Message-Id: <20220104200643.43374-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104200643.43374-1-maximedevos@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641326810; bh=1C9ahprOwcy10Tnk5guGYz+QxZ/hL2vALCXNKEI79wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q2FMt56Kjqv18EKIa8UlIU6KdMiKmM26ElzGlG35J5vUOKn5T9/jXuP+hr9LM72qm IEuEnMkJshUD/vx+5QN3LkxEY4I/10WMIWLXbLCh+Tbmd1wuQi3dOP9eni2PqI1tI8 Wcy3cT4eUC1J4IXqqAVOjxgphB/4/sjeI3BGKO520TEoRYw3scXgLccQa3YoCVbXCK GIycFPWWrtXhCPQaeA8JnFM17oh1cyRhukmHsr2pV8sSYs8BwcMYkiXRiu+I3o3GsG +B4TzZIBVvW8MCd9S6cRNBL+TcH/32kt1LUIxWf/NP9LuenLtoOKsPn056EQBEa0Dy wf5ixDv8QOPOQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 8806f0f740..68bb9040d8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -363,8 +364,7 @@ warn about packages that have no matching updater." (info loc (G_ "~a: consider removing this propagated input: ~a~%") name change-name)))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v4 0/4] Add upstream updater for git-fetch origins References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 20:07:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132682131046 (code B ref 50072); Tue, 04 Jan 2022 20:07:03 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 20:07:01 +0000 Received: from localhost ([127.0.0.1]:38805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q5E-00084a-MH for submit@debbugs.gnu.org; Tue, 04 Jan 2022 15:07:00 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q56-00083d-3a for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:54 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ek6q260014UW6Th06k6q5j; Tue, 04 Jan 2022 21:06:50 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 20:06:39 +0000 Message-Id: <20220104200643.43374-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641326810; bh=QLxMUTuKH8tat9OEh43UPkB9+BGFE7mmNDaJyVnY8Jo=; h=From:To:Cc:Subject:Date; b=UnY1wDaVEB0uJIRmVBnCYM44a83fb/xJmCoS8ty/TkmqQvx8gcK/4TvTEnUNzk0o2 cGNqGrqenDwxUBZbm1cKHXpXnXSYtctAqn+I8oUg/dzZouIOKU5CgERstnzQN7jbRH Ihn6nlCrBBkHiteWihRqQQ4U6r1HsFopLN36i8XpeqzWnxnoU7vufAwRJtodokvscP omav7GfHlkabA6tljy71feSMzSi2ceqZqmvNkL5Cupe8Ud+XcEw/6sGvfMwAEh7ZB+ GtjVuXg35PhXu2/F6QEU7EIGTAVmwCCisZuxneZqVvSTmv/ixfj3Lu8bMm886myY/w LA4J0107tNeTA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) I've found a solution to the upstream-source-compiler/git-fetch problem: returning the result of git-fetch like upstream-source-compiler/url-fetch returns the result of url-fetch. The following now works: $ ./pre-inst-env guix build --source minetest-unified-inventory --with-latest=minetest-unified-inventory Unrelated change: I let (guix git) be autoloaded, to avoid loading guile-git when not necessary. I think this patch series is ready now? Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating and fetching 'git-fetch' origins. Makefile.am | 1 + guix/git.scm | 14 +++++++- guix/hash.scm | 68 +++++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 ++---------------- guix/import/elpa.scm | 29 +++------------- guix/import/git.scm | 22 +++++++----- guix/import/go.scm | 25 ++------------ guix/import/minetest.scm | 25 ++++++-------- guix/scripts/hash.scm | 22 +++--------- guix/scripts/refresh.scm | 10 +++--- guix/upstream.scm | 73 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++-- 12 files changed, 195 insertions(+), 133 deletions(-) create mode 100644 guix/hash.scm base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v4 4/4] upstream: Support updating and fetching 'git-fetch' origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 20:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164132682531101 (code B ref 50072); Tue, 04 Jan 2022 20:08:01 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 20:07:05 +0000 Received: from localhost ([127.0.0.1]:38807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q5E-00084h-UQ for submit@debbugs.gnu.org; Tue, 04 Jan 2022 15:07:05 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:47966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4q56-00083h-50 for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 15:06:57 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ek6q260014UW6Th06k6q5w; Tue, 04 Jan 2022 21:06:51 +0100 From: Maxime Devos Date: Tue, 4 Jan 2022 20:06:43 +0000 Message-Id: <20220104200643.43374-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220104200643.43374-1-maximedevos@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641326811; bh=OcXbP9H75mnRWI/rumIqeKoSasXir76HNnl6Eq+S86Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Dm5CtVBvr/cozrphBaLEYNl6Z4ENMsTAUwDktEV8iv+GoWnt9Aaqi+0lL58NE0IhI 88prX8Bv7+9/7KMJpJRzyL7t17rSZGisUg4H7aDVLHkSSCxN1Uf2NLje1pcLxGH+vl PX6LZRQYBd19mvJ+ec2D0k0awh+aG/Nu1NinlQ3SJze1hGwnoHn5hKqOa9nkWrsQZS 5mjDrUeJgugGQsViWNvP0xI0soe65e68UGUEBfYgFX5Lqlekimv9sKnP2i6sxTWXLe MvoAu4/usuOQ7bnzXnGtzz8I/nPpaYHwn6w7W+7b3alTukMdOa435UkBy8wX/AxaW0 ChxOKw5Tiun9Q== X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/git.scm (git-reference->git-checkout): New procedure. * guix/upstream.scm (package-update/git-fetch): New procedure. ()[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler/url-fetch): Split off from ... (upstream-source-compiler): ... this, and call ... (upstream-source-compiler/git-fetch): ... this new procedure if the URL field contains a 'git-reference'. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos --- guix/git.scm | 14 +++++++- guix/import/git.scm | 22 +++++++----- guix/import/minetest.scm | 6 ++-- guix/upstream.scm | 73 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++-- 5 files changed, 98 insertions(+), 24 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dc2ca1be84..43e85a5026 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2021 Kyle Meyer ;;; Copyright © 2021 Marius Bakke +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,8 @@ #:use-module (guix utils) #:use-module (guix records) #:use-module (guix gexp) + #:autoload (guix git-download) + (git-reference-url git-reference-commit git-reference-recursive?) #:use-module (guix sets) #:use-module ((guix diagnostics) #:select (leave warning)) #:use-module (guix progress) @@ -65,7 +68,9 @@ git-checkout-url git-checkout-branch git-checkout-commit - git-checkout-recursive?)) + git-checkout-recursive? + + git-reference->git-checkout)) (define %repository-cache-directory (make-parameter (string-append (cache-directory #:ensure? #f) @@ -672,6 +677,13 @@ is true, limit to only refs/tags." (commit git-checkout-commit (default #f)) ;#f | tag | commit (recursive? git-checkout-recursive? (default #f))) +(define (git-reference->git-checkout reference) + "Convert the REFERENCE to an equivalent ." + (git-checkout + (url (git-reference-url reference)) + (commit (git-reference-commit reference)) + (recursive? (git-reference-recursive? reference)))) + (define* (latest-repository-commit* url #:key ref recursive? log-port) ;; Monadic variant of 'latest-repository-commit'. (lambda (store) diff --git a/guix/import/git.scm b/guix/import/git.scm index 1eb219f3fe..4cf404677c 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (%generic-git-updater ;; For tests. @@ -172,21 +174,21 @@ repository at URL." (values version tag))))))) (define (latest-git-tag-version package) - "Given a PACKAGE, return the latest version of it, or #f if the latest version -could not be determined." + "Given a PACKAGE, return the latest version of it and the corresponding git +tag, or #false and #false if the latest version could not be determined." (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c)) (warning (or (package-field-location package 'source) (package-location package)) (G_ "~a for ~a~%") (condition-message c) (package-name package)) - #f) + (values #f #f)) ((eq? (exception-kind c) 'git-error) (warning (or (package-field-location package 'source) (package-location package)) (G_ "failed to fetch Git repository for ~a~%") (package-name package)) - #f)) + (values #f #f))) (let* ((source (package-source package)) (url (git-reference-url (origin-uri source))) (property (cute assq-ref (package-properties package) <>))) @@ -208,14 +210,16 @@ could not be determined." "Return an for the latest release of PACKAGE." (let* ((name (package-name package)) (old-version (package-version package)) - (url (git-reference-url (origin-uri (package-source package)))) - (new-version (latest-git-tag-version package))) - - (and new-version + (old-reference (origin-uri (package-source package))) + (new-version new-version-tag (latest-git-tag-version package))) + (and new-version new-version-tag (upstream-source (package name) (version new-version) - (urls (list url)))))) + (urls (git-reference + (url (git-reference-url old-reference)) + (commit new-version-tag) + (recursive? (git-reference-recursive? old-reference)))))))) (define %generic-git-updater (upstream-updater diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index a7bdbfebca..3b2cdcdcac 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -504,9 +504,9 @@ or #false if the latest release couldn't be determined." (upstream-source (package (package:package-name pkg)) (version (release-version release)) - (urls (list (download:git-reference - (url (package-repository contentdb-package)) - (commit (release-commit release)))))))) + (urls (download:git-reference + (url (package-repository contentdb-package)) + (commit (release-commit release))))))) (define %minetest-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..1fe996ef3d 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,8 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,12 +26,15 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix base32) #:use-module (guix gexp) + #:autoload (guix git) (latest-repository-commit git-reference->git-checkout) + #:use-module (guix hash) #:use-module (guix store) #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) #:autoload (gcrypt hash) (port-sha256) @@ -93,7 +98,7 @@ upstream-source? (package upstream-source-package) ;string (version upstream-source-version) ;string - (urls upstream-source-urls) ;list of strings + (urls upstream-source-urls) ;list of strings|git-reference (signature-urls upstream-source-signature-urls ;#f | list of strings (default #f)) (input-changes upstream-source-input-changes @@ -357,10 +362,9 @@ values: 'interactive' (default), 'always', and 'never'." data url) #f))))))) -(define-gexp-compiler (upstream-source-compiler (source ) - system target) - "Download SOURCE from its first URL and lower it as a fixed-output -derivation that would fetch it." +(define (upstream-source-compiler/url-fetch source system) + "Lower SOURCE, an pointing to a tarball, as a +fixed-output derivation that would fetch it, and verify its authenticity." (mlet* %store-monad ((url -> (first (upstream-source-urls source))) (signature -> (and=> (upstream-source-signature-urls source) @@ -378,6 +382,30 @@ derivation that would fetch it." (url-fetch url 'sha256 hash (store-path-package-name tarball) #:system system)))) +(define (upstream-source-compiler/git-fetch source system) + "Lower SOURCE, an using git, as a fixed-output +derivation that would fetch it." + (mlet* %store-monad ((reference -> (upstream-source-urls source)) + (checkout + (lower-object + (git-reference->git-checkout reference) + system))) + ;; Like in 'upstream-source-compiler/url-fetch', return a fixed-output + ;; derivation instead of CHECKOUT. + (git-fetch reference 'sha256 + (file-hash* checkout #:recursive? #true #:select? (const #true)) + (git-file-name (upstream-source-package source) + (upstream-source-version source)) + #:system system))) + +(define-gexp-compiler (upstream-source-compiler (source ) + system target) + "Download SOURCE, lower it as a fixed-output derivation that would fetch it, +and verify its authenticity if possible." + (if (git-reference? (upstream-source-urls source)) + (upstream-source-compiler/git-fetch source system) + (upstream-source-compiler/url-fetch source system))) + (define (find2 pred lst1 lst2) "Like 'find', but operate on items from both LST1 and LST2. Return two values: the item from LST1 and the item from LST2 that match PRED." @@ -430,9 +458,24 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define* (package-update/git-fetch store package source #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + ;; TODO: it would be nice to authenticate commits, e.g. with + ;; "guix git authenticate" or a list of permitted signing keys. + (define ref (upstream-source-urls source)) ; a + (values (upstream-source-version source) + (latest-repository-commit + store + (git-reference-url ref) + #:ref `(tag-or-commit . ,(git-reference-commit ref)) + #:recursive? (git-reference-recursive? ref)) + source)) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) @@ -492,9 +535,22 @@ new version string if an update was made, and #f otherwise." (origin-hash (package-source package)))) (old-url (match (origin-uri (package-source package)) ((? string? url) url) + ((? git-reference? ref) + (git-reference-url ref)) (_ #f))) (new-url (match (upstream-source-urls source) - ((first _ ...) first))) + ((first _ ...) first) + ((? git-reference? ref) + (git-reference-url ref)) + (_ #f))) + (old-commit (match (origin-uri (package-source package)) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) + (new-commit (match (upstream-source-urls source) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) (file (and=> (location-file loc) (cut search-path %load-path <>)))) (if file @@ -508,6 +564,9 @@ new version string if an update was made, and #f otherwise." 'filename file)) (replacements `((,old-version . ,version) (,old-hash . ,hash) + ,@(if (and old-commit new-commit) + `((,old-commit . ,new-commit)) + '()) ,@(if (and old-url new-url) `((,(dirname old-url) . ,(dirname new-url))) diff --git a/tests/minetest.scm b/tests/minetest.scm index 77b9aa928f..cbb9e83889 100644 --- a/tests/minetest.scm +++ b/tests/minetest.scm @@ -387,10 +387,9 @@ during a dynamic extent where that package is available on ContentDB." ;; Update detection (define (upstream-source->sexp upstream-source) - (define urls (upstream-source-urls upstream-source)) - (unless (= 1 (length urls)) - (error "only a single URL is expected")) - (define url (first urls)) + (define url (upstream-source-urls upstream-source)) + (unless (git-reference? url) + (error "a is expected")) `(,(upstream-source-package upstream-source) ,(upstream-source-version upstream-source) ,(git-reference-url url) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jan 2022 22:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164133507812039 (code B ref 50072); Tue, 04 Jan 2022 22:25:02 +0000 Received: (at 50072) by debbugs.gnu.org; 4 Jan 2022 22:24:38 +0000 Received: from localhost ([127.0.0.1]:38977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4sEQ-000386-FG for submit@debbugs.gnu.org; Tue, 04 Jan 2022 17:24:38 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:46877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4sEO-00037s-Ed for 50072@debbugs.gnu.org; Tue, 04 Jan 2022 17:24:36 -0500 Received: by mail-wr1-f46.google.com with SMTP id i22so78969608wrb.13 for <50072@debbugs.gnu.org>; Tue, 04 Jan 2022 14:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=K7LRyDLoRvEn0ePqF2XNhk1IzKPQZNaC74/R2snr3J4=; b=X9cD+N+HZCxEO7IgW28RdobFAI7VFj1GgEmFuKs+00ZNoQP6iir9XQzhxyyhNaBJAr ebgaykIpTMsi4DqIeP2ee7+q3s23RdPS+RYUQpszBSsegrEgy7u2MWUV4aaaryG2kc1g cW/zi2dyd8Fe+E7sPvxjvp5kHm8UUM2oQdYtAh5BtFewx8zwNH2kEpKq5I6PeOcEY5We otLVciquknW7LHmBM+RUi0XfmBcVGv3Sw7Jd4FpR4gQX9jAaMZNqkWtENnOyW1j6xH+h B8mMs0paVVnNc6MmCc25TiZRW9H2xS5xtiUgLMRwYS2HTqMmi1SRNagfUsi9fbjU+gst ye+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=K7LRyDLoRvEn0ePqF2XNhk1IzKPQZNaC74/R2snr3J4=; b=NiPGOMDGpnzshaXG4EoMKbkhGYZoWZvPMFzNJR/ybWnsgJDnb0fNJh2gEhA3R7ADQN WldtX3snhgJA+PBaDrrRv92jixVTQ2wnnbfZtexcpa2OP9c9xMEBsmnGGsCYh33hBxI7 OEjprSr9qJ5flhliceXEb3cv0TBZA0VgFouyE/ICqrqgOjwzVLwpIyyTcfnx+oZ3f55z B+qvCB7du6Idm6dp8jHRQ0eHQCi3hB3Hgt/vSDzCRQrgNeA0aSYYlPeejy3wrNzqqDQq 6G5TLA82Z1N4Wuwat9MBvJu4n71983thty/o8SVLaUigRQ70UvJtC1qnlKAbmZvu2QZy wQzw== X-Gm-Message-State: AOAM5309kJxrxMW5dLn3wfjGzIyZEFaeO0hTf6vKmpJtdBeujajzRnlp ugw6Y9RuL26t+lcmx4LF2tY= X-Google-Smtp-Source: ABdhPJwVgBWPmr6dqoN7hrjVS0Xee657Fw8/j/4zhYq/IPBvCXFscOzPLPnvFCaF+jJGYvEDvINQwg== X-Received: by 2002:adf:e403:: with SMTP id g3mr30299194wrm.272.1641335070519; Tue, 04 Jan 2022 14:24:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u14sm38451388wrf.39.2022.01.04.14.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 14:24:30 -0800 (PST) From: zimoun References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> Date: Tue, 04 Jan 2022 23:22:44 +0100 In-Reply-To: <20220104200643.43374-2-maximedevos@telenet.be> (Maxime Devos's message of "Tue, 4 Jan 2022 20:06:40 +0000") Message-ID: <867dbfcf9n.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, Thanks! All LGTM and I have two naive remarks. On Tue, 04 Jan 2022 at 20:06, Maxime Devos wrote: > diff --git a/guix/hash.scm b/guix/hash.scm [...] > +(define-module (guix hash) > + #:use-module (gcrypt hash) > + #:use-module (guix serialization) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-11) > + #:export (vcs-file? > + file-hash*)) > + > +(define (vcs-file? file stat) > + "Returns true if FILE is a version control system file." > + (case (stat:type stat) > + ((directory) > + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) > + ((regular) > + ;; Git sub-modules have a '.git' file that is a regular text file. > + (string=3D? (basename file) ".git")) > + (else > + #f))) 1) Why =E2=80=99vcs-file?=E2=80=99 requires to be exported? Is it used els= ewhere? > +(define* (file-hash* file #:key > + (algorithm (hash-algorithm sha256)) > + (recursive? 'auto) 2) =E2=80=99auto=E2=80=99 is confusing=E2=80=A6 > + (select? (negate vcs-file?))) > + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is #true or '= auto', > +recurse into subdirectories of FILE, computing the combined hash (nar ha= sh) of =E2=80=A6here I understand that =E2=80=99auto=E2=80=99 means #true=E2=80=A6 > +Keep in mind that the hash of a regular file depends on RECURSIVE?: > +if the recursive hash is desired, it must be set to #true. Otherwise, i= t must > +be set to #false or 'auto'. In most situations, the non-recursive hash i= s desired > +for regular files." =E2=80=A6but there it is the contrary. :-) To me, #true/#false or #t/#f are meaningful, especially when=E2=80=A6 > + (if (or (eq? recursive? #true) > + (and (eq? recursive? 'auto) =E2=80=A6the symbol =E2=80=99auto=E2=80=99 is only used here. IIRC all the= series. :-) (I know Ricardo is for instance in favor of #true/#false compared to #t/#f. I have an opinion but I would like to avoid another bikeshed. ;-)) Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 10:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164137723517221 (code B ref 50072); Wed, 05 Jan 2022 10:08:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 10:07:15 +0000 Received: from localhost ([127.0.0.1]:39616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n53CN-0004Th-EM for submit@debbugs.gnu.org; Wed, 05 Jan 2022 05:07:15 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:59924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n53CL-0004TW-H4 for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 05:07:14 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id ey7B2600H4UW6Th06y7CKh; Wed, 05 Jan 2022 11:07:12 +0100 Message-ID: <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> From: Maxime Devos Date: Wed, 05 Jan 2022 11:07:06 +0100 In-Reply-To: <867dbfcf9n.fsf_-_@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-K0kdrlY7wUTtQSQn9jfZ" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641377232; bh=nKKd+dR69zkBc3O718gcGXeHQfPTkAOiQdoxFzF2so4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I4xSLBinmkOGdnZN61ReikSu9XVBk+IjLnQijTLY1MgxJgljbo6d+/X3fyI58aJPA RomE0Q30v2lZ8fHCVcsgD9Dk8ocbQc0lvqXipe7arrXlcTG+P7deyzH2VlhRFKxMfD jgyxUeerDQIiWLi2g+Cdh64Vv1ptdg4dT/soJEUrtLUe2mqMCMRXCbIOGKucZg0kID 25PqiTloizppeN4FNAgMJW70NUNLir+AvCkqcHG2BRyp5PKAcvkPsqqOt7gNIpYy0M +gjgOImCkq1Fo7BClFVSU/wb+HRPJjfc9Ls/+gJJuI8doVmXvFtPtKLwElNWTUoAPp m2LaBz6KTqfYg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-K0kdrlY7wUTtQSQn9jfZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op di 04-01-2022 om 23:22 [+0100]: > 2) =E2=80=99auto=E2=80=99 is confusing=E2=80=A6 >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (select? (negate vcs-fi= le?))) > > +=C2=A0 "Compute the hash of FILE with ALGORITHM.=C2=A0 If RECURSIVE? i= s #true or 'auto', > > +recurse into subdirectories of FILE, computing the combined hash (nar = hash) of >=20 > =E2=80=A6here I understand that =E2=80=99auto=E2=80=99 means #true=E2=80= =A6 Precisely, in the sense 'auto' means #true in that 'auto' recurses. But sometimes #true / auto compute a different hash ... > > +Keep in mind that the hash of a regular file depends on RECURSIVE?: > > +if the recursive hash is desired, it must be set to #true.=C2=A0 Other= wise, it must > > +be set to #false or 'auto'. In most situations, the non-recursive hash= is desired > > +for regular files." >=20 > =E2=80=A6but there it is the contrary. :-) No, when #:recursive? is 'auto' and the file is a directory, it recurses. When it is 'auto' and the file is a regular file, then it also recurses, albeit in a trivial way (because regular files don't contain other files). This comment explains that the 'recursive hash' (nar hash) and 'regular hash' of a regular file are different, that usually you want the regular hash for regular files, and implies that '#:recursive? auto' usually does the right thing. But if you really want the recursive hash for regular files, then you can still compute that by setting #:recursive? #true. > =C2=A0 To me, #true/#false or #t/#f are > meaningful, especially when=E2=80=A6 >=20 > > +=C2=A0 (if (or (eq? recursive? #true) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (eq? recur= sive? 'auto) >=20 > =E2=80=A6the symbol =E2=80=99auto=E2=80=99 is only used here.=C2=A0 IIRC = all the series. :-) In =E2=80=98[PATCH v4 3/4] refresh: Support non-tarball sources.=E2=80=99, = there's > + (let ((hash (file-hash* output))) There, #:recursive? is 'auto'. Greetings, Maxime --=-K0kdrlY7wUTtQSQn9jfZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdVtyhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vd0AQC28roqlHxi5wsBXMukpA1Xlmp+ j8YOaunayI8shlCfbwEA2LdofI6Mqy06DFcjCFRONrh8BDgdD5wQ4yFSoU6qgg0= =sKUQ -----END PGP SIGNATURE----- --=-K0kdrlY7wUTtQSQn9jfZ-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164137736617433 (code B ref 50072); Wed, 05 Jan 2022 10:10:02 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 10:09:26 +0000 Received: from localhost ([127.0.0.1]:39621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n53ET-0004X7-SC for submit@debbugs.gnu.org; Wed, 05 Jan 2022 05:09:26 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:60572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n53ES-0004Wz-AA for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 05:09:24 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id ey9N2600Y4UW6Th01y9Nox; Wed, 05 Jan 2022 11:09:23 +0100 Message-ID: <919c1eeba549b11de04d30629b2deaef3bac048e.camel@telenet.be> From: Maxime Devos Date: Wed, 05 Jan 2022 11:09:22 +0100 In-Reply-To: <867dbfcf9n.fsf_-_@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-BnVNWIvfuBQ+1ngsRfti" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641377363; bh=neJwRnF79Vhs/aAq333497EIQqTsqTJJSj0GniitDjk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YQa0dvkZTU7Ur6ONoHZFj+jgJfxTfB67cvmfIpPRQ2MOJHOKYtS0iyZDa5tXZV76y PYqq1mkKqWKn/lvyZVeV8OLBAjpLSSOr2l7Glgrp44gHCvikFbH1pNWmnw2AYjPsbp bssYNSNtPIzefepmP/40/jh0VlCF+P78zEFBQqA9XkOx4HMWwKlYLcA/Pzla3mBvYV S7wGh98ru4dMTNbbB6L8ELufS/Gn8KDJ3DiBYiQvCi6zUv+kQFflm6S3fOORtCWIFC Kd3eyihRnqoIWuZWxs9XTgkWo2UGmY2LrL8BOPFK+LExWVKqcaCLfzQW1iRvMaNWvC QunIzOINM7Lkg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-BnVNWIvfuBQ+1ngsRfti Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op di 04-01-2022 om 23:22 [+0100]: > > +(define (vcs-file? file stat) > > +=C2=A0 "Returns true if FILE is a version control system file." > > +=C2=A0 (case (stat:type stat) > > +=C2=A0=C2=A0=C2=A0 ((directory) > > +=C2=A0=C2=A0=C2=A0=C2=A0 (member (basename file) '(".bzr" ".git" ".hg"= ".svn" "CVS"))) > > +=C2=A0=C2=A0=C2=A0 ((regular) > > +=C2=A0=C2=A0=C2=A0=C2=A0 ;; Git sub-modules have a '.git' file that is= a regular text > > file. > > +=C2=A0=C2=A0=C2=A0=C2=A0 (string=3D? (basename file) ".git")) > > +=C2=A0=C2=A0=C2=A0 (else > > +=C2=A0=C2=A0=C2=A0=C2=A0 #f))) >=20 > 1) Why =E2=80=99vcs-file?=E2=80=99 requires to be exported?=C2=A0 Is it u= sed elsewhere? It is used in (guix scripts hash): (select? (if (assq-ref opts 'exclude-vcs?) (negate vcs-file?) (const #t))) Greetings, Maxime. --=-BnVNWIvfuBQ+1ngsRfti Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdVuUhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lnGAQDcrnBJvZcsGyDFuXW3WEycH4Qc fdcvUNF5O1AZag719wEA4JHIo3ibZ/ZWM9Q6X04c/3mzu1duWKhMK/o4z9/hiAU= =9Wpl -----END PGP SIGNATURE----- --=-BnVNWIvfuBQ+1ngsRfti-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164138379927963 (code B ref 50072); Wed, 05 Jan 2022 11:57:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 11:56:39 +0000 Received: from localhost ([127.0.0.1]:39690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n54uE-0007Gx-UY for submit@debbugs.gnu.org; Wed, 05 Jan 2022 06:56:39 -0500 Received: from mail-wm1-f53.google.com ([209.85.128.53]:42666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n54uC-0007Gh-QC for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 06:56:37 -0500 Received: by mail-wm1-f53.google.com with SMTP id a83-20020a1c9856000000b00344731e044bso3164380wme.1 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 03:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=WyGDE8n7XBRmViwvCaeiAYJxFqVyJpYkjCgm0a9XYX0=; b=VDLaBQTUzPTsb5kCFhFzqLrD3J3lehNJd5o3epp9t6oELmwkslU2qIPXhnSE1j8XKN nAl6agE8rz9N4Ko2Ut9EThjv7gAIumdvah0FpMrv1r/mVYQzaacs1DnJqNXubuCXxnOA 7ukyK/Cgpd5vJM2TH2Ns5ltgdXsnTgyWKRL20oz7tFIF+HU42SBwVsWOsx0l2NF988LZ yrUtLWcgwt/RNVW64VUzH5tUG8Jos9DUbQbw0NfeDe8gPgV6xnR+y96UZsDbBD/s4sg+ 80g6g6L8eo72B5FhURUQL90IRt6MEWTRRXWZUb8IB6OJGNY4F7+fsDHBJ7h29Vkbffnj dOZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=WyGDE8n7XBRmViwvCaeiAYJxFqVyJpYkjCgm0a9XYX0=; b=5Txt0g3kYKz9w8E5lOZQyW4J22u8lMUgT0eIuaF+KqPj/wix8J0aL7zPPswB4S3rFR J7EKrbj26iz0ggK3/vpZp5LlOZ/v7r5xYjViV8ru9ast8uFCc4DiNzbenEKvsPri3FzW ajNJMCm0sSE+XJBidFqFKrtRTWqZPsB450fg+/4n4gjlXFgUyIGI8nKmBajNQztDUYle 953qF3QhMRZI49Twm/fIMnUDSnQcjhdV5WM/caCU+S1MJV3UCzY9Ai1cJWzdwgaJpDaP Jzt/VvuIH3oGqIIJYu5sV9rW9O5KwbY19O23z8uiYq2iTPxFIhbbXKrfjvp4dMC3GH6v IyCQ== X-Gm-Message-State: AOAM532bdDFJsMSR4aC2kjGXVd++dpqxlenXjWxLICgYbm/MnFYreI6b FP6fDdEj54qxXq7FNLvcLtA= X-Google-Smtp-Source: ABdhPJxeSgh+f5gk19glN96Ao7iObftAH8qzxXvBcJZGYTM03GBkYs6y+oBUoNg2mdkyNob3kGT0vw== X-Received: by 2002:a05:600c:190b:: with SMTP id j11mr2482413wmq.182.1641383790827; Wed, 05 Jan 2022 03:56:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id t12sm47126932wrs.72.2022.01.05.03.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 03:56:30 -0800 (PST) From: zimoun In-Reply-To: <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> Date: Wed, 05 Jan 2022 12:48:48 +0100 Message-ID: <86y23u768v.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Wed, 05 Jan 2022 at 11:07, Maxime Devos wrote: > Precisely, in the sense 'auto' means #true in that 'auto' recurses. > But sometimes #true / auto compute a different hash ... [...] > No, when #:recursive? is 'auto' and the file is a directory, it > recurses. When it is 'auto' and the file is a regular file, then > it also recurses, albeit in a trivial way (because regular files don't > contain other files). > > This comment explains that the 'recursive hash' (nar hash) and 'regular > hash' of a regular file are different, that usually you want the > regular hash for regular files, and implies that '#:recursive? auto' > usually does the right thing. > > But if you really want the recursive hash for regular files, then you > can still compute that by setting #:recursive? #true. Thanks for explaining. Hm, my confusion is probably the same as #51307 [1]. 1: Well, I think =E2=80=99#:recursive?=E2=80=99 is confusing, and =E2=80=99aut= o=E2=80=99 too because it is not POLA for a plumbing function, IMHO. Anyway. It is v4 and it is ready to merge. :-) I just propose to replace =E2=80=99#:recursive?=E2=80=99 by =E2=80=99#:nar-= serializer?=E2=80=99 and a docstring along these lines, --8<---------------cut here---------------start------------->8--- "Compute the hash of FILE with ALGORITHM. If NAR-SERIALIZER? is #true, compute the combined hash (NAR hash) of FILE for which (SELECT? FILE STAT) returns true. If NAR-SERIALIZER? is #false, compute the regular hash using the default serializer. It is meant to be used for a regular file. If NAR-SERIALIZER? is 'auto', when FILE is a directory, compute the combined hash (NAR hash). When FILE is a regular file, compute the regular hash using the default serializer. The option =E2=80=99auto=E2= =80=99 is meant to apply by default the expected hash computation. Symbolic links are not dereferenced unless NAR-SERIALIZER? is false. This procedure must only be used under controlled circumstances; the detection of symbolic links in FILE is racy. --8<---------------cut here---------------end--------------->8--- WDYT? >> > +=C2=A0 (if (or (eq? recursive? #true) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (eq? recu= rsive? 'auto) >>=20 >> =E2=80=A6the symbol =E2=80=99auto=E2=80=99 is only used here.=C2=A0 IIRC= all the series. :-) > > In =E2=80=98[PATCH v4 3/4] refresh: Support non-tarball sources.=E2=80=99= , there's > >> + (let ((hash (file-hash* output))) > > There, #:recursive? is 'auto'. Naive questions: Is it mandatory? Or can be explicitly set? (I have nothing against, just to me =E2=80=99auto=E2=80=99 is somehow ambig= uous and =C2=ABIn the face of ambiguity, refuse the temptation to guess=C2=BB as =E2=80=99pyh= on3 -c 'import this'=E2=80=99 says ;-)) Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 12:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164138461029423 (code B ref 50072); Wed, 05 Jan 2022 12:11:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 12:10:10 +0000 Received: from localhost ([127.0.0.1]:39699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n557K-0007eU-8C for submit@debbugs.gnu.org; Wed, 05 Jan 2022 07:10:10 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:36922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n557H-0007eJ-VQ for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 07:10:09 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id f0A6260024UW6Th010A6vR; Wed, 05 Jan 2022 13:10:06 +0100 Message-ID: From: Maxime Devos Date: Wed, 05 Jan 2022 12:10:01 +0000 In-Reply-To: <86y23u768v.fsf@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-iBee+YQimxTinYy8Ip8a" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641384606; bh=rbw++mXOoYiI1OcCH5yk1m5mW+nHKqrI+LhcxKEbd4c=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FyWcdyKvTE+LODj8kYLN4CpgeOxcBV3Z/L+IjyeGpL4n+i0MSNL5ivYw1KlT8a3KH MqEbjAeeTuaPZt13CRKR5U6R7f71Kv/gPypFaz83ebRrwEk3PxM6uL4tO5kkaVYZAS QZw943xZwEuyErzDInK84qDBqXLuTwRJWp61dYCuIfVcUnNZYG+0O3Po0ZNHqsQTsw ulYGfUdBVd7RmUgjWwbx8p2dakrsdYDRPZBbAwno16Zz1Lpcbw5SS9GSgvvtrhMZrx i7SNZm2fbVxHJ0CFiqiV53P0iioyaPckj7mpOdjClbqmOLaloSiAClqobg080sfAn0 NSDUHAmHNAz2Q== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-iBee+YQimxTinYy8Ip8a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op wo 05-01-2022 om 12:48 [+0100]: > > > > +=C2=A0 (if (or (eq? recursive? #true) > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (eq? r= ecursive? 'auto) > > >=20 > > > =E2=80=A6the symbol =E2=80=99auto=E2=80=99 is only used here.=C2=A0 I= IRC all the series. :-) > >=20 > > In =E2=80=98[PATCH v4 3/4] refresh: Support non-tarball sources.=E2=80= =99, there's > >=20 > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (let ((hash (file-hash* output))) > >=20 > > There, #:recursive? is 'auto'. >=20 > Naive questions: Is it mandatory?=C2=A0 Or can be explicitly set? >=20 > (I have nothing against, just to me =E2=80=99auto=E2=80=99 is somehow amb= iguous and > =C2=ABIn > the face of ambiguity, refuse the temptation to guess=C2=BB as =E2=80=99p= yhon3 -c > 'import this'=E2=80=99 says ;-)) 'auto' is indeed a little ambigious, so I adjusted most calls to file-hash* to set #:recursive? #true/#false appropriately in=C2=A0v3. But in this particular case (guix/scripts/refresh.scm), it not known in advance, so some guesswork is necessary. Anyway, these calls to file-hash* are bothering me a little: can't we just record the hash in the 'upstream-source' record or ask the daemon for the hash of a store item (*) or something? (*) Maybe query-path-hash works or maybe there are problems. Also, would be nice if there was a variant of query-path-hash that works on non-sha256 (in principle guix supports other hashes, though currently they are unused). Or maybe query-path-hash is works differently. That would complicate this patch series more, so I'd prefer to delay that for a future patch series. Greetings, Maxime. --=-iBee+YQimxTinYy8Ip8a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdWKmRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mAvAPoDCzK6yPbZ1D2qdvfMDzNbDQzJ jFXBd3z2jNS8cWaH1AEA7We4WsrSQdz1EFwe9VyERTX7yazUrIkAvrZdOxxjbQg= =u1xx -----END PGP SIGNATURE----- --=-iBee+YQimxTinYy8Ip8a-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164138565531069 (code B ref 50072); Wed, 05 Jan 2022 12:28:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 12:27:35 +0000 Received: from localhost ([127.0.0.1]:39714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55OB-000853-AR for submit@debbugs.gnu.org; Wed, 05 Jan 2022 07:27:35 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:34470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55O8-00084r-Jr for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 07:27:33 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id f0TW2600M4UW6Th010TXNM; Wed, 05 Jan 2022 13:27:31 +0100 Message-ID: From: Maxime Devos Date: Wed, 05 Jan 2022 12:27:25 +0000 In-Reply-To: <86y23u768v.fsf@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-K30N4pq8YNi45YTOrLiR" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641385651; bh=IL+dV7fTBJSo9SVSHpED/ofTYGbkWBSjvziFwDZCZ4I=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Wc7RP2qEFY5PxDCrveNLPiyuZQ+PCIsSSf9uIJvRmSgbrT1uAwY/ObPSBOQxIIpzC P3vHDo8AdctQOFsVCAGBNGHtuHWxOa6aYED7S3co/JdMZdLR7Avm0+9ZAajC/l8zKJ a2hXmoMqmAviuXfLg74sOlJOyhTA7ik0q79lWllE/YknwS002ApslgZhsd76nmpdBf UyTIVqt7bRbjSo80Me39wmQT1p5PF7LHV7k5gyCMRNNkRGfi/411nKzYE2z4ERDv9M jhftyuDNUyNM11WD/7H7nwwFm8bZyBx+QqRM9OKKR/Ix0QODWf0woC62OH2+DbHRZE oD4oMP3Hi1Pyw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-K30N4pq8YNi45YTOrLiR Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op wo 05-01-2022 om 12:48 [+0100]: > Well, I think =E2=80=99#:recursive?=E2=80=99 is confusing, and =E2=80=99a= uto=E2=80=99 too because it is > not POLA for a plumbing function, IMHO.=C2=A0 [...] Principle of least authority, or principle of least astonishment? I presume the latter. > Anyway. It is v4 and it is ready to merge. :-) I vote for a purple bikeshed! But your orange bikeshed would also keep the bikes out of the rain. > I just propose to replace =E2=80=99#:recursive?=E2=80=99 by =E2=80=99#:na= r-serializer?=E2=80=99 and a > docstring along these lines, >=20 > --8<---------------cut here---------------start------------->8--- > =C2=A0 "Compute the hash of FILE with ALGORITHM.=C2=A0 If NAR-SERIALIZER?= is > =C2=A0 #true, compute the combined hash (NAR hash) of FILE for which (SEL= ECT? > =C2=A0 FILE STAT) returns true. >=20 > =C2=A0 If NAR-SERIALIZER? is #false, compute the regular hash using the > =C2=A0 default serializer.=C2=A0 It is meant to be used for a regular fil= e. >=20 > =C2=A0 If NAR-SERIALIZER? is 'auto', when FILE is a directory, compute th= e > =C2=A0 combined hash (NAR hash).=C2=A0 When FILE is a regular file, compu= te the > =C2=A0 regular hash using the default serializer.=C2=A0 The option =E2=80= =99auto=E2=80=99 is meant > =C2=A0 to apply by default the expected hash computation. >=20 > =C2=A0 Symbolic links are not dereferenced unless NAR-SERIALIZER? is fals= e. >=20 > =C2=A0 This procedure must only be used under controlled circumstances; t= he > =C2=A0 detection of symbolic links in FILE is racy. > --8<---------------cut here---------------end--------------->8--- >=20 > WDYT? The nar hash / regular hash difference seems a very low-level detail to me, that most (all?) users don't need to be bothered about. Except maybe if FILE denotes an executable regular file, but file-hash* is currently only used on tarballs/zip files/git checkouts, which aren't executable files unless weirdness or some kind of attack is happening. I think that, the =E2=80=98least astonishing=E2=80=99 thing to do here, is = computing the hash that would go into the 'hash' / 'sha256' field of 'origin' objects by default, and not the nar hash for regular files that's almost never used. Greetings, Maxime. --=-K30N4pq8YNi45YTOrLiR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdWOrRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jgpAP9+O6ncyElAGv5aH/Ms7kJaCrgJ hliVO7GJcnNP6aHGWwD+LmM5YbS1h9BcGt6hCRB5MNTZnJH6pa7Fitz6pzZuYwY= =PyXl -----END PGP SIGNATURE----- --=-K30N4pq8YNi45YTOrLiR-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164138775910754 (code B ref 50072); Wed, 05 Jan 2022 13:03:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 13:02:39 +0000 Received: from localhost ([127.0.0.1]:39728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55w7-0002nN-5g for submit@debbugs.gnu.org; Wed, 05 Jan 2022 08:02:39 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:41603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55w5-0002nA-8X for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 08:02:37 -0500 Received: by mail-wr1-f50.google.com with SMTP id v6so21162799wra.8 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 05:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=aYLxx4bqQ98yW2V1aVq9857H9Wpcl9Kcoo29FHfDkFc=; b=GiD9XRBO1EqBOcFYa9jHADeJMn9nm41l1IndOYkOJsFMzYK7l/AHOOAGCeAePgvlpr oaA04TLfIhIn+pT4gP7vdE0ENDqcRVVuvwdPCtQkWoZgWWu1sFg9sOk+w2Wd2Dnv/rPs RZgXlSFFYvEv9XTJqOox2UeyoQSMWXSknZIY295gT79Bqx+fQV3Vdu/PlfM1xr3slS3Z Cvd02/X1+M34r/gx4JLAwXDd63O4s8xwsPmX24WPF2JJ0b1SvyftCQlBlO7AkpBz4c3f 3OwWJMbLBld0mgMyJIjhhkRWanhGxSDMwhmCF2LFtaVlbTpYIwD4m/stFqpXAx/FQfDT gXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=aYLxx4bqQ98yW2V1aVq9857H9Wpcl9Kcoo29FHfDkFc=; b=7Pdt6x29Oy/0ytSPPuCJOeKJwggeGWmjlMBCFh3LoCmGf3HFitqihOdA9YsOtuRa6i Ry3mP4HQFKWI7orTExQrlOQQzFFM8l6hi58CtCFcHvLV1Xu8MjsYG0pploduX4Y71pLJ pCiBoKWbW6XFpf6CbUce7c4kPVcOVfkDAyBL77JgubO3QdeTGlmMUfhNY2A4Rvor4PMy rLMFHD4zAJOc+6Vfpj435ponh6qAmVKVGuCjvTCg9eoeAz94wWxU0HDp9bdTNlYrgbfo 0yIyAaWbnZ9w8h2dVBOYHdmv7f3E2rE7IjOxGighjU1vYPO6UwkHf3TvrO1wN7IYDcsc MiiQ== X-Gm-Message-State: AOAM5306AgIRhQxEub9Z6itZtUux0qLpaaXbnEZmoq9d5wZ6kSphsvZ6 LR09FdWKwhwJEX5gSbhVGuY= X-Google-Smtp-Source: ABdhPJyYVhLI5db5Ga+wf45cceBIilVjzoG6IisMR5a7xirbZcEKN9uWdMSLMU+eJqehgRUWvNeeGg== X-Received: by 2002:a5d:6108:: with SMTP id v8mr45679502wrt.661.1641387751236; Wed, 05 Jan 2022 05:02:31 -0800 (PST) Received: from lili ([88.126.110.68]) by smtp.gmail.com with ESMTPSA id z6sm3454996wmp.9.2022.01.05.05.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 05:02:30 -0800 (PST) From: zimoun In-Reply-To: References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> Date: Wed, 05 Jan 2022 13:58:38 +0100 Message-ID: <86pmp6730h.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Wed, 05 Jan 2022 at 12:27, Maxime Devos wrote: > zimoun schreef op wo 05-01-2022 om 12:48 [+0100]: >> Well, I think =E2=80=99#:recursive?=E2=80=99 is confusing, and =E2=80=99= auto=E2=80=99 too because it is >> not POLA for a plumbing function, IMHO.=C2=A0 [...] > > Principle of least authority, or principle of least astonishment? > I presume the latter. Latter. :-) >> Anyway. It is v4 and it is ready to merge. :-) > > I vote for a purple bikeshed! But your orange bikeshed would also keep > the bikes out of the rain. :-) >> --8<---------------cut here---------------start------------->8--- >> =C2=A0 "Compute the hash of FILE with ALGORITHM.=C2=A0 If NAR-SERIALIZER= ? is >> =C2=A0 #true, compute the combined hash (NAR hash) of FILE for which (SE= LECT? >> =C2=A0 FILE STAT) returns true. >>=20 >> =C2=A0 If NAR-SERIALIZER? is #false, compute the regular hash using the >> =C2=A0 default serializer.=C2=A0 It is meant to be used for a regular fi= le. >>=20 >> =C2=A0 If NAR-SERIALIZER? is 'auto', when FILE is a directory, compute t= he >> =C2=A0 combined hash (NAR hash).=C2=A0 When FILE is a regular file, comp= ute the >> =C2=A0 regular hash using the default serializer.=C2=A0 The option =E2= =80=99auto=E2=80=99 is meant >> =C2=A0 to apply by default the expected hash computation. >>=20 >> =C2=A0 Symbolic links are not dereferenced unless NAR-SERIALIZER? is fal= se. >>=20 >> =C2=A0 This procedure must only be used under controlled circumstances; = the >> =C2=A0 detection of symbolic links in FILE is racy. >> --8<---------------cut here---------------end--------------->8--- > The nar hash / regular hash difference seems a very low-level detail to > me, that most (all?) users don't need to be bothered about. Except > maybe if FILE denotes an executable regular file, but file-hash* is > currently only used on tarballs/zip files/git checkouts, which aren't > executable files unless weirdness or some kind of attack is happening. > > I think that, the =E2=80=98least astonishing=E2=80=99 thing to do here, i= s computing > the hash that would go into the 'hash' / 'sha256' field of 'origin' > objects by default, and not the nar hash for regular files that's > almost never used. I do not understand what you mean here. =E2=80=99file-hash*=E2=80=99 is a = low-level detail, no? Whatever. :-) Well, I am sorry if my 3 naive comments are not convenient. Just, to be sure, I am proposing: 1) It is v4 and ready, I guess. About =E2=80=99auto=E2=80=99, I could hav= e waken up earlier. :-) And it can be still improved later as you are saying in the other answer. So, we are done, right? 2) From my point of view, =E2=80=99#:recursive?=E2=80=99 needs to be adapt= ed in agreement with the discussion [1], quoting Ludo: Thinking more about it, I think confusion stems from the term =E2=80=9Crecursive=E2=80=9D (inherited from Nix) because, as you wr= ite, it doesn=E2=80=99t necessarily have to do with recursion and directory traversal. Instead, it has to do with the serialization method. 1: And I do not have a strong opinion. Just a naive remark. 3) Whatever the keyword for the current v4 =E2=80=99#:recursive?=E2=80=99 = is picked, I still find the current docstring wording unclear. In fact, reading the code is more helpful. :-) I am just proposing a reword which appears to me clearer than the current v4 one. Maybe, I am missing the obvious. Or maybe this proposed rewording is not clearer. :-) WDYT? Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 14:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139164317285 (code B ref 50072); Wed, 05 Jan 2022 14:08:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 14:07:23 +0000 Received: from localhost ([127.0.0.1]:39767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56wl-0004Uj-1T for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:23 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:58248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56wh-0004UX-T9 for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:21 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id f27H2600W4UW6Th0627JEg; Wed, 05 Jan 2022 15:07:18 +0100 Message-ID: <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> From: Maxime Devos Date: Wed, 05 Jan 2022 14:06:55 +0000 In-Reply-To: <86pmp6730h.fsf@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-RpYAu8/sIr7JlwsA4/89" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641391638; bh=sv6wMGEusyWqG53WSwa/DHIo9A3MASNPpl4bVkKgsgY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GpiNml6A9ptSR6dsvOnnarPBuqdW10GSK+LrBU0R9gZQJWms2d6p+bz0WaYVIVNUe FMX5XQJJuh1XesScXo0PZ7mZIzkbX+6O/11XbueRFoL9GyRLSrTYDoixQmDzBkNdeS OPLnIUlWBaFMvklyZU3fXIzfRGPIypbpSeaVnAfP4hs12ykhbddHVYOUZ5yIp5U4eo XYeev8EH+dBiioBStpitA+BXHgQ1ZrQrme/3cGtibO6DppQGFcbkStEb2ze89maLOq m42nLl4/csCmCGq+6LWfoIBOzk+Z2jHpakYF4oYQQdGLfhFjEzCROsDc1oc1NMxS6+ +xp+2QoRbg0OQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-RpYAu8/sIr7JlwsA4/89 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op wo 05-01-2022 om 13:58 [+0100]: > [...] > > > --8<---------------cut here---------------start------------->8--- > > > =C2=A0 "Compute the hash of FILE with ALGORITHM.=C2=A0 If NAR-SERIALI= ZER? is > > > =C2=A0 #true, compute the combined hash (NAR hash) of FILE for which = (SELECT? > > > =C2=A0 FILE STAT) returns true. > > >=20 > > > =C2=A0 If NAR-SERIALIZER? is #false, compute the regular hash using t= he > > > =C2=A0 default serializer.=C2=A0 It is meant to be used for a regular= file. > > >=20 > > > =C2=A0 If NAR-SERIALIZER? is 'auto', when FILE is a directory, comput= e the > > > =C2=A0 combined hash (NAR hash).=C2=A0 When FILE is a regular file, c= ompute the > > > =C2=A0 regular hash using the default serializer.=C2=A0 The option = =E2=80=99auto=E2=80=99 is meant > > > =C2=A0 to apply by default the expected hash computation. > > >=20 > > > =C2=A0 Symbolic links are not dereferenced unless NAR-SERIALIZER? is = false. > > >=20 > > > =C2=A0 This procedure must only be used under controlled circumstance= s; the > > > =C2=A0 detection of symbolic links in FILE is racy. > > > --8<---------------cut here---------------end--------------->8--- >=20 > > The nar hash / regular hash difference seems a very low-level detail to > > me, that most (all?) users don't need to be bothered about. Except > > maybe if FILE denotes an executable regular file, but file-hash* is > > currently only used on tarballs/zip files/git checkouts, which aren't > > executable files unless weirdness or some kind of attack is happening. > >=20 > > I think that, the =E2=80=98least astonishing=E2=80=99 thing to do here,= is computing > > the hash that would go into the 'hash' / 'sha256' field of 'origin' > > objects by default, and not the nar hash for regular files that's > > almost never used. >=20 > I do not understand what you mean here. =E2=80=99file-hash*=E2=80=99 is = a low-level > detail, no? Whatever. :-) I don't see what it matters if 'file-hash*' is classified as low-level or high-level. =C2=A0But what I do care about, is how easy to use file-hash= * is. A low-level argument like #:nar-hash? #true/#false would make file- hash* much more complicated: this patch series uses file-hash* to compute the hash for 'origin' records, and the documentation of 'origin' doesn't mention 'nar' anywhere and if I search for 'nar hash' in the manual, I find zero results. Instead, file-hash* talks about directories, regular files, recursion and claims that the default value of #:recursive? usually does the right thing, so I don't have to look up any complicated terminology to figure out how to use file-hash* to compute hashes for 'origin' records. And in the rare situation where file-hash* doesn't do the right thing, the documentation tells me I can set #:recursive? #true/#false. =20 > Just, to be sure, I am proposing: >=20 > =C2=A01) It is v4 and ready, I guess. About =E2=80=99auto=E2=80=99, I co= uld have waken up > =C2=A0earlier. :-) And it can be still improved later as you are saying i= n > =C2=A0the other answer. So, we are done, right? I think so, yes, except for a docstring change I'll send as a v5. I'm also out of bikeshed paint. Anway, keep in mind that I'm not a committer. > =C2=A02) From my point of view, =E2=80=99#:recursive?=E2=80=99 needs to b= e adapted in > =C2=A0agreement with the discussion [1], quoting Ludo: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Thinking more about it, I= think confusion stems from the term > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Crecursive=E2=80= =9D (inherited from Nix) because, as you write, it > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0doesn=E2=80=99t necessari= ly have to do with recursion and directory > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0traversal. >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Instead, it has to do wit= h the serialization method. >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A01: >=20 > =C2=A0=C2=A0=C2=A0And I do not have a strong opinion. Just a naive remar= k. I don't think the arguments for (guix scripts hash) apply directly to (guix hash) -- (guix scripts hash) supports multiple serialisers: * none (regular in (guix hash) terminology) * git * nar * swh so something like -S nar makes a lot of sense there. But (guix hash) is only for computing the hash of something that would become a store item after interning, more specifically is is currently only used for computing the hash that would go into an (origin ...) object (though I suppose it could be extended to support git/swh/... if someone wants do that). Possibly some name like #:treat-it-as-a-directory-or-an-executable-file-or-a-symlink-and- compute-the-alternative-hash-even-if-it-is-regular? would be clearer and technically more accurate than #:recursive?, but that's a bit of a mouthful. > =C2=A03) Whatever the keyword for the current v4 =E2=80=99#:recursive?=E2= =80=99 is picked, I > =C2=A0=C2=A0still find the current docstring wording unclear. In fact, r= eading > =C2=A0=C2=A0the code is more helpful. :-) I am just proposing a reword wh= ich > =C2=A0=C2=A0appears to me clearer than the current v4 one. Maybe, I am m= issing > =C2=A0=C2=A0the obvious. Or maybe this proposed rewording is not clearer= . :-) I've reworded it a bit; it falsely claimed that the nar hash was always computed when recursive? is 'auto' (even if FILE is a regular file). It also mentions executable files and SELECT? now. Greetings, Maxime. --=-RpYAu8/sIr7JlwsA4/89 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdWl/xccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kV8AP4wlEra0f9+TjAh5gilOW0+dpCi A7JDyk0HGyq5KBHYqQD/YnmNTRMHePpYKxXaIUV/Z9WFmVuSkLO1RbgnAl7fcQk= =JDQE -----END PGP SIGNATURE----- --=-RpYAu8/sIr7JlwsA4/89-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 1/4] guix hash: Extract file hashing procedures. References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139167917356 (code B ref 50072); Wed, 05 Jan 2022 14:08:02 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 14:07:59 +0000 Received: from localhost ([127.0.0.1]:39777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xH-0004Vj-Hy for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:59 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:58248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xE-0004UX-Vt for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:54 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id f27s2600F4UW6Th0627sN9; Wed, 05 Jan 2022 15:07:52 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 14:07:47 +0000 Message-Id: <20220105140750.18214-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641391672; bh=NbrokZoVPvuKyRtEizbkjq1LE4lpGqaE5iJPt+N60jY=; h=From:To:Cc:Subject:Date; b=I8uIGPGF8KvuthIZQpGDtlV3tveyZEoPVpVo7uEAP8BFk1/GyvyNc7aRbMsMn+vLK Pt2iI/fET/TEq5IVbRRxMWogSaniKqeJO6D1tBVbmQXHmcBP0HlBrRLp6/Quua9sr4 sXhe1Bvu0kUFsvHZFIoqySZEFFaBqXd4gF2g+Vg3CcJoJ1SO7spyG6y+i/oE4vJh1R s4GDq2viNx3886+hp+PFv0tqC6PnR37nNLtpPrsRAULt8OILIC6l9DufLjFJe9bM5L YSoz6tcNqlL3y3keMOJByQv1k3CYqCiP3XDDGk9F87a1bP7rJDQJ1tDHhocckqokNk f7RfdXdwkveNw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/hash.scm (guix-hash)[vcs-file?] (nar-hash, default-hash): Extract hashing logic to... * guix/hash.scm (vcs-file?, file-hash*): ... these new procedures in this new file. Modified-by: Maxime Devos --- Makefile.am | 1 + guix/hash.scm | 73 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 22 +++---------- 3 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 guix/hash.scm diff --git a/Makefile.am b/Makefile.am index 8c5682a1c6..bc3d0087d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,6 +99,7 @@ MODULES = \ guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..3cb68e5c44 --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,73 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? 'auto) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. + +Symbolic links are only dereferenced if RECURSIVE? is false. +Directories are only supported if RECURSIVE? is #true or 'auto'. +The executable bit is only recorded if RECURSIVE? is #true. +If FILE is a symbolic link, it is only followed if RECURSIVE? is false. + +For regular files, there are two different hashes when the executable +hash isn't recorded: the regular hash and the nar hash. In most situations, +the regular hash is desired and setting RECURSIVE? to 'auto' does the right +thing for both regular files and directories. + +This procedure must only be used under controlled circumstances; +the detection of symbolic links in FILE is racy. + +When FILE is a directory, the procedure SELECT? called as (SELECT? FILE STAT) +decides which files to include. By default, version control files are +excluded. To include everything, SELECT? can be set to (const #true)." + (if (or (eq? recursive? #true) + (and (eq? recursive? 'auto) + ;; Don't change this to (eq? 'directory ...), because otherwise + ;; if 'file' denotes a symbolic link, the 'file-hash' below + ;; would dereference it -- dereferencing symbolic links would + ;; open an avoidable can of potential worms. + (not (eq? 'regular (stat:type (lstat file)))))) + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..28d587b944 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -46,20 +48,14 @@ (define* (nar-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) - (let-values (((port get-hash) - (open-hash-port algorithm))) - (write-file file port #:select? select?) - (force-output port) - (get-hash))) + (file-hash* file #:algorithm algorithm #:select? select? #:recursive? #true)) (define* (default-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) (match file ("-" (port-hash algorithm (current-input-port))) - (_ - (call-with-input-file file - (cute port-hash algorithm <>))))) + (_ (file-hash* file #:algorithm algorithm #:recursive? #false)))) (define* (git-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) @@ -181,16 +177,6 @@ use '--serializer' instead~%")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 3/4] refresh: Support non-tarball sources. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139167917364 (code B ref 50072); Wed, 05 Jan 2022 14:08:02 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 14:07:59 +0000 Received: from localhost ([127.0.0.1]:39779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xL-0004Vt-GA for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:59 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:59590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xF-0004VS-JH for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:54 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id f27s2600F4UW6Th0627sNF; Wed, 05 Jan 2022 15:07:53 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 14:07:49 +0000 Message-Id: <20220105140750.18214-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105140750.18214-1-maximedevos@telenet.be> References: <20220105140750.18214-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641391673; bh=1C9ahprOwcy10Tnk5guGYz+QxZ/hL2vALCXNKEI79wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mrNU9OuZ6bLKjlioVstON2ONFyvngww/oILFAg9qjXdqMpcgq6NseQ0QToYaV/uKj bcAuVl0RtC279jvU/+8aHKWObepkx1hm4r6BN5gKCtDna8SVeixIfeaMk0TMd1tXHf 5ba7ISKRdityFjNsRzT4rKVOCCAPOaq6kRM96CXJ5P/L4yWbsCfirxeer2HPlUMkXR J/et30vHGZJVkdylY1wvxAP1v8B7kMgoVypad69TpwpRNZ31S4nKBuKoDUzG6cR+ci h4a/wFqjKHNKthQNGQy/FQ4OFpj7gJY9hc69FhtlwGzk4CoD0b6VnNflljhLxXQ2Uf 0DN55QE0SI/Bg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 8806f0f740..68bb9040d8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -363,8 +364,7 @@ warn about packages that have no matching updater." (info loc (G_ "~a: consider removing this propagated input: ~a~%") name change-name)))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 4/4] upstream: Support updating and fetching 'git-fetch' origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 14:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139168417426 (code B ref 50072); Wed, 05 Jan 2022 14:09:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 14:08:04 +0000 Received: from localhost ([127.0.0.1]:39781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xL-0004W1-Ro for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:08:04 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:59606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xF-0004VT-OP for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 09:07:59 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id f27s2600F4UW6Th0627tNK; Wed, 05 Jan 2022 15:07:53 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 14:07:50 +0000 Message-Id: <20220105140750.18214-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105140750.18214-1-maximedevos@telenet.be> References: <20220105140750.18214-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641391673; bh=OcXbP9H75mnRWI/rumIqeKoSasXir76HNnl6Eq+S86Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S6BqnNYB7/40K5ktPL/ePIhMeXkNrDQz+7fVQ9OMch5SRyiD+Clb3z1XQuAqv0Mcj U4Zv7JL64hOzebW4sxHDMyf9y7hiH6SPkBFRoBIgVnACWPn0cg6RscFGxJsml5WXke 185+OutBmcCDjmA4lH97S88LCIrVBEE9VUlcd8zd5RFVAMo2EYd/041AewjZ9wGwJc vvse2C9qbgQH3+1OigFDSwT6GHl4qxcDNPkj1f4NiCIfMB8iWWpITBoNUtZjIVttyQ vsdWXf/1psUjv6k/7VMG8POi1rWpbMrC+iXeaTUuBFGN0sejZnbfTmpkSquVF39AWM oFTtPX47S4I1w== X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/git.scm (git-reference->git-checkout): New procedure. * guix/upstream.scm (package-update/git-fetch): New procedure. ()[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler/url-fetch): Split off from ... (upstream-source-compiler): ... this, and call ... (upstream-source-compiler/git-fetch): ... this new procedure if the URL field contains a 'git-reference'. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos --- guix/git.scm | 14 +++++++- guix/import/git.scm | 22 +++++++----- guix/import/minetest.scm | 6 ++-- guix/upstream.scm | 73 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++-- 5 files changed, 98 insertions(+), 24 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dc2ca1be84..43e85a5026 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2021 Kyle Meyer ;;; Copyright © 2021 Marius Bakke +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,8 @@ #:use-module (guix utils) #:use-module (guix records) #:use-module (guix gexp) + #:autoload (guix git-download) + (git-reference-url git-reference-commit git-reference-recursive?) #:use-module (guix sets) #:use-module ((guix diagnostics) #:select (leave warning)) #:use-module (guix progress) @@ -65,7 +68,9 @@ git-checkout-url git-checkout-branch git-checkout-commit - git-checkout-recursive?)) + git-checkout-recursive? + + git-reference->git-checkout)) (define %repository-cache-directory (make-parameter (string-append (cache-directory #:ensure? #f) @@ -672,6 +677,13 @@ is true, limit to only refs/tags." (commit git-checkout-commit (default #f)) ;#f | tag | commit (recursive? git-checkout-recursive? (default #f))) +(define (git-reference->git-checkout reference) + "Convert the REFERENCE to an equivalent ." + (git-checkout + (url (git-reference-url reference)) + (commit (git-reference-commit reference)) + (recursive? (git-reference-recursive? reference)))) + (define* (latest-repository-commit* url #:key ref recursive? log-port) ;; Monadic variant of 'latest-repository-commit'. (lambda (store) diff --git a/guix/import/git.scm b/guix/import/git.scm index 1eb219f3fe..4cf404677c 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (%generic-git-updater ;; For tests. @@ -172,21 +174,21 @@ repository at URL." (values version tag))))))) (define (latest-git-tag-version package) - "Given a PACKAGE, return the latest version of it, or #f if the latest version -could not be determined." + "Given a PACKAGE, return the latest version of it and the corresponding git +tag, or #false and #false if the latest version could not be determined." (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c)) (warning (or (package-field-location package 'source) (package-location package)) (G_ "~a for ~a~%") (condition-message c) (package-name package)) - #f) + (values #f #f)) ((eq? (exception-kind c) 'git-error) (warning (or (package-field-location package 'source) (package-location package)) (G_ "failed to fetch Git repository for ~a~%") (package-name package)) - #f)) + (values #f #f))) (let* ((source (package-source package)) (url (git-reference-url (origin-uri source))) (property (cute assq-ref (package-properties package) <>))) @@ -208,14 +210,16 @@ could not be determined." "Return an for the latest release of PACKAGE." (let* ((name (package-name package)) (old-version (package-version package)) - (url (git-reference-url (origin-uri (package-source package)))) - (new-version (latest-git-tag-version package))) - - (and new-version + (old-reference (origin-uri (package-source package))) + (new-version new-version-tag (latest-git-tag-version package))) + (and new-version new-version-tag (upstream-source (package name) (version new-version) - (urls (list url)))))) + (urls (git-reference + (url (git-reference-url old-reference)) + (commit new-version-tag) + (recursive? (git-reference-recursive? old-reference)))))))) (define %generic-git-updater (upstream-updater diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index a7bdbfebca..3b2cdcdcac 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -504,9 +504,9 @@ or #false if the latest release couldn't be determined." (upstream-source (package (package:package-name pkg)) (version (release-version release)) - (urls (list (download:git-reference - (url (package-repository contentdb-package)) - (commit (release-commit release)))))))) + (urls (download:git-reference + (url (package-repository contentdb-package)) + (commit (release-commit release))))))) (define %minetest-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..1fe996ef3d 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,8 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,12 +26,15 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix base32) #:use-module (guix gexp) + #:autoload (guix git) (latest-repository-commit git-reference->git-checkout) + #:use-module (guix hash) #:use-module (guix store) #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) #:autoload (gcrypt hash) (port-sha256) @@ -93,7 +98,7 @@ upstream-source? (package upstream-source-package) ;string (version upstream-source-version) ;string - (urls upstream-source-urls) ;list of strings + (urls upstream-source-urls) ;list of strings|git-reference (signature-urls upstream-source-signature-urls ;#f | list of strings (default #f)) (input-changes upstream-source-input-changes @@ -357,10 +362,9 @@ values: 'interactive' (default), 'always', and 'never'." data url) #f))))))) -(define-gexp-compiler (upstream-source-compiler (source ) - system target) - "Download SOURCE from its first URL and lower it as a fixed-output -derivation that would fetch it." +(define (upstream-source-compiler/url-fetch source system) + "Lower SOURCE, an pointing to a tarball, as a +fixed-output derivation that would fetch it, and verify its authenticity." (mlet* %store-monad ((url -> (first (upstream-source-urls source))) (signature -> (and=> (upstream-source-signature-urls source) @@ -378,6 +382,30 @@ derivation that would fetch it." (url-fetch url 'sha256 hash (store-path-package-name tarball) #:system system)))) +(define (upstream-source-compiler/git-fetch source system) + "Lower SOURCE, an using git, as a fixed-output +derivation that would fetch it." + (mlet* %store-monad ((reference -> (upstream-source-urls source)) + (checkout + (lower-object + (git-reference->git-checkout reference) + system))) + ;; Like in 'upstream-source-compiler/url-fetch', return a fixed-output + ;; derivation instead of CHECKOUT. + (git-fetch reference 'sha256 + (file-hash* checkout #:recursive? #true #:select? (const #true)) + (git-file-name (upstream-source-package source) + (upstream-source-version source)) + #:system system))) + +(define-gexp-compiler (upstream-source-compiler (source ) + system target) + "Download SOURCE, lower it as a fixed-output derivation that would fetch it, +and verify its authenticity if possible." + (if (git-reference? (upstream-source-urls source)) + (upstream-source-compiler/git-fetch source system) + (upstream-source-compiler/url-fetch source system))) + (define (find2 pred lst1 lst2) "Like 'find', but operate on items from both LST1 and LST2. Return two values: the item from LST1 and the item from LST2 that match PRED." @@ -430,9 +458,24 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define* (package-update/git-fetch store package source #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + ;; TODO: it would be nice to authenticate commits, e.g. with + ;; "guix git authenticate" or a list of permitted signing keys. + (define ref (upstream-source-urls source)) ; a + (values (upstream-source-version source) + (latest-repository-commit + store + (git-reference-url ref) + #:ref `(tag-or-commit . ,(git-reference-commit ref)) + #:recursive? (git-reference-recursive? ref)) + source)) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) @@ -492,9 +535,22 @@ new version string if an update was made, and #f otherwise." (origin-hash (package-source package)))) (old-url (match (origin-uri (package-source package)) ((? string? url) url) + ((? git-reference? ref) + (git-reference-url ref)) (_ #f))) (new-url (match (upstream-source-urls source) - ((first _ ...) first))) + ((first _ ...) first) + ((? git-reference? ref) + (git-reference-url ref)) + (_ #f))) + (old-commit (match (origin-uri (package-source package)) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) + (new-commit (match (upstream-source-urls source) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) (file (and=> (location-file loc) (cut search-path %load-path <>)))) (if file @@ -508,6 +564,9 @@ new version string if an update was made, and #f otherwise." 'filename file)) (replacements `((,old-version . ,version) (,old-hash . ,hash) + ,@(if (and old-commit new-commit) + `((,old-commit . ,new-commit)) + '()) ,@(if (and old-url new-url) `((,(dirname old-url) . ,(dirname new-url))) diff --git a/tests/minetest.scm b/tests/minetest.scm index 77b9aa928f..cbb9e83889 100644 --- a/tests/minetest.scm +++ b/tests/minetest.scm @@ -387,10 +387,9 @@ during a dynamic extent where that package is available on ContentDB." ;; Update detection (define (upstream-source->sexp upstream-source) - (define urls (upstream-source-urls upstream-source)) - (unless (= 1 (length urls)) - (error "only a single URL is expected")) - (define url (first urls)) + (define url (upstream-source-urls upstream-source)) + (unless (git-reference? url) + (error "a is expected")) `(,(upstream-source-package upstream-source) ,(upstream-source-version upstream-source) ,(git-reference-url url) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 2/4] import: Factorize file hashing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 14:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139168817436 (code B ref 50072); Wed, 05 Jan 2022 14:09:02 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 14:08:08 +0000 Received: from localhost ([127.0.0.1]:39788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xQ-0004X1-Eb for submit@debbugs.gnu.org; Wed, 05 Jan 2022 09:08:08 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:59578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n56xF-0004VQ-FM for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 09:08:00 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id f27s2600F4UW6Th0627sND; Wed, 05 Jan 2022 15:07:52 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 14:07:48 +0000 Message-Id: <20220105140750.18214-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105140750.18214-1-maximedevos@telenet.be> References: <20220105140750.18214-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641391672; bh=pToVcY6tyNJdA8to9CMlcbffGWezAHQB9+uOz7gou4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X4cUK+OA6rL9+/XyeJwMgaiTL8CkW4TWCbkR3c4CVt6LBtSoegx7gZBuK/FLnjoPn CzSSnx5wX6NaReSuhjubESFeQWDRLEukwLLoMf12FHgCMOp+esmuU5gXW+MGfZr6pR YavuolMXcAMs/hpA/HZbGdvJsWp15cNMSUIrV9NM00fsn0JzAKJcwioBWxXGy4s/oO nQ/KqFmOtSItOwONraenqYi1Wepfkqh7s2oJ3r5UGM1A5W4ujlWsMWZufqGmMN+/gl hZGbSXszcdVkALk2usYmtt+z80fbirrft9s42wZ/B1YcpiuAnaDr7YJRtI8O2GZrJT XHw0ZEq/3sbMg== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->o [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.137.88 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.137.88 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. * guix/import/minetest.scm (file-hash): Remove procedure. (make-minetest-sexp): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 29 +++++------------------------ guix/import/go.scm | 25 +++---------------------- guix/import/minetest.scm | 19 ++++++++----------- 4 files changed, 19 insertions(+), 86 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 1389576cad..b61402078d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,10 +36,9 @@ #:use-module (guix memoization) #:use-module (guix http-client) #:use-module (guix diagnostics) + #:use-module (guix hash) #:use-module (guix i18n) - #:use-module (gcrypt hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -196,17 +196,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -464,16 +453,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -571,12 +550,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source #:recursive? (or git? hg?))))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..c5167eacb5 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -229,27 +230,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -271,7 +251,7 @@ RECIPE." (sha256 (base32 ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + (file-hash* directory #:recursive? #true))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -380,7 +360,8 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string + (file-hash* tarball #:recursive? #false)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 26dbc34b63..c7673e6a1a 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -26,6 +26,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -36,11 +37,10 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) #:autoload (guix serialization) (write-file) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:use-module (ice-9 match) #:use-module (ice-9 peg) #:use-module (ice-9 rdelim) @@ -499,25 +499,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -536,7 +517,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm #:recursive? #true))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index abddd885ee..a7bdbfebca 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module (guix base32) #:use-module (guix git) #:use-module ((guix git-download) #:prefix download:) + #:use-module (guix hash) #:use-module (guix store) #:export (%default-sort-key %contentdb-api @@ -286,14 +287,6 @@ results. The return value is a list of records." (with-store store (latest-repository-commit store url #:ref ref))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file) - "Compute the hash of FILE." - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port) - (force-output port) - (get-hash))) - (define (make-minetest-sexp author/name version repository commit inputs home-page synopsis description media-license license) @@ -314,9 +307,13 @@ MEDIA-LICENSE and LICENSE." ;; The git commit is not always available. ,(and commit (bytevector->nix-base32-string - (file-hash + (file-hash* (download-git-repository repository - `(commit . ,commit))))))) + `(commit . ,commit)) + ;; 'download-git-repository' already filtered out the '.git' + ;; directory. + #:select? (const #true) + #:recursive? #true))))) (file-name (git-file-name name version)))) (build-system minetest-mod-build-system) ,@(maybe-propagated-inputs (map contentdb->package-name inputs)) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139555825569 (code B ref 50072); Wed, 05 Jan 2022 15:13:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:12:38 +0000 Received: from localhost ([127.0.0.1]:41435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n57xu-0006eK-JI for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:12:38 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:54121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n57xs-0006e5-OM for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:12:37 -0500 Received: by mail-wm1-f51.google.com with SMTP id l4so25722271wmq.3 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 07:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=zvbL2elneLSMM9V7umWDRwsdoO+uopfw4yZr+oLVZ9s=; b=SE5sncoxvLfm/R3WUl3u7UIEPw1o1XdWdEd7V/bbw3t2tmKGq044kcsNx3XnmLxDrZ +NRsn4kCk2BbIXw3ZTXTFRmS5WM2rsDUftzfMgwR54Idjunq7WNmtFrDYVWz3zj6V4oK fJDpEgL23XPCA7MkLc576B4nz8Ck1EVJd921Yl252ushTKMoiKaMv+8lJ8akGyFTl8n1 8agKCpKGlJBvadIp5zVc7ihJrn3PIAi119k4mEtGKdEVSiGFjTtvyLydY9uDJ8qchWM8 PGIUveV9BBXUFqYF2S8Xm+NFa4AEjMnFPsy+LV/E9IYuexy7q/7dwpkR8bDtYQocK1cK pxQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=zvbL2elneLSMM9V7umWDRwsdoO+uopfw4yZr+oLVZ9s=; b=dvpeq0e1T1FQ1EOsDmQyLUgk592wmalaAYjbqE+nK0Tx9yYDbIcfhfB5RMFZh1Ooaa aVKVCiBnryWzMavEX/Qk+xgX/cRx0yD3BVRgasQKGi1I/o5Ybwcn/5IQd/aahlhG++m+ StV7+mm3brUlrTturgVib4A+VGPNXrk5Mo4PU8EFC6SAQ0hj8nqIjTRVrgcu0AEX6Xhw ldCxoY12RH2FJeaelzNWPLTQRsPLq0YH4NkQhlvW+RtPHLDQXjdgjfkg4fw0oPdfNxUf rQrTDmuLAtdQ1osl9Xkzwn++kNXwATss4+UHMyJwNDE9Nv2PMvqtITEUh1M7AsPx8dW1 Yv3Q== X-Gm-Message-State: AOAM5308kuFGMv4VJV3MFrGRYSW5B2v2btjrmvI8Ur95Lk+wRRMEtoOE WwrOoMAMKUJ9OGEnRVNaoxU= X-Google-Smtp-Source: ABdhPJwg/GRWQjAwdfzqYDTkFgoW2qtUOEs8VEK0bpxR6ZLin6yIaTZtS1jp3Ed3liy+p4O0wjOwvQ== X-Received: by 2002:a05:600c:a47:: with SMTP id c7mr3284727wmq.23.1641395550735; Wed, 05 Jan 2022 07:12:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id l16sm46653881wrx.117.2022.01.05.07.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 07:12:30 -0800 (PST) From: zimoun In-Reply-To: <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> Date: Wed, 05 Jan 2022 16:08:54 +0100 Message-ID: <86h7ai6wzd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime, On Wed, 05 Jan 2022 at 14:06, Maxime Devos wrote: > A low-level argument like #:nar-hash? #true/#false would make file- > hash* much more complicated: this patch series uses file-hash* to > compute the hash for 'origin' records, and the documentation of > 'origin' doesn't mention 'nar' anywhere and if I search for 'nar hash' > in the manual, I find zero results. I agree, it was my point #1. :-) > Instead, file-hash* talks about directories, regular files, recursion > and claims that the default value of #:recursive? usually does the > right thing, so I don't have to look up any complicated terminology > to figure out how to use file-hash* to compute hashes for 'origin' > records. I also agree, it was my point #3. :-) > And in the rare situation where file-hash* doesn't do the right thing, > the documentation tells me I can set #:recursive? #true/#false. Yes. >> Just, to be sure, I am proposing: >>=20 >> =C2=A01) It is v4 and ready, I guess. About =E2=80=99auto=E2=80=99, I c= ould have waken up >> =C2=A0earlier. :-) And it can be still improved later as you are saying = in >> =C2=A0the other answer. So, we are done, right? > > I think so, yes, except for a docstring change I'll send as a v5. > I'm also out of bikeshed paint. > Anway, keep in mind that I'm not a committer. I am not either. If I had this power, I would have already pushed your v4 with the docstring reword. :-) >> =C2=A02) From my point of view, =E2=80=99#:recursive?=E2=80=99 needs to = be adapted in >> =C2=A0agreement with the discussion [1], quoting Ludo: [...] >> =C2=A0=C2=A0=C2=A0And I do not have a strong opinion. Just a naive rema= rk. [...] > Possibly some name like > #:treat-it-as-a-directory-or-an-executable-file-or-a-symlink-and- > compute-the-alternative-hash-even-if-it-is-regular? > would be clearer and technically more accurate than #:recursive?, but > that's a bit of a mouthful. I trust you, I do not have a strong opinion. I was just a naive remark. >> =C2=A03) Whatever the keyword for the current v4 =E2=80=99#:recursive?= =E2=80=99 is picked, I >> =C2=A0=C2=A0still find the current docstring wording unclear. In fact, = reading >> =C2=A0=C2=A0the code is more helpful. :-) I am just proposing a reword w= hich >> =C2=A0=C2=A0appears to me clearer than the current v4 one. Maybe, I am = missing >> =C2=A0=C2=A0the obvious. Or maybe this proposed rewording is not cleare= r. :-) > > I've reworded it a bit; it falsely claimed that the nar hash was always > computed when recursive? is 'auto' (even if FILE is a regular file). It > also mentions executable files and SELECT? now. Thank you for your patient work. Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139807130002 (code B ref 50072); Wed, 05 Jan 2022 15:55:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:54:31 +0000 Received: from localhost ([127.0.0.1]:41506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58cR-0007np-MV for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:54:31 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:40446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58cP-0007nT-DM for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:54:30 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id f3uT2600E4UW6Th013uTqr; Wed, 05 Jan 2022 16:54:27 +0100 Message-ID: <47fb7c8fe5c8106f96439f590b05e7ca21d20679.camel@telenet.be> From: Maxime Devos Date: Wed, 05 Jan 2022 15:54:22 +0000 In-Reply-To: <86h7ai6wzd.fsf@gmail.com> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> <86h7ai6wzd.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-uqat4L7sSrTncoNrQnCz" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641398067; bh=TdoqazhF/qw85pXnKsfvSERnTS3K02tq2nMsYsm6TcQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=RfYxxFu2obac0rCupsrhXM0hAj1bMx7NLf5Q3pg4Q6+Igx82VMgK/JBIAskSw3M8/ yHVGO6lX/ilDFTni99hY4mnHErqYFEplHOsGSuXKNcCZxu7OpBHT6PP0KsU8rfnCjy UDvDk1RUVw+tYAwNsjdtFAoUcQ+YxgcCOrs+/SOT3SQxZBvDLHnVv++XtLtXTdspYE Pu0ohQ9hBDmvqgz2gOQ99FamjMK0bSu8macUAQ447MmA5L2uYh/Qqb1faBV96Fguig /raFjJIvAh24s+a9u4TMR5z9TPLSBGKlWPWizHu7NmoyL+uwOB7df+m/Rh3SspZ47K ci++Ej0vR+vsg== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-uqat4L7sSrTncoNrQnCz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable zimoun schreef op wo 05-01-2022 om 16:08 [+0100]: > [...] > Thank you for your patient work. And thank you for double-checking things! I'll drop a message on #guix that all appears to be ready for merging. Greetings, Maxime. --=-uqat4L7sSrTncoNrQnCz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdW/LhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iDmAQD3i+fD+DnBtEdKaHFatvlx4cY6 fo6Gooifxi/a+fmyWAEAxp4fK7q3mwQmI37y2F26TFJijtdA/1gU8X7NXG3eIAE= =vuuv -----END PGP SIGNATURE----- --=-uqat4L7sSrTncoNrQnCz-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 1/4] guix hash: Extract file hashing procedures. References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:57:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139820530352 (code B ref 50072); Wed, 05 Jan 2022 15:57:04 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:56:45 +0000 Received: from localhost ([127.0.0.1]:41540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eX-0007tK-Qq for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:45 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:43604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eV-0007t0-Nl for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:40 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id f3we2600K4UW6Th013we8C; Wed, 05 Jan 2022 16:56:39 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 15:56:34 +0000 Message-Id: <20220105155637.20153-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641398199; bh=NbrokZoVPvuKyRtEizbkjq1LE4lpGqaE5iJPt+N60jY=; h=From:To:Cc:Subject:Date; b=g/Xvb4UA7YaZ9kG+Y3k2V2paWLhFp50X3hd4UuC0x/RCkbadunHEGbC4bJrvSyAps ilszvuBMzPy7QLOuUelYb6prRi3ywCLKIWbwSKLhIPzY4isS3b9gz2w9109PTSmGjz o22tGxSEa8rxUOpt651jL323cFa7nh1PBYvqRd1O64+awVcPoL8Q40XldEz75okJlA LR9dqfyjvttMS67sYwZ+gNy4GjtaYNIqBdJhe1eC1LVxsuPtLd24NFirBgZAltstda OS8wGhtfu/jQu3bkusH6pLOr4t1WBVQI4tNXMZQXKyuAl2WW5KHmJdm0lCTIopPFZ1 jJUf7Cb1b58hA== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/hash.scm (guix-hash)[vcs-file?] (nar-hash, default-hash): Extract hashing logic to... * guix/hash.scm (vcs-file?, file-hash*): ... these new procedures in this new file. Modified-by: Maxime Devos --- Makefile.am | 1 + guix/hash.scm | 73 +++++++++++++++++++++++++++++++++++++++++++ guix/scripts/hash.scm | 22 +++---------- 3 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 guix/hash.scm diff --git a/Makefile.am b/Makefile.am index 8c5682a1c6..bc3d0087d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,6 +99,7 @@ MODULES = \ guix/extracting-download.scm \ guix/git-download.scm \ guix/hg-download.scm \ + guix/hash.scm \ guix/swh.scm \ guix/monads.scm \ guix/monad-repl.scm \ diff --git a/guix/hash.scm b/guix/hash.scm new file mode 100644 index 0000000000..3cb68e5c44 --- /dev/null +++ b/guix/hash.scm @@ -0,0 +1,73 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos +;;; +;;; 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 . + +(define-module (guix hash) + #:use-module (gcrypt hash) + #:use-module (guix serialization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:export (vcs-file? + file-hash*)) + +(define (vcs-file? file stat) + "Returns true if FILE is a version control system file." + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define* (file-hash* file #:key + (algorithm (hash-algorithm sha256)) + (recursive? 'auto) + (select? (negate vcs-file?))) + "Compute the hash of FILE with ALGORITHM. + +Symbolic links are only dereferenced if RECURSIVE? is false. +Directories are only supported if RECURSIVE? is #true or 'auto'. +The executable bit is only recorded if RECURSIVE? is #true. +If FILE is a symbolic link, it is only followed if RECURSIVE? is false. + +For regular files, there are two different hashes when the executable +hash isn't recorded: the regular hash and the nar hash. In most situations, +the regular hash is desired and setting RECURSIVE? to 'auto' does the right +thing for both regular files and directories. + +This procedure must only be used under controlled circumstances; +the detection of symbolic links in FILE is racy. + +When FILE is a directory, the procedure SELECT? called as (SELECT? FILE STAT) +decides which files to include. By default, version control files are +excluded. To include everything, SELECT? can be set to (const #true)." + (if (or (eq? recursive? #true) + (and (eq? recursive? 'auto) + ;; Don't change this to (eq? 'directory ...), because otherwise + ;; if 'file' denotes a symbolic link, the 'file-hash' below + ;; would dereference it -- dereferencing symbolic links would + ;; open an avoidable can of potential worms. + (not (eq? 'regular (stat:type (lstat file)))))) + (let-values (((port get-hash) + (open-hash-port algorithm))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (file-hash algorithm file))) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index d73e3d13dd..28d587b944 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #:use-module (gcrypt hash) #:use-module (guix serialization) #:use-module (guix ui) + #:use-module (guix hash) #:use-module (guix scripts) #:use-module (guix base16) #:use-module (guix base32) @@ -46,20 +48,14 @@ (define* (nar-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) - (let-values (((port get-hash) - (open-hash-port algorithm))) - (write-file file port #:select? select?) - (force-output port) - (get-hash))) + (file-hash* file #:algorithm algorithm #:select? select? #:recursive? #true)) (define* (default-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) select?) (match file ("-" (port-hash algorithm (current-input-port))) - (_ - (call-with-input-file file - (cute port-hash algorithm <>))))) + (_ (file-hash* file #:algorithm algorithm #:recursive? #false)))) (define* (git-hash file #:optional (algorithm (assoc-ref %default-options 'hash-algorithm)) @@ -181,16 +177,6 @@ use '--serializer' instead~%")) (parse-command-line args %options (list %default-options) #:build-options? #f)) - (define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (let* ((opts (parse-options)) (args (filter-map (match-lambda (('argument . value) base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 3/4] refresh: Support non-tarball sources. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:57:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139820630369 (code B ref 50072); Wed, 05 Jan 2022 15:57:04 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:56:46 +0000 Received: from localhost ([127.0.0.1]:41544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eb-0007te-Sk for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:46 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:43604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eW-0007t0-KV for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:41 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id f3we2600K4UW6Th013wg8T; Wed, 05 Jan 2022 16:56:40 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 15:56:36 +0000 Message-Id: <20220105155637.20153-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105155637.20153-1-maximedevos@telenet.be> References: <20220105155637.20153-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641398200; bh=1C9ahprOwcy10Tnk5guGYz+QxZ/hL2vALCXNKEI79wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dJbgsbl6fgWS6IXlR2TjuVFPkOz/NYMJmYyxj8i2/hsm9oJOGETdJ8oD20h73u0BZ gTUdBwQvz6pliy7CdYS+YCjm0m08qdVkJ3DWGoc1i1DtnLWz1r0L2+FN/G0rGwPo0E 4nvddQY7HGytjowS3R7j4LpOCYfMog1e4OsuABWGa5gItnMKm8Cty+USs/0F+2mByS pgXjTbOyhCyRbzg0/G9WdiCczEH1HEqw29vOfxYvmZK5uo5icFFgH9D671lgeIJYte IRlugjXeWYd1NHRpnCWOFY1GwCJH4PTrCd/xIE5mohFg22thRgYkSfJpPSMsSUxkZk GbS2G87ptdEmQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Sarah Morgensen * guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of 'port-sha256'. Rename TARBALL to OUTPUT. --- guix/scripts/refresh.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 8806f0f740..68bb9040d8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Simon Tournier +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,6 @@ (define-module (guix scripts refresh) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix scripts) #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) @@ -38,6 +38,7 @@ #:use-module (guix scripts graph) #:use-module (guix monads) #:use-module (guix gnupg) + #:use-module (guix hash) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module (ice-9 match) @@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed values: 'interactive' (default), 'always', and 'never'. When WARN? is true, warn about packages that have no matching updater." (if (lookup-updater package updaters) - (let-values (((version tarball source) + (let-values (((version output source) (package-update store package updaters #:key-download key-download)) ((loc) (or (package-field-location package 'version) (package-location package)))) (when version - (if (and=> tarball file-exists?) + (if (and=> output file-exists?) (begin (info loc (G_ "~a: updating from version ~a to version ~a...~%") @@ -363,8 +364,7 @@ warn about packages that have no matching updater." (info loc (G_ "~a: consider removing this propagated input: ~a~%") name change-name)))) (upstream-source-input-changes source)) - (let ((hash (call-with-input-file tarball - port-sha256))) + (let ((hash (file-hash* output))) (update-package-source package source hash))) (warning (G_ "~a: version ~a could not be \ downloaded and authenticated; not updating~%") -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 2/4] import: Factorize file hashing. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:57:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139821030382 (code B ref 50072); Wed, 05 Jan 2022 15:57:04 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:56:50 +0000 Received: from localhost ([127.0.0.1]:41546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58ec-0007tm-Ak for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:50 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:43644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eW-0007t1-Es for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:41 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id f3we2600K4UW6Th013wf8P; Wed, 05 Jan 2022 16:56:39 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 15:56:35 +0000 Message-Id: <20220105155637.20153-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105155637.20153-1-maximedevos@telenet.be> References: <20220105155637.20153-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641398199; bh=pToVcY6tyNJdA8to9CMlcbffGWezAHQB9+uOz7gou4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jH/QRH9G50/0naJV9a52EyBGclYi+nMD+mWcStR/Ite5Ahn1JPPlEG8y1x62wTKZA USe4gQnF5/acZfirYqpiv2vEd+EVRPKtEw2kY8XtUKwMciN8BqjJ+Simm7sjcIAQfO bm4CBkgi74ilWpBq+6B1Lxc0JLS4RUdUjYOAlhPc08VkddpIrve2PVlbSc2QxHlrFD SfXaljeYUtkQYJbes90RvEe6GHIflEE5VUeRbo2P3+jWNlwcwuZvuICHeXW7ZQeQPc KfUbFojUcXyR20QxnT57kLYz9j9uE59xtYnZZbPBgBgyxdB4IlNIaejHWclHKIgRBI 8jSFGSAm51p2Q== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->o [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.132.53 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.132.53 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) From: Sarah Morgensen * guix/import/cran.scm (vcs-file?, file-hash): Remove procedures. (description->package): Use 'file-hash*' instead. * guix/import/elpa.scm (vcs-file?, file-hash): Remove procedures. (git-repository->origin, elpa-package->sexp): Use 'file-hash* instead'. * guix/import/go.scm (vcs-file?, file-hash): Remove procedures. (git-checkout-hash): Use 'file-hash*' instead. * guix/import/minetest.scm (file-hash): Remove procedure. (make-minetest-sexp): Use 'file-hash*' instead. --- guix/import/cran.scm | 32 +++----------------------------- guix/import/elpa.scm | 29 +++++------------------------ guix/import/go.scm | 25 +++---------------------- guix/import/minetest.scm | 19 ++++++++----------- 4 files changed, 19 insertions(+), 86 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 1389576cad..b61402078d 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2020 Martin Becze +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,10 +36,9 @@ #:use-module (guix memoization) #:use-module (guix http-client) #:use-module (guix diagnostics) + #:use-module (guix hash) #:use-module (guix i18n) - #:use-module (gcrypt hash) #:use-module (guix store) - #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) @@ -196,17 +196,6 @@ bioconductor package NAME, or #F if the package is unknown." (bioconductor-packages-list type)) (cut assoc-ref <> "Version"))) -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - ;; Little helper to download URLs only once. (define download (memoize @@ -464,16 +453,6 @@ reference the pkg-config tool." (define (needs-knitr? meta) (member "knitr" (listify meta "VignetteBuilder"))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - (define (description->package repository meta) "Return the `package' s-expression for an R package published on REPOSITORY from the alist META, which was derived from the R package's DESCRIPTION file." @@ -571,12 +550,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (sha256 (base32 ,(bytevector->nix-base32-string - (case repository - ((git) - (file-hash source (negate vcs-file?) #t)) - ((hg) - (file-hash source (negate vcs-file?) #t)) - (else (file-sha256 source)))))))) + (file-hash* source #:recursive? (or git? hg?))))))) ,@(if (not (and git? hg? (equal? (string-append "r-" name) (cran-guix-name name)))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index edabb88b7a..c5167eacb5 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2021 Xinglu Chen +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,10 +38,10 @@ #:use-module (guix import utils) #:use-module (guix http-client) #:use-module (guix git) + #:use-module (guix hash) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) - #:use-module (gcrypt hash) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) @@ -229,27 +230,6 @@ keywords to values." (close-port port) (data->recipe (cons ':name data)))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file select? recursive?) - ;; Compute the hash of FILE. - (if recursive? - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port #:select? select?) - (force-output port) - (get-hash)) - (call-with-input-file file port-sha256))) - -;; XXX taken from (guix scripts hash) -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - (define (git-repository->origin recipe url) "Fetch origin details from the Git repository at URL for the provided MELPA RECIPE." @@ -271,7 +251,7 @@ RECIPE." (sha256 (base32 ,(bytevector->nix-base32-string - (file-hash directory (negate vcs-file?) #t))))))) + (file-hash* directory #:recursive? #true))))))) (define* (melpa-recipe->origin recipe) "Fetch origin details from the MELPA recipe and associated repository for @@ -380,7 +360,8 @@ type ''." (sha256 (base32 ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) + (bytevector->nix-base32-string + (file-hash* tarball #:recursive? #false)) "failed to download package"))))))) (build-system emacs-build-system) ,@(maybe-inputs 'propagated-inputs dependencies) diff --git a/guix/import/go.scm b/guix/import/go.scm index 26dbc34b63..c7673e6a1a 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -26,6 +26,7 @@ (define-module (guix import go) #:use-module (guix build-system go) #:use-module (guix git) + #:use-module (guix hash) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix import utils) @@ -36,11 +37,10 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix memoization) #:autoload (htmlprag) (html->sxml) ;from Guile-Lib - #:autoload (guix git) (update-cached-checkout) - #:autoload (gcrypt hash) (open-hash-port hash-algorithm sha256) #:autoload (guix serialization) (write-file) #:autoload (guix base32) (bytevector->nix-base32-string) #:autoload (guix build utils) (mkdir-p) + #:autoload (gcrypt hash) (hash-algorithm sha256) #:use-module (ice-9 match) #:use-module (ice-9 peg) #:use-module (ice-9 rdelim) @@ -499,25 +499,6 @@ source." goproxy (module-meta-repo-root meta-data))) -;; XXX: Copied from (guix scripts hash). -(define (vcs-file? file stat) - (case (stat:type stat) - ((directory) - (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) - ((regular) - ;; Git sub-modules have a '.git' file that is a regular text file. - (string=? (basename file) ".git")) - (else - #f))) - -;; XXX: Adapted from 'file-hash' in (guix scripts hash). -(define* (file-hash file #:optional (algorithm (hash-algorithm sha256))) - ;; Compute the hash of FILE. - (let-values (((port get-hash) (open-hash-port algorithm))) - (write-file file port #:select? (negate vcs-file?)) - (force-output port) - (get-hash))) - (define* (git-checkout-hash url reference algorithm) "Return the ALGORITHM hash of the checkout of URL at REFERENCE, a commit or tag." @@ -536,7 +517,7 @@ tag." (update-cached-checkout url #:ref `(tag-or-commit . ,reference))))) - (file-hash checkout algorithm))) + (file-hash* checkout #:algorithm algorithm #:recursive? #true))) (define (vcs->origin vcs-type vcs-repo-url version) "Generate the `origin' block of a package depending on what type of source diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index abddd885ee..a7bdbfebca 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +39,7 @@ #:use-module (guix base32) #:use-module (guix git) #:use-module ((guix git-download) #:prefix download:) + #:use-module (guix hash) #:use-module (guix store) #:export (%default-sort-key %contentdb-api @@ -286,14 +287,6 @@ results. The return value is a list of records." (with-store store (latest-repository-commit store url #:ref ref))) -;; XXX adapted from (guix scripts hash) -(define (file-hash file) - "Compute the hash of FILE." - (let-values (((port get-hash) (open-sha256-port))) - (write-file file port) - (force-output port) - (get-hash))) - (define (make-minetest-sexp author/name version repository commit inputs home-page synopsis description media-license license) @@ -314,9 +307,13 @@ MEDIA-LICENSE and LICENSE." ;; The git commit is not always available. ,(and commit (bytevector->nix-base32-string - (file-hash + (file-hash* (download-git-repository repository - `(commit . ,commit))))))) + `(commit . ,commit)) + ;; 'download-git-repository' already filtered out the '.git' + ;; directory. + #:select? (const #true) + #:recursive? #true))))) (file-name (git-file-name name version)))) (build-system minetest-mod-build-system) ,@(maybe-propagated-inputs (map contentdb->package-name inputs)) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 4/4] upstream: Support updating and fetching 'git-fetch' origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 15:57:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164139821130389 (code B ref 50072); Wed, 05 Jan 2022 15:57:05 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 15:56:51 +0000 Received: from localhost ([127.0.0.1]:41548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eg-0007tz-G9 for submit@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:51 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:43670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58eX-0007t8-Eq for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 10:56:44 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id f3we2600K4UW6Th013wg8X; Wed, 05 Jan 2022 16:56:40 +0100 From: Maxime Devos Date: Wed, 5 Jan 2022 15:56:37 +0000 Message-Id: <20220105155637.20153-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105155637.20153-1-maximedevos@telenet.be> References: <20220105155637.20153-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641398200; bh=OcXbP9H75mnRWI/rumIqeKoSasXir76HNnl6Eq+S86Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=njm6uMbpRK0t9C+Jb/4YlmynBw7OzwO5ZzMTPQWqw4MtkbFFdow9/SaLI4ACcUj1U HEdiN7xeXzDdVm3PO17JOD9DKs8wf3E/DmSbybKgJS53nMZm9ksocy5c7zOk+yKmu8 VW5fHiDZEalqsWaGx7l4eHUx3TUMA2B0kh/UTx/tuUdweAzsRgWigoQQk5B1E/ZKO9 Dq8KRuTgTM0CYQ6ZrQz7BSO7yD8zb1zJViWau+Pw+k6ABuSY2oDRLUnKjlwpaGPHit 4anr6Uw/n9ZxcG/VML9EKRtG5L6Nnnw68kRPcTS/xdTwh0umoJANoTgLAxUR+J03eB TeJhoqDT2Vt0g== X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [195.130.132.53 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [195.130.132.53 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maximedevos[at]telenet.be) 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) From: Sarah Morgensen Updaters need to be modified to return 'git-reference' objects. This patch modifies the 'generic-git' and 'minetest' updater, but others might need to be modified as well. * guix/git.scm (git-reference->git-checkout): New procedure. * guix/upstream.scm (package-update/git-fetch): New procedure. ()[urls]: Document it can be a 'git-reference'. (%method-updates): Add 'git-fetch' mapping. (update-package-source): Support 'git-reference' sources. (upstream-source-compiler/url-fetch): Split off from ... (upstream-source-compiler): ... this, and call ... (upstream-source-compiler/git-fetch): ... this new procedure if the URL field contains a 'git-reference'. * guix/import/git.scm (latest-git-tag-version): Always return two values and document that the tag is returned as well. (latest-git-release)[urls]: Use the 'git-reference' instead of the repository URL. * guix/import/minetest.scm (latest-minetest-release)[urls]: Don't wrap the 'git-reference' in a list. * tests/minetest.scm (upstream-source->sexp): Adjust to new convention. Co-authored-by: Maxime Devos --- guix/git.scm | 14 +++++++- guix/import/git.scm | 22 +++++++----- guix/import/minetest.scm | 6 ++-- guix/upstream.scm | 73 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++-- 5 files changed, 98 insertions(+), 24 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dc2ca1be84..43e85a5026 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2021 Kyle Meyer ;;; Copyright © 2021 Marius Bakke +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,8 @@ #:use-module (guix utils) #:use-module (guix records) #:use-module (guix gexp) + #:autoload (guix git-download) + (git-reference-url git-reference-commit git-reference-recursive?) #:use-module (guix sets) #:use-module ((guix diagnostics) #:select (leave warning)) #:use-module (guix progress) @@ -65,7 +68,9 @@ git-checkout-url git-checkout-branch git-checkout-commit - git-checkout-recursive?)) + git-checkout-recursive? + + git-reference->git-checkout)) (define %repository-cache-directory (make-parameter (string-append (cache-directory #:ensure? #f) @@ -672,6 +677,13 @@ is true, limit to only refs/tags." (commit git-checkout-commit (default #f)) ;#f | tag | commit (recursive? git-checkout-recursive? (default #f))) +(define (git-reference->git-checkout reference) + "Convert the REFERENCE to an equivalent ." + (git-checkout + (url (git-reference-url reference)) + (commit (git-reference-commit reference)) + (recursive? (git-reference-recursive? reference)))) + (define* (latest-repository-commit* url #:key ref recursive? log-port) ;; Monadic variant of 'latest-repository-commit'. (lambda (store) diff --git a/guix/import/git.scm b/guix/import/git.scm index 1eb219f3fe..4cf404677c 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) + #:use-module (srfi srfi-71) #:export (%generic-git-updater ;; For tests. @@ -172,21 +174,21 @@ repository at URL." (values version tag))))))) (define (latest-git-tag-version package) - "Given a PACKAGE, return the latest version of it, or #f if the latest version -could not be determined." + "Given a PACKAGE, return the latest version of it and the corresponding git +tag, or #false and #false if the latest version could not be determined." (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c)) (warning (or (package-field-location package 'source) (package-location package)) (G_ "~a for ~a~%") (condition-message c) (package-name package)) - #f) + (values #f #f)) ((eq? (exception-kind c) 'git-error) (warning (or (package-field-location package 'source) (package-location package)) (G_ "failed to fetch Git repository for ~a~%") (package-name package)) - #f)) + (values #f #f))) (let* ((source (package-source package)) (url (git-reference-url (origin-uri source))) (property (cute assq-ref (package-properties package) <>))) @@ -208,14 +210,16 @@ could not be determined." "Return an for the latest release of PACKAGE." (let* ((name (package-name package)) (old-version (package-version package)) - (url (git-reference-url (origin-uri (package-source package)))) - (new-version (latest-git-tag-version package))) - - (and new-version + (old-reference (origin-uri (package-source package))) + (new-version new-version-tag (latest-git-tag-version package))) + (and new-version new-version-tag (upstream-source (package name) (version new-version) - (urls (list url)))))) + (urls (git-reference + (url (git-reference-url old-reference)) + (commit new-version-tag) + (recursive? (git-reference-recursive? old-reference)))))))) (define %generic-git-updater (upstream-updater diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index a7bdbfebca..3b2cdcdcac 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -504,9 +504,9 @@ or #false if the latest release couldn't be determined." (upstream-source (package (package:package-name pkg)) (version (release-version release)) - (urls (list (download:git-reference - (url (package-repository contentdb-package)) - (commit (release-commit release)))))))) + (urls (download:git-reference + (url (package-repository contentdb-package)) + (commit (release-commit release))))))) (define %minetest-updater (upstream-updater diff --git a/guix/upstream.scm b/guix/upstream.scm index 632e9ebc4f..1fe996ef3d 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -2,6 +2,8 @@ ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2015 Alex Kost ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2021, 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,12 +26,15 @@ #:use-module (guix discovery) #:use-module ((guix download) #:select (download-to-store url-fetch)) + #:use-module (guix git-download) #:use-module (guix gnupg) #:use-module (guix packages) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (guix base32) #:use-module (guix gexp) + #:autoload (guix git) (latest-repository-commit git-reference->git-checkout) + #:use-module (guix hash) #:use-module (guix store) #:use-module ((guix derivations) #:select (built-derivations derivation->output-path)) #:autoload (gcrypt hash) (port-sha256) @@ -93,7 +98,7 @@ upstream-source? (package upstream-source-package) ;string (version upstream-source-version) ;string - (urls upstream-source-urls) ;list of strings + (urls upstream-source-urls) ;list of strings|git-reference (signature-urls upstream-source-signature-urls ;#f | list of strings (default #f)) (input-changes upstream-source-input-changes @@ -357,10 +362,9 @@ values: 'interactive' (default), 'always', and 'never'." data url) #f))))))) -(define-gexp-compiler (upstream-source-compiler (source ) - system target) - "Download SOURCE from its first URL and lower it as a fixed-output -derivation that would fetch it." +(define (upstream-source-compiler/url-fetch source system) + "Lower SOURCE, an pointing to a tarball, as a +fixed-output derivation that would fetch it, and verify its authenticity." (mlet* %store-monad ((url -> (first (upstream-source-urls source))) (signature -> (and=> (upstream-source-signature-urls source) @@ -378,6 +382,30 @@ derivation that would fetch it." (url-fetch url 'sha256 hash (store-path-package-name tarball) #:system system)))) +(define (upstream-source-compiler/git-fetch source system) + "Lower SOURCE, an using git, as a fixed-output +derivation that would fetch it." + (mlet* %store-monad ((reference -> (upstream-source-urls source)) + (checkout + (lower-object + (git-reference->git-checkout reference) + system))) + ;; Like in 'upstream-source-compiler/url-fetch', return a fixed-output + ;; derivation instead of CHECKOUT. + (git-fetch reference 'sha256 + (file-hash* checkout #:recursive? #true #:select? (const #true)) + (git-file-name (upstream-source-package source) + (upstream-source-version source)) + #:system system))) + +(define-gexp-compiler (upstream-source-compiler (source ) + system target) + "Download SOURCE, lower it as a fixed-output derivation that would fetch it, +and verify its authenticity if possible." + (if (git-reference? (upstream-source-urls source)) + (upstream-source-compiler/git-fetch source system) + (upstream-source-compiler/url-fetch source system))) + (define (find2 pred lst1 lst2) "Like 'find', but operate on items from both LST1 and LST2. Return two values: the item from LST1 and the item from LST2 that match PRED." @@ -430,9 +458,24 @@ SOURCE, an ." #:key-download key-download))) (values version tarball source)))))) +(define* (package-update/git-fetch store package source #:key key-download) + "Return the version, checkout, and SOURCE, to update PACKAGE to +SOURCE, an ." + ;; TODO: it would be nice to authenticate commits, e.g. with + ;; "guix git authenticate" or a list of permitted signing keys. + (define ref (upstream-source-urls source)) ; a + (values (upstream-source-version source) + (latest-repository-commit + store + (git-reference-url ref) + #:ref `(tag-or-commit . ,(git-reference-commit ref)) + #:recursive? (git-reference-recursive? ref)) + source)) + (define %method-updates ;; Mapping of origin methods to source update procedures. - `((,url-fetch . ,package-update/url-fetch))) + `((,url-fetch . ,package-update/url-fetch) + (,git-fetch . ,package-update/git-fetch))) (define* (package-update store package #:optional (updaters (force %updaters)) @@ -492,9 +535,22 @@ new version string if an update was made, and #f otherwise." (origin-hash (package-source package)))) (old-url (match (origin-uri (package-source package)) ((? string? url) url) + ((? git-reference? ref) + (git-reference-url ref)) (_ #f))) (new-url (match (upstream-source-urls source) - ((first _ ...) first))) + ((first _ ...) first) + ((? git-reference? ref) + (git-reference-url ref)) + (_ #f))) + (old-commit (match (origin-uri (package-source package)) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) + (new-commit (match (upstream-source-urls source) + ((? git-reference? ref) + (git-reference-commit ref)) + (_ #f))) (file (and=> (location-file loc) (cut search-path %load-path <>)))) (if file @@ -508,6 +564,9 @@ new version string if an update was made, and #f otherwise." 'filename file)) (replacements `((,old-version . ,version) (,old-hash . ,hash) + ,@(if (and old-commit new-commit) + `((,old-commit . ,new-commit)) + '()) ,@(if (and old-url new-url) `((,(dirname old-url) . ,(dirname new-url))) diff --git a/tests/minetest.scm b/tests/minetest.scm index 77b9aa928f..cbb9e83889 100644 --- a/tests/minetest.scm +++ b/tests/minetest.scm @@ -387,10 +387,9 @@ during a dynamic extent where that package is available on ContentDB." ;; Update detection (define (upstream-source->sexp upstream-source) - (define urls (upstream-source-urls upstream-source)) - (unless (= 1 (length urls)) - (error "only a single URL is expected")) - (define url (first urls)) + (define url (upstream-source-urls upstream-source)) + (unless (git-reference? url) + (error "a is expected")) `(,(upstream-source-package upstream-source) ,(upstream-source-version upstream-source) ,(git-reference-url url) -- 2.30.2 From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v5 1/4] guix hash: Extract file hashing procedures. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 16:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 50072@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16413988587663 (code B ref 50072); Wed, 05 Jan 2022 16:08:02 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 16:07:38 +0000 Received: from localhost ([127.0.0.1]:41573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58p8-0001zX-54 for submit@debbugs.gnu.org; Wed, 05 Jan 2022 11:07:38 -0500 Received: from mail-wr1-f43.google.com ([209.85.221.43]:33557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n58p6-0001zG-8Q for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 11:07:36 -0500 Received: by mail-wr1-f43.google.com with SMTP id d9so84120949wrb.0 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 08:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=FeFjeXogxjTMCQ+d98VtuBsPEwZ2e8dW1ArZtEcPElA=; b=T2EZzX1AS7zP9+eZOBuJ9jF9lJh89V/LxqDw82OG5wZ5DdnK3pfHu3UXXHVtP9otc5 8KdIY1M9QGp/5/oIQnuq8CQV1Q4aY8YssflpWN1uUAGmyiFZd6+u4G2Qz/j5Ufl88eLZ 6c5yd/xjO5/S7+16MSSsQiVRHcg51dvvfmBTyj/o7dOh5qpXYoLFdPrBwUfejN1M3xcD browWzJrDfkQBzDJ1GTI/AvFOl0Ayldufz7wflFlM+cLV8C8f9S1gloQQiqn6gZUWdgw bwT/ybWWOTx0z3NajHoJtuLOcXrq4RcgW2TohDI0JeeDo04B98+zE4GWawgoFcZkqlQb xDnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=FeFjeXogxjTMCQ+d98VtuBsPEwZ2e8dW1ArZtEcPElA=; b=BQPCYO6xoCBG56EkxKUGYqYuKhvq9RItwTxtG/fSyvsmoD3/ryL+DDtKSvzchBRhIu KvTdEtr2gDuyu+WHs9ox6SIQ1xJH0WRWt5qGzYvjY1BFQnrgBdE6gsQCQMr7FjifGbDY lHRHrUJxiuBKUItkA7UbEMQYi7Klf6Ql5NcbIlD9B7obMxSCTyA+Q3g8ptlZKS4dHj5J wbZxG4mhgpwELZQefF3ZtKUJC5mVB6cjkttRFH50F/xNBUsZeXQmHGSXjxWydvmtGsFu OfneTwyVJWihgBaCbbPQXolqKd6iYqk36Xh5TkyQHWIY3YBxTYKbFjvVs4pyQL1t4+Us HqSQ== X-Gm-Message-State: AOAM5307Lhx1q2FPKFUXxnRU/nVsw4b6q5rrk+bXK8Q+HojtL43vQLFM NhVi8AkPLzbbtJIhzLZungM= X-Google-Smtp-Source: ABdhPJxpv3u2glfbUlZxYQuLLKvo0mXkS3a38dkTpW/yNpAavLSJqHNMHLojTb3up9crh30cw3ZtoQ== X-Received: by 2002:a05:6000:2a3:: with SMTP id l3mr45795071wry.289.1641398850512; Wed, 05 Jan 2022 08:07:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id f10sm3184170wmq.16.2022.01.05.08.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 08:07:30 -0800 (PST) From: zimoun In-Reply-To: <20220105140750.18214-1-maximedevos@telenet.be> References: <20220105140750.18214-1-maximedevos@telenet.be> Date: Wed, 05 Jan 2022 16:57:41 +0100 Message-ID: <86bl0q6uq2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxime Thanks for all the work. All the series LGTM! Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 10:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org, zimoun Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16414636097389 (code B ref 50072); Thu, 06 Jan 2022 10:07:01 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Jan 2022 10:06:49 +0000 Received: from localhost ([127.0.0.1]:39688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5PfI-0001us-4y for submit@debbugs.gnu.org; Thu, 06 Jan 2022 05:06:49 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:58554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5PfC-0001uY-3T for 50072@debbugs.gnu.org; Thu, 06 Jan 2022 05:06:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8EF95FF; Thu, 6 Jan 2022 11:06:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jlqxbglj4GnV; Thu, 6 Jan 2022 11:06:22 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1739B2A8; Thu, 6 Jan 2022 11:06:21 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> Date: Thu, 06 Jan 2022 11:06:21 +0100 In-Reply-To: (Maxime Devos's message of "Wed, 05 Jan 2022 12:10:01 +0000") Message-ID: <87mtk9faaq.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + X-Spam-Level: * X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Queue-Id: 8EF95FF X-Spamd-Result: default: False [1.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,mgsn.dev,debbugs.gnu.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, Maxime Devos skribis: > 'auto' is indeed a little ambigious, so I adjusted most calls to > file-hash* to set #:recursive? #true/#false appropriately in=C2=A0v3. > But in this particular case (guix/scripts/refresh.scm), it not known in > advance, so some guesswork is necessary. We could move guesswork at the call site. No big deal IMO, though. > Anyway, these calls to file-hash* are bothering me a little: can't > we just record the hash in the 'upstream-source' record or ask the > daemon for the hash of a store item (*) or something? represents available source that has usually not been downloaded yet (that=E2=80=99s what happens when running =E2=80=98guix refr= esh=E2=80=99 without =E2=80=98-u=E2=80=99), so it cannot contain the hash. > That would complicate this patch series more, so I'd prefer to delay > that for a future patch series. Yes, this series LGTM as-is, but let=E2=80=99s keep these improvements in m= ind. Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 10:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org, zimoun Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16414640288016 (code B ref 50072); Thu, 06 Jan 2022 10:14:01 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Jan 2022 10:13:48 +0000 Received: from localhost ([127.0.0.1]:39702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5PmF-00025E-OU for submit@debbugs.gnu.org; Thu, 06 Jan 2022 05:13:47 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:58722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5PmE-000250-8D for 50072@debbugs.gnu.org; Thu, 06 Jan 2022 05:13:46 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id AECEC2C3; Thu, 6 Jan 2022 11:13:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ngv4ikgwO8gQ; Thu, 6 Jan 2022 11:13:38 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3624D1D7; Thu, 6 Jan 2022 11:13:38 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> Date: Thu, 06 Jan 2022 11:13:37 +0100 In-Reply-To: <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> (Maxime Devos's message of "Wed, 05 Jan 2022 14:06:55 +0000") Message-ID: <87h7ahf9ym.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + X-Spam-Level: * X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Queue-Id: AECEC2C3 X-Spamd-Result: default: False [1.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,mgsn.dev,debbugs.gnu.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Maxime Devos skribis: > zimoun schreef op wo 05-01-2022 om 13:58 [+0100]: [...] >> =C2=A02) From my point of view, =E2=80=99#:recursive?=E2=80=99 needs to = be adapted in >> =C2=A0agreement with the discussion [1], quoting Ludo: >>=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Thinking more about it, = I think confusion stems from the term >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=E2=80=9Crecursive=E2=80= =9D (inherited from Nix) because, as you write, it >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0doesn=E2=80=99t necessar= ily have to do with recursion and directory >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0traversal. >>=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Instead, it has to do wi= th the serialization method. >>=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A01: >>=20 >> =C2=A0=C2=A0=C2=A0And I do not have a strong opinion. Just a naive rema= rk. > > I don't think the arguments for (guix scripts hash) apply directly > to (guix hash) -- (guix scripts hash) supports multiple serialisers: > > * none (regular in (guix hash) terminology) > * git > * nar > * swh I think IWBN eventually for =E2=80=98file-hash*=E2=80=99 to have a #:serial= izer argument. (guix scripts hash) would then become a thin layer above (guix hash). That #:serializer would have a default value, probably =E2=80=9Cnone=E2=80= =9D, but no =E2=80=9Cauto-detection=E2=80=9D as this amount of guessing would make for = a fragile interface IMO. (Perhaps =E2=80=98file-hash=E2=80=99 is too generic-sounding; for a =E2=80= =98source-code-hash=E2=80=99 or similarly-named procedure, some defaults and guesswork would be more obvious.) Thanks, Ludo=E2=80=99. From unknown Tue Jun 17 22:26:57 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Sarah Morgensen Subject: bug#50072: closed (Re: bug#50072: [PATCH WIP 0/4] Add upstream updater for git-fetch origins.) Message-ID: References: <87bl0pf9mz.fsf_-_@gnu.org> X-Gnu-PR-Message: they-closed 50072 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 50072@debbugs.gnu.org Date: Thu, 06 Jan 2022 10:21:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1641464461-8691-1" This is a multi-part message in MIME format... ------------=_1641464461-8691-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #50072: [PATCH WIP 0/4] Add upstream updater for git-fetch origins. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 50072@debbugs.gnu.org. --=20 50072: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D50072 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1641464461-8691-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 50072-done) by debbugs.gnu.org; 6 Jan 2022 10:20:46 +0000 Received: from localhost ([127.0.0.1]:39707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Pt0-0002FZ-H5 for submit@debbugs.gnu.org; Thu, 06 Jan 2022 05:20:46 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:58884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Psy-0002FL-OT for 50072-done@debbugs.gnu.org; Thu, 06 Jan 2022 05:20:45 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 07CE81D7; Thu, 6 Jan 2022 11:20:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bvbpjHQIPCAC; Thu, 6 Jan 2022 11:20:37 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 0A18163; Thu, 6 Jan 2022 11:20:36 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: bug#50072: [PATCH WIP 0/4] Add upstream updater for git-fetch origins. References: <20220105155637.20153-1-maximedevos@telenet.be> <20220105155637.20153-4-maximedevos@telenet.be> Date: Thu, 06 Jan 2022 11:20:36 +0100 In-Reply-To: <20220105155637.20153-4-maximedevos@telenet.be> (Maxime Devos's message of "Wed, 5 Jan 2022 15:56:37 +0000") Message-ID: <87bl0pf9mz.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + X-Spam-Level: * X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Queue-Id: 07CE81D7 X-Spamd-Result: default: False [1.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[debbugs.gnu.org,mgsn.dev,gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 50072-done Cc: Sarah Morgensen , zimoun , 50072-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Applied v5 of this patch series, thanks a lot Sarah, Maxime, and zimoun! \o/ One thing we should eventually address IMO is how the abstraction could be made to better model both tarballs and checkouts: https://issues.guix.gnu.org/50072#29 Ludo=E2=80=99. ------------=_1641464461-8691-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Aug 2021 23:16:28 +0000 Received: from localhost ([127.0.0.1]:47934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPMh-0001bx-Nf for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:16:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:43464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFPMc-0001bd-Cj for submit@debbugs.gnu.org; Sun, 15 Aug 2021 19:16:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFPMc-0006ea-4h for guix-patches@gnu.org; Sun, 15 Aug 2021 19:16:22 -0400 Received: from out1.migadu.com ([91.121.223.63]:57916) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFPMZ-0006Xx-3S for guix-patches@gnu.org; Sun, 15 Aug 2021 19:16:21 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1629069376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=fdwVozHOIoneJWc/FOIByFwOsv6rNoZsKsHyUvUXw58=; b=A+Qy9yZJI/pZC9Vp8iOUn579Zfr53G1blnjXw5a1uTHWGOObbbD6zEJ7Hw95oLXdk7k+HO RmZK4Tg6B4eZ7NRV0uekaoOODK9GrY2mE2HYZFwYOqSUNsnrjZxMpmkVDVlshuBj6U/Ut4 NxcnFJDZ4mhBgj88kKpZ4LQJU7OOY20= From: Sarah Morgensen To: guix-patches@gnu.org Subject: [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Date: Sun, 15 Aug 2021 16:16:13 -0700 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev Received-SPF: pass client-ip=91.121.223.63; envelope-from=iskarian@mgsn.dev; helo=out1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello Guix, This is a proof-of-concept for extending `guix refresh -u` to support packages with git-fetch origins. The potential impact is large: approximately 4.5k packages use git-fetch, although only some fraction would be supported. Currently, this enables update support for (at least) any package where * github-updater finds an update, * origin-method is 'git-fetch', and * the package version is a suffix of the 'commit' field. Drawbacks currently include the fact that libgit2 doesn't (yet) support shallow checkouts [0], so the entire repository must be cloned. There is also no support for verifying commits. There should probably also be a few tests added. WDYT? [0] https://github.com/libgit2/libgit2/issues/3058 -- Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating git-fetch origins. guix/git-download.scm | 18 +++++++++++++- guix/hash.scm | 51 ++++++++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 +++---------------------- guix/import/elpa.scm | 28 ++++------------------ guix/import/go.scm | 26 +++----------------- guix/scripts/hash.scm | 29 ++++++----------------- guix/scripts/refresh.scm | 10 ++++---- guix/upstream.scm | 41 +++++++++++++++++++++++++++++++- 8 files changed, 130 insertions(+), 105 deletions(-) create mode 100644 guix/hash.scm base-commit: 12099eac1b161d364be923451d27d7d739d0f14d -- 2.31.1 ------------=_1641464461-8691-1-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Sarah Morgensen , 50072@debbugs.gnu.org, zimoun Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16414651309897 (code B ref 50072); Thu, 06 Jan 2022 10:33:02 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Jan 2022 10:32:10 +0000 Received: from localhost ([127.0.0.1]:39733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Q41-0002ZY-QS for submit@debbugs.gnu.org; Thu, 06 Jan 2022 05:32:09 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:44036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Q3z-0002ZP-VV for 50072@debbugs.gnu.org; Thu, 06 Jan 2022 05:32:08 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id fNY52600e4UW6Th01NY6QT; Thu, 06 Jan 2022 11:32:06 +0100 Message-ID: <0b4a85a3bac9ea2df6baf3e5c6d182e497724817.camel@telenet.be> From: Maxime Devos Date: Thu, 06 Jan 2022 11:32:00 +0100 In-Reply-To: <87h7ahf9ym.fsf_-_@gnu.org> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> <87h7ahf9ym.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-z3AqLqjJVK7Rukm9oqBy" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641465126; bh=rNU04pr4sCzG0rCNJ4Al5QiDDOUOsG7jnyiIrx3siM4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mcMWAfymfeEy9qNL7K3FINwiQN22eOn67/8IcuLp35Hlg4NGAXh6gmTi9AMmHr26R JdYvzBKBc+0qhyR3AWMOMylzdvEDT1pgKA9Fhl6vna0SbDWwvwvtInVOrsXyQvV20p eEa11VP83ksEVaOoP2vgMKlUNl/WFlFi9oVMwKxGjeVxC+U/Akm/p6h/Znj01PBrop /Ij7xps6+vAue8CTIFF00/Bit39OIkBmW648TQ6RbPkPwWaXNKrAzB28N2CwzVtwlL D5RIGExfz0MJm/SFhL5LxHLbbe5OT0X2heQyrprXJMkDO+r0pKi3vUKNFPUPm+cet/ N4hG6WgOCPorQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-z3AqLqjJVK7Rukm9oqBy Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op do 06-01-2022 om 11:13 [+0100]: > That #:serializer would have a default value, probably =E2=80=9Cnone=E2= =80=9D, but no > =E2=80=9Cauto-detection=E2=80=9D as this amount of guessing would make fo= r a fragile > interface IMO. The auto-detection could be put into a separate procedure (define (guess-nar-or-none-serializer file) ; to be renamed (if directory? 'nar 'none)) so that 'file-hash*' is not fragile, but auto-detection can still happen if explicitely asked for: (file-hash* file #:serializer (guess-nar-or-serializer file)) WDYT? --=-z3AqLqjJVK7Rukm9oqBy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdbFIBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kiIAPsH/S+Ni1aPpMMje0cTGQdeWyco Tsrh2i4drZcCMearewEAogGNLfkbLX3ngYyA2N0qWIgafgn4hwl1emOU36KBBQo= =E+Ak -----END PGP SIGNATURE----- --=-z3AqLqjJVK7Rukm9oqBy-- From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 11:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164146815814750 (code B ref 50072); Thu, 06 Jan 2022 11:23:01 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Jan 2022 11:22:38 +0000 Received: from localhost ([127.0.0.1]:39785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Qqr-0003pp-Of for submit@debbugs.gnu.org; Thu, 06 Jan 2022 06:22:37 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:43754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5Qqp-0003pc-W7 for 50072@debbugs.gnu.org; Thu, 06 Jan 2022 06:22:36 -0500 Received: by mail-wr1-f42.google.com with SMTP id o3so4068572wrh.10 for <50072@debbugs.gnu.org>; Thu, 06 Jan 2022 03:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=EDETxm40iofisxaEEx6Wrx3NcgCSQVAglBZZEesbmyo=; b=Fdwhi5LiQehIfGjIWqBqL6BVk8LO028hOpQBN/8kg9S/o/8jWHFvBhIYN/J51EjjpQ 8lcMVTs106MNmd0n7w1oJ0zTdIaUsdNRDZsdkc7rKsLlvpTv9f005Q+MWc9dUzfAKSJz AYpituyjGO3LN4yqVFPCSQxyDkrL0fwFtG7uBIngAmMqWXmqgI2nxlIOwr9TAit+VZ+I Ws6ZZxPDeWtHkNKmLzHbe2xwQqqALX+Aa33PVpPlLJVPZqSp6TwTKb9+lHOaf4aCqPRq eOyh3N4vn8x/dEGF0UYJUppSwHZc3/uKZfiGvuBbsvhN7cb61aEtLc9mIBRNWIDHa6QW J/KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=EDETxm40iofisxaEEx6Wrx3NcgCSQVAglBZZEesbmyo=; b=JukmkrJPAzM/S4dY3br1XkPX6LFYdEmeAJuPNnlgwKXC/i7gjIdsDBRKzpJMg66yqC 4+u+y8QpTeVFC2IYE1wPJFipZMpCTFqHw5uaUg1fetzXdTiWxuhrNBer30z/2L5UIA4Z OnfxBw2XF26XBbhqh4ZtV1LKv6xjH9oAJNFn752h/7U0HMRPEQkN2UPSNE51gfyKi/Ek H0tyD2IShQq/7w/2S0qR/nH+xQq+W1aLa4FcG51ft/rCzxzgUtTmT21ZR5UCWDxEXLRF UMG1kAFcVN1j2RtjIoGIukiqP1Qv9zAkIU/BHRlzSKNpkYfTauuqbxpQNnrnrFOpfT7v 5Rlw== X-Gm-Message-State: AOAM530hF5mKNSxSqJbgr3vWiBRtyMA625PE9e7ixKCP3uPEe1/UBDO0 c7yyFfXYb8Ibj0Om/7QzB77GBZwdepg= X-Google-Smtp-Source: ABdhPJzORu+8z6LfQO09qZaSeOhw/6KdJxEs/pPCqZmHMvLgvwzp6V8+6zNHPFRqB88Xtc2MLLbq8g== X-Received: by 2002:a5d:64ac:: with SMTP id m12mr51310098wrp.659.1641468150426; Thu, 06 Jan 2022 03:22:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id d13sm1737255wru.41.2022.01.06.03.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 03:22:30 -0800 (PST) From: zimoun In-Reply-To: <87h7ahf9ym.fsf_-_@gnu.org> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> <86pmp6730h.fsf@gmail.com> <6fcbe52781b0678ea44db9beea2e1bd3f404b840.camel@telenet.be> <87h7ahf9ym.fsf_-_@gnu.org> Date: Thu, 06 Jan 2022 12:19:17 +0100 Message-ID: <86h7ah5cy2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Thu, 06 Jan 2022 at 11:13, Ludovic Court=C3=A8s wrote: > I think IWBN eventually for =E2=80=98file-hash*=E2=80=99 to have a #:seri= alizer > argument. (guix scripts hash) would then become a thin layer above > (guix hash). > > That #:serializer would have a default value, probably =E2=80=9Cnone=E2= =80=9D, but no > =E2=80=9Cauto-detection=E2=80=9D as this amount of guessing would make fo= r a fragile > interface IMO. It was my idea behind when I proposed to rename #:recursive? to #:nar-serializer?. ;-) The name #:nar-serializer? was somehow an intermediary step since the patch was already ready and, as Maxime explained, the change for #:serializer was implying another round for adjusting and v4/v5 was already enough effort put in. :-) Anyway, the patch is ready (probably already pushed \o/ :-)). Nothing prevent us (me?) to propose later a patch for this adjustment. ;-) Cheers, simon From unknown Tue Jun 17 22:26:57 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 14:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Sarah Morgensen , 50072@debbugs.gnu.org, zimoun Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.16414783597932 (code B ref 50072); Thu, 06 Jan 2022 14:13:02 +0000 Received: (at 50072) by debbugs.gnu.org; 6 Jan 2022 14:12:39 +0000 Received: from localhost ([127.0.0.1]:39947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5TVP-00023s-5o for submit@debbugs.gnu.org; Thu, 06 Jan 2022 09:12:39 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:37014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5TVN-00023i-5g for 50072@debbugs.gnu.org; Thu, 06 Jan 2022 09:12:38 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by xavier.telenet-ops.be with bizsmtp id fSCZ2600F4UW6Th01SCZb3; Thu, 06 Jan 2022 15:12:35 +0100 Message-ID: <7c90d6fcd2ad81706f59a48437c0be46bb4e8428.camel@telenet.be> From: Maxime Devos Date: Thu, 06 Jan 2022 14:12:28 +0000 In-Reply-To: <87bl0pf9mz.fsf_-_@gnu.org> References: <20220105155637.20153-1-maximedevos@telenet.be> <20220105155637.20153-4-maximedevos@telenet.be> <87bl0pf9mz.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-qCwaytaod5xmiX2bVBDU" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1641478355; bh=ngAvvaxkUIqgKYf1eKlN7lAzZxU8D1dLdQp0bISpYdw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=OYmi5l+oy9WpoyFxs77ZM7Z857WXZh8/+tt0g5hjWqdP1VjB1Rwh0DNtqIyTXr485 n4WGaR9w+W2Smd66nJCGnVe41lQCzdqvjSJHqfJ9fC6ahJ9fb0ocZjev+pV2B/fZQT 8MQrMDDVkVujrRCJAYyhEe2ujtK92mRK+26xvrqJeUjZ1ghxy+xim2NA9Gc6T44Ysm AkWnDyuOMgUVORViexrzj48JQCc+D2SBZ9RW/h/MRIATRIysZSK5tQR2Wz0GQqUOWa H85yTnfQG+3ba8+xPNikKHHFQKomq1WeMzD2S0hzPoQ34/pck0g4AVHzg8o5b1uSIk tsp2W9vY+j0xw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-qCwaytaod5xmiX2bVBDU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op do 06-01-2022 om 11:20 [+0100]: > Applied v5 of this patch series, thanks a lot Sarah, Maxime, and zimoun! > \o/ >=20 I'm not seeing it in the git repo and after a "guix pull" I still have $ guix refresh -u minetest-advtrains gnu/packages/minetest.scm:652:2: fout: cannot download for this method: # Has it been pushed? Greetings, Maxime. --=-qCwaytaod5xmiX2bVBDU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYdb4zBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7p8ZAP4u/wIsH77Wd3Wt1tqua6yo6M4O l/1vvO3abIVVmGuMLgD9FX5NV4YdVKdHTjFojVWOfAGBOSIVWu7rVSA0AkqavQw= =iGcP -----END PGP SIGNATURE----- --=-qCwaytaod5xmiX2bVBDU--