all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben Woodcroft <b.woodcroft@uq.edu.au>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [PATCH] draft addition of github updater
Date: Fri, 26 Feb 2016 22:14:50 -0500	[thread overview]
Message-ID: <56D114AA.2090802@uq.edu.au> (raw)
In-Reply-To: <87vb5fk1de.fsf@gnu.org>



On 23/02/16 08:22, Ludovic Courtès wrote:
[ ... ]
>> On 04/01/16 06:46, Ludovic Courtès wrote:
>>> Ben Woodcroft<b.woodcroft@uq.edu.au>  skribis:
>>>
>>>> It seems I miscounted before, but now it is 129 of 146 github
>>>> "release" packages recognised with 28 suggesting an update - see the
>>>> end of email for details. There is one false positive:
>>>>
>>>> gnu/packages/ocaml.scm:202:13: camlp4 would be upgraded from 4.02+6 to
>>>> 4.02.0+1
>>>>
>>>> This happens because the newer versions were not made as official
>>>> releases just tags, so the newer versions are omitted from the API
>>>> response, plus there's the odd version numbering scheme. Guix is up to
>>>> date.
>>> I guess we could filter out such downgrades by adding a call to
>>> ‘version>?’, no?
>> My impression is that code elsewhere (yours?) already does this, but
>> version>? does not work as intended for this corner case.
> Indeed:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (version>? "4.02+6" "4.02.0+1")
> $2 = #f
> --8<---------------cut here---------------end--------------->8---
>
> I would argue that upstream chose a confusing numbering scheme is
> 4.02.0+1 is supposed to be older…

Indeed, I think it is OK to leave this.

>>> Rather use (guix http-client) and something like:
>>>
>>>     (let ((port (http-fetch url)))
>>>       (dynamic-wind
>>>         (const #t)
>>>         (lambda ()
>>>           (json->scm port))
>>>         (lambda ()
>>>           (close-port port))))
>>>
>>> This avoids the temporary file creation etc.
>> This sounds preferable but did not work as I kept getting 403
>> forbidden. Displaying the URI for instance with (string-append uri
>> "\n") gives the below. I understand the error is trivial, but just
>> wanted to communicate the URI object.
>>
>> ERROR: In procedure string-append:
>> ERROR: In procedure string-append: Wrong type (expecting string):
>> #<<uri> scheme: https userinfo: #f host: "api.github.com" port: #f
>> path: "/repos/torognes/vsearch/releases" query:
>> "access_token=27907952ef87f3691d592b9dcd93cd4b6f20625f" fragment: #f>
> That’s because this is a URI object, not a string.

I had a fresh crack at this, trying among other things:

(define (json-fetch* url)
   "Return a list/hash representation of the JSON resource URL, or #f on
failure."
   (display (string-append url "\n"))
   (let ((port (http-fetch url)))
     (dynamic-wind
       (const #t)
       (lambda ()
         (json->scm port))
       (lambda ()
         (close-port port)))))

and got
$ ./pre-inst-env guix refresh -t github vsearch
https://api.github.com/repos/torognes/vsearch/releases?access_token=27907952ef87f3691d592b9dcd93cd4b6f20625f
guix refresh: error: download failed

>>  From 29dc5a809e6d8796279911a993ef1b2237c810ca Mon Sep 17 00:00:00 2001
>> From: Ben Woodcroft <donttrustben@gmail.com>
>> Date: Sun, 15 Nov 2015 10:18:05 +1000
>> Subject: [PATCH] import: Add github-updater.
>>
>> * guix/import/github.scm: New file.
>> * guix/scripts/refresh.scm (%updaters): Add %GITHUB-UPDATER.
>> * doc/guix.texi (Invoking guix refresh): Mention it.
> Make sure to add github.scm in Makefile.am.  Otherwise LGTM!
>
> Once this is in, I’ll see if I can make that ‘http-fetch’ change I was
> suggesting.
>
> Thank you!

No problem at all, thanks for babying me through this.

Pushed as 917a2a58.
ben

  reply	other threads:[~2016-02-27  3:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15  0:32 [PATCH] draft addition of github updater Ben Woodcroft
2015-11-16  9:15 ` Ludovic Courtès
2015-12-20  0:42   ` Ben Woodcroft
2016-01-03 20:46     ` Ludovic Courtès
2016-01-05 16:05       ` Ricardo Wurmus
2016-04-15  8:42         ` Updaters now receive package objects Ludovic Courtès
2016-02-21  3:13       ` [PATCH] draft addition of github updater Ben Woodcroft
2016-02-21  3:17         ` Ben Woodcroft
2016-02-23 13:22         ` Ludovic Courtès
2016-02-27  3:14           ` Ben Woodcroft [this message]
2016-02-27 11:55             ` Ricardo Wurmus
2016-02-28 14:35               ` Ludovic Courtès
2015-11-16 14:14 ` Efraim Flashner

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

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

  git send-email \
    --in-reply-to=56D114AA.2090802@uq.edu.au \
    --to=b.woodcroft@uq.edu.au \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.