unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Chris Marusich <cmmarusich@gmail.com>,
	Julien Lepiller <julien@lepiller.eu>
Cc: 47375@debbugs.gnu.org
Subject: bug#47375: guix test failure: tests/print
Date: Thu, 25 Mar 2021 09:15:56 +0100	[thread overview]
Message-ID: <bd0986ed42b0dc6cae4109d4b47acecb6fc15906.camel@telenet.be> (raw)
In-Reply-To: <3f09a5671f6a7c04405d8529f7ed60b1e7f8eb6e.camel@telenet.be>


[-- Attachment #1.1: Type: text/plain, Size: 79 bytes --]

Oops I messed up the commit message in the patch.
Revised patch is attached.

[-- Attachment #1.2: 0001-guix-Let-the-procedure-name-of-url-fetch-be-what-gui.patch --]
[-- Type: text/x-patch, Size: 2563 bytes --]

From 2c6c28334173fff9112c36726d31d6adcebfbf2d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Thu, 25 Mar 2021 08:48:24 +0100
Subject: [PATCH] guix: Let the procedure name of "url-fetch*" be what "guix
 import" expects.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes: <https://issues.guix.gnu.org/47375>.
Reported-By: Léo Le Bouter <lle-bout@zaclys.net>.

* guix/download.scm
  (define*-visible-name): Define a syntax for overriding the procedure name
  of a procedure returned by "procedure-name".
  (url-fetch*): Use this syntax to change the procedure name to "url-fetch"
  as "guix import" expects.
---
 guix/download.scm | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/guix/download.scm b/guix/download.scm
index 30f69c0325..25c26a2ebb 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -449,11 +450,19 @@ download by itself using its own dependencies."
                     ;; for that built-in is widespread.
                     #:local-build? #t)))
 
-(define* (url-fetch* url hash-algo hash
-                     #:optional name
-                     #:key (system (%current-system))
-                     (guile (default-guile))
-                     executable?)
+;; In guix/import/print.scm, the procedure package->code uses procedure-name
+;; and expects to see the user-visible procedure name.
+(define-syntax-rule (define*-with-name (name . args) procedure-name . code)
+  "Define a procedure as with 'define*', but in such a matter that
+'procedure-name' on NAME will return PROCEDURE-NAME instead of NAME."
+  (define name (let ((procedure-name (lambda* args . code))) procedure-name)))
+
+(define*-with-name (url-fetch* url hash-algo hash
+                               #:optional name
+                               #:key (system (%current-system))
+                               (guile (default-guile))
+                               executable?)
+  url-fetch
   "Return a fixed-output derivation that fetches data from URL (a string, or a
 list of strings denoting alternate URLs), which is expected to have hash HASH
 of type HASH-ALGO (a symbol).  By default, the file name is the base name of
-- 
2.31.0


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2021-03-25  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  1:44 bug#47375: guix test failure: tests/print Léo Le Bouter via Bug reports for GNU Guix
2021-03-25  1:54 ` Julien Lepiller
2021-03-25  3:59   ` Chris Marusich
2021-03-25  7:55     ` Maxime Devos
2021-03-25  8:15       ` Maxime Devos [this message]
2021-03-25 23:23         ` Ludovic Courtès
2021-03-25 23:24 ` Ludovic Courtès
2021-03-25 23:27   ` Léo Le Bouter via Bug reports for GNU Guix
2021-03-28 16:25     ` Ludovic Courtès
2021-03-28 16:31       ` Léo Le Bouter via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd0986ed42b0dc6cae4109d4b47acecb6fc15906.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=47375@debbugs.gnu.org \
    --cc=cmmarusich@gmail.com \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).