unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: ericbavier@openmailbox.org
Cc: guix-devel@gnu.org, Eric Bavier <bavier@member.fsf.org>
Subject: Re: [PATCH 3/3] import: Add Hackage updater.
Date: Mon, 28 Mar 2016 18:12:05 +0200	[thread overview]
Message-ID: <87oa9ysht6.fsf@gnu.org> (raw)
In-Reply-To: <1458705269-31766-3-git-send-email-ericbavier@openmailbox.org> (ericbavier@openmailbox.org's message of "Tue, 22 Mar 2016 22:54:29 -0500")

ericbavier@openmailbox.org skribis:

> From: Eric Bavier <bavier@member.fsf.org>
>
> * guix/import/hackage.scm (guix-package->hackage-name, hackage-package?)
>   (latest-release): New procedures.
>   (%hackage-updater): New variable.
> * guix/scripts/refresh.scm (%updaters): Add it.
> * doc/guix.texi (Invoking guix refresh): Mention it.

[...]

> +(define guix-package->hackage-name
> +  (let ((uri-rx (make-regexp "https?://hackage.haskell.org/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) 1)))
> +        (match (regexp-exec name-rx name)
> +          (#f name)
> +          (m (match:substring m 1)))))))

It might be useful to honor a ‘cabal-package-name’ property in cases
where guessing doesn’t work.  That can always be added later, though.

[...]

>                   %elpa-updater
>                   %cran-updater
>                   %bioconductor-updater
> +                 %hackage-updater

Make it:

  ((guix import hackage) => %hackage-importer)

to be on the safe side.

If you confirm that ‘guix refresh -t hackage’ doesn’t crash, go for it!

Thank you!

Ludo’.

  reply	other threads:[~2016-03-28 16:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23  3:54 [PATCH 1/3] import: hackage: Silence download output ericbavier
2016-03-23  3:54 ` [PATCH 2/3] import: hackage: Factorize url synthesis ericbavier
2016-03-28 16:08   ` Ludovic Courtès
2016-03-23  3:54 ` [PATCH 3/3] import: Add Hackage updater ericbavier
2016-03-28 16:12   ` Ludovic Courtès [this message]
2016-03-30  1:53     ` Eric Bavier
2016-03-30 21:16       ` Ludovic Courtès
2016-03-28 16:07 ` [PATCH 1/3] import: hackage: Silence download output Ludovic Courtès

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=87oa9ysht6.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bavier@member.fsf.org \
    --cc=ericbavier@openmailbox.org \
    --cc=guix-devel@gnu.org \
    /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).