GNU bug report logs - #61420
[PATCH 00/31] Haskell upgrade to Stackage 20.5

Previous Next

Package: guix-patches;

Reported by: Lars-Dominik Braun <lars <at> 6xq.net>

Date: Sat, 11 Feb 2023 10:00:02 UTC

Severity: normal

Tags: patch

Done: Lars-Dominik Braun <lars <at> 6xq.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: zimoun <zimon.toutoune <at> gmail.com>
To: Lars-Dominik Braun <lars <at> 6xq.net>, 61420 <at> debbugs.gnu.org
Cc: Lars-Dominik Braun <lars <at> 6xq.net>
Subject: [bug#61420] [PATCH 08/31] import: hackage: Use upstream-name property.
Date: Wed, 15 Feb 2023 11:48:00 +0100
Hi,

On Sat, 11 Feb 2023 at 11:08, Lars-Dominik Braun <lars <at> 6xq.net> wrote:
> * guix/import/hackage.scm (guix-package->hackage-name): Removed.
> (latest-release): Use package-upstream-name* instead.
> * guix/import/stackage.scm (latest-lts-release): Ditto.
> (stackage-lts-package?): Ditto.

> -(define guix-package->hackage-name
> -  (let ((uri-rx (make-regexp "(https?://hackage.haskell.org|mirror://hackage)/package/([^/]+)/.*"))
> -        (name-rx (make-regexp "(.*)-[0-9\\.]+")))
> -    (lambda (package)
> -      "Given a Guix package name, return the corresponding Hackage name."
> -      (let* ((source-url (and=> (package-source package) origin-uri))
> -             (name (match:substring (regexp-exec uri-rx source-url) 2)))
> -        (match (regexp-exec name-rx name)
> -          (#f name)
> -          (m (match:substring m 1)))))))

Why not just do a drop-in replacement of the implement of
’guix-package->hackage-name’ by the implementation of
’package-upstream-name*’?

Other said, avoid to introduce a new procedure and remove another; and
instead just replace the implementation of the old by the new.


> -  (let* ((hackage-name (guix-package->hackage-name package))
> +  (let* ((hackage-name (package-upstream-name* package))

It would avoid all these kind of replacement, no?


Cheers,
simon




This bug report was last modified 2 years and 171 days ago.

Previous Next


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