From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CGmqJVUK3mbFLgAAe85BDQ:P1 (envelope-from ) for ; Sun, 08 Sep 2024 20:34:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CGmqJVUK3mbFLgAAe85BDQ (envelope-from ) for ; Sun, 08 Sep 2024 22:34:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=tW9joqzJ; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=rBe6yK2S; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1725827669; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=LPUljIpODKu58W93U8eEQL5royQ8H6ANi7zmLC/JBko=; b=WbXFck+V8ycbAQWdfrasrAXFhfrokgZOTha98pKz8novhnVHDWuVGmDB/GaOcwZ5NBCwwc iKSi4rtMLWr+GgGmgkW8Fxn0ru15wxgiyiKgDhuNVUzfif7LifUysIyzueiKuqIZxI+uSb 2/Y3Eyt5Qgwf+QoGKwLYASZIPak15KeBnZd71adV18EL6iaYXLko/edD7stuhLHU7ERgFh ZtaOC2dbVgRWVa/d1YLqaRHHcIz8oIQfNj4XH4uCk+G4IoLKbWTFWq0+JyhayceAbw6iMG kvW1ei3a2Bqnh8KwYj9jv+KoqNnpC9vFSIevuEY140EO0KYPOEQsl6Oui8vQcw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725827669; a=rsa-sha256; cv=none; b=Dio8bKAjDXmr1l5jX/MCGvmAOEuCucern+ygKfsRyQn+Oruv85fLJG72AJuoPcyI4lDM+P 6Ty6n829v3hrTdNaJIT075CmZD8edZn0079IEHuJbI3corXN7xectX/bW9iRE7THeHA134 zwQ70Wi4V3YTzx1GacCZ5/q9oWTug11b8U+zGvDsvmmxyh6IWATgeGcT/EuFNhRVVhrlLO /RulaRfD5qYzDVUgaLbh82Lm57mQDIu2842C5+0mHbfFqFD+wc3Z/N0ifToUz+3bF/YHq+ jmHqaMlPuAhx1ujCT2r7LejJRU93wurreepoVAjkDCwbdWR9vH9egfKFZMBrYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=tW9joqzJ; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=rBe6yK2S; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 464FD70D79 for ; Sun, 08 Sep 2024 22:34:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snObi-0002nq-KE; Sun, 08 Sep 2024 16:34:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snObg-0002nS-I1 for guix-patches@gnu.org; Sun, 08 Sep 2024 16:34:00 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snObg-0004TD-7p for guix-patches@gnu.org; Sun, 08 Sep 2024 16:34:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=LPUljIpODKu58W93U8eEQL5royQ8H6ANi7zmLC/JBko=; b=tW9joqzJggLjZGPSj3FamgJV0Wg1UzkjZVGqxBCHYcgfU1Zj1fFWqjTv5uJ4kj7kNOZQHv7Vs+lQ75iUxWlU+NTAB2TZB3qDoiijmO+RGqqoDfAcy22nnBz4udUvsNwzx6huJXX4J0eFC2WxhixYwJyDkP75R3tNGXXBuJgS6rHI6L1gJJTeeIM5MLMjv6uq8xewG+EdQKdc+unSGrN5eyIjtJqNt9gfVvcCXYDpFxoMMmxtJls6fP/4i6zSQ2mc1BfNLDthyMA+CefcZvowTsgEl+emVTnsApToH0yBRQvpYjuS4aKB8/XRlUtz9lnqXe0imWocJxoHfDR5dtfEDw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snObi-00027s-1u for guix-patches@gnu.org; Sun, 08 Sep 2024 16:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73126] [PATCH] git-download: Add git-origin macro. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 20:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73126 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73126@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17258276228140 (code B ref -1); Sun, 08 Sep 2024 20:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Sep 2024 20:33:42 +0000 Received: from localhost ([127.0.0.1]:60086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snObO-00027E-27 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 16:33:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:53050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snObL-000276-OR for submit@debbugs.gnu.org; Sun, 08 Sep 2024 16:33:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snOZD-0002f1-Db for guix-patches@gnu.org; Sun, 08 Sep 2024 16:31:27 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117] helo=email.rimm.ee) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1snOZB-0004OD-OL for guix-patches@gnu.org; Sun, 08 Sep 2024 16:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1725827478; 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=LPUljIpODKu58W93U8eEQL5royQ8H6ANi7zmLC/JBko=; b=rBe6yK2SbB2dyPvuRZCdmrOgPGq84pqRrUzlS3rBN3gUxXATk/mXzWOxr2sbaglagilzBX bETtjA0MKUC3l3iS5dfA5CYQfTxGQ7nNcHQg0B4Dd6fryLuYE64czTmzGpoK27CWUuSHQX zrGvv79vNPsVFM6zsUltrZ0qy7jeAAY1L5meSQ3II2iIPIPKfw24HocNLTNgkOk4AP1Xn/ 26ieTla5gu4ptGZlYeQGg9gtleaTh9t5fFck04qeBiIkfDQ5frI/RfNRxwpCGuz2MP96SE VfFFoMpJhPkWXZsiWAl0BiQim9zJNwQaSugzijGraY4sPWi0UdsqP7QwSlbMdg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 5ba41f1b (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for ; Sun, 8 Sep 2024 20:31:18 +0000 (UTC) Date: Sun, 8 Sep 2024 22:30:24 +0200 Message-ID: <20240908203024.4762-1-herman@rimm.ee> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=81.205.150.117; envelope-from=herman@rimm.ee; helo=email.rimm.ee X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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_PBL=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.89 X-Spam-Score: -0.89 X-Migadu-Queue-Id: 464FD70D79 X-Migadu-Scanner: mx11.migadu.com X-TUID: WOQlKZG/P1sE * guix/packages.scm (git-origin-helper, git-origin): Add macros. --- guix/git-download.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/guix/git-download.scm b/guix/git-download.scm index ae2073ea06..d32f9a25eb 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -55,6 +55,8 @@ (define-module (guix git-download) git-reference-commit git-reference-recursive? + git-origin + git-fetch git-fetch/lfs git-version @@ -87,6 +89,31 @@ (define (git-lfs-package) (let ((distro (resolve-interface '(gnu packages version-control)))) (module-ref distro 'git-lfs))) +(define-syntax git-origin-helper + (syntax-rules (commit hash repository) + ((_ () (fields ...) c repo) + (origin fields ... + (method git-fetch) + (uri (git-reference (commit c) + (url repo))))) + ((_ ((commit exp) rest ...) others _ repo) + (git-origin-helper (rest ...) others exp repo)) + ((_ ((hash exp) rest ...) (others ...) c repo) + (git-origin-helper + (rest ...) + (others ... (hash (content-hash (base32 exp) sha256))) + c + repo)) + ((_ ((repository exp) rest ...) others c _) + (git-origin-helper (rest ...) others c exp)) + ((_ (field rest ...) (others ...) c repo) + (git-origin-helper (rest ...) (others ... field) c repo)))) + +(define-syntax-rule (git-origin fields ...) + "Build an record, converting the commit and repository field +specifications to a and hash to a ." + (git-origin-helper (fields ...) () #f #f)) + (define (git-fetch-builder git git-lfs git-ref-recursive? hash-algo) (define inputs `(,(or git (git-package)) -- 2.45.2