unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Bavier <ericbavier@openmailbox.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 3/3] import: Add Hackage updater.
Date: Tue, 29 Mar 2016 20:53:16 -0500	[thread overview]
Message-ID: <20160329205316.16c56ba1@openmailbox.org> (raw)
In-Reply-To: <87oa9ysht6.fsf@gnu.org>

On Mon, 28 Mar 2016 18:12:05 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> 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.

Sure.  Let's save that for later.  This scheme works for all packages
that we have so far, and seems like it should work for most others on
Hackage that I've seen.

> 
> [...]
> 
> >                   %elpa-updater
> >                   %cran-updater
> >                   %bioconductor-updater
> > +                 %hackage-updater  
> 
> Make it:
> 
>   ((guix import hackage) => %hackage-importer)
> 
> to be on the safe side.

I considered that at first, but it seems like that syntax is for
updaters that rely on guile-json (or other modules which might be
missing).  I'd prefer not to unnecessarily confuse the situation.

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

I have done so, and it seems to work quite well.  There are a few
packages whose .cabal file fail to parse, so I included the
warning output to incite some future bug-fixing.

`~Eric

  reply	other threads:[~2016-03-30  1:53 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
2016-03-30  1:53     ` Eric Bavier [this message]
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=20160329205316.16c56ba1@openmailbox.org \
    --to=ericbavier@openmailbox.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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).