unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tracking upstream releases
@ 2015-10-21 12:54 Ludovic Courtès
  2015-10-21 13:17 ` Thompson, David
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ludovic Courtès @ 2015-10-21 12:54 UTC (permalink / raw)
  To: guix-devel

Hello!

We now have a number of importers, which is great, but so far we had no
support to update packages once they had been imported, even though most
of the code to do that already is in the importer.

So commit 0a7c5a09 generalizes the upstream-tracking code from (guix
gnu-maintenance) a bit, such that we can then easily define “updaters”
based on the import code.  As an example, subsequent commits add an
updater for ELPA and one for CRAN.  The end result is:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix refresh -t cran -t elpa
gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
--8<---------------cut here---------------end--------------->8---

(When ‘-t’ is omitted, all the updaters are used.)

So, I invite you to add an updater for your favorite importer!
It’s easy and super cool!  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tracking upstream releases
  2015-10-21 12:54 Tracking upstream releases Ludovic Courtès
@ 2015-10-21 13:17 ` Thompson, David
  2015-10-21 17:03 ` Andreas Enge
  2015-10-22  8:17 ` Alex Kost
  2 siblings, 0 replies; 8+ messages in thread
From: Thompson, David @ 2015-10-21 13:17 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

On Wed, Oct 21, 2015 at 8:54 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> Hello!
>
> We now have a number of importers, which is great, but so far we had no
> support to update packages once they had been imported, even though most
> of the code to do that already is in the importer.
>
> So commit 0a7c5a09 generalizes the upstream-tracking code from (guix
> gnu-maintenance) a bit, such that we can then easily define “updaters”
> based on the import code.  As an example, subsequent commits add an
> updater for ELPA and one for CRAN.  The end result is:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix refresh -t cran -t elpa
> gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
> gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
> --8<---------------cut here---------------end--------------->8---
>
> (When ‘-t’ is omitted, all the updaters are used.)
>
> So, I invite you to add an updater for your favorite importer!
> It’s easy and super cool!  :-)

This is awesome!  I will add some updaters when I get a chance.

Thanks!

- Dave

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tracking upstream releases
  2015-10-21 12:54 Tracking upstream releases Ludovic Courtès
  2015-10-21 13:17 ` Thompson, David
@ 2015-10-21 17:03 ` Andreas Enge
  2015-10-22  8:17 ` Alex Kost
  2 siblings, 0 replies; 8+ messages in thread
From: Andreas Enge @ 2015-10-21 17:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Congratulations, this is nice progress!

Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tracking upstream releases
  2015-10-21 12:54 Tracking upstream releases Ludovic Courtès
  2015-10-21 13:17 ` Thompson, David
  2015-10-21 17:03 ` Andreas Enge
@ 2015-10-22  8:17 ` Alex Kost
  2015-10-25 21:42   ` Ludovic Courtès
  2 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-10-22  8:17 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2015-10-21 15:54 +0300) wrote:

> Hello!
>
> We now have a number of importers, which is great, but so far we had no
> support to update packages once they had been imported, even though most
> of the code to do that already is in the importer.
>
> So commit 0a7c5a09 generalizes the upstream-tracking code from (guix
> gnu-maintenance) a bit, such that we can then easily define “updaters”
> based on the import code.  As an example, subsequent commits add an
> updater for ELPA and one for CRAN.  The end result is:
>
>
> $ ./pre-inst-env guix refresh -t cran -t elpa
> gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
> gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
>
> (When ‘-t’ is omitted, all the updaters are used.)

Great!  What about instead of (or along with) "-t cran -t elpa", use a
comma separated list as it is done in "guix lint --checkers=..."?

I think "--foo=one,two" is a general syntax, so it would be good to
support it.  Also this will allow to complete several updaters in a
guix-refresh popup (M-x guix r =t).

-- 
Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tracking upstream releases
  2015-10-22  8:17 ` Alex Kost
@ 2015-10-25 21:42   ` Ludovic Courtès
  2015-10-27 19:00     ` [PATCH] refresh: Support comma separated updater types Alex Kost
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2015-10-25 21:42 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2015-10-21 15:54 +0300) wrote:
>
>> Hello!
>>
>> We now have a number of importers, which is great, but so far we had no
>> support to update packages once they had been imported, even though most
>> of the code to do that already is in the importer.
>>
>> So commit 0a7c5a09 generalizes the upstream-tracking code from (guix
>> gnu-maintenance) a bit, such that we can then easily define “updaters”
>> based on the import code.  As an example, subsequent commits add an
>> updater for ELPA and one for CRAN.  The end result is:
>>
>>
>> $ ./pre-inst-env guix refresh -t cran -t elpa
>> gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
>> gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
>>
>> (When ‘-t’ is omitted, all the updaters are used.)
>
> Great!  What about instead of (or along with) "-t cran -t elpa", use a
> comma separated list as it is done in "guix lint --checkers=..."?

I agree it would be more consistent (I guess I was a bit lazy here…)
Would you like to make this change?  Otherwise I can give it a go.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] refresh: Support comma separated updater types.
  2015-10-25 21:42   ` Ludovic Courtès
@ 2015-10-27 19:00     ` Alex Kost
  2015-10-27 20:18       ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-10-27 19:00 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

Ludovic Courtès (2015-10-26 00:42 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> Ludovic Courtès (2015-10-21 15:54 +0300) wrote:
>>
>>> Hello!
>>>
>>> We now have a number of importers, which is great, but so far we had no
>>> support to update packages once they had been imported, even though most
>>> of the code to do that already is in the importer.
>>>
>>> So commit 0a7c5a09 generalizes the upstream-tracking code from (guix
>>> gnu-maintenance) a bit, such that we can then easily define “updaters”
>>> based on the import code.  As an example, subsequent commits add an
>>> updater for ELPA and one for CRAN.  The end result is:
>>>
>>>
>>> $ ./pre-inst-env guix refresh -t cran -t elpa
>>> gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
>>> gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
>>>
>>> (When ‘-t’ is omitted, all the updaters are used.)
>>
>> Great!  What about instead of (or along with) "-t cran -t elpa", use a
>> comma separated list as it is done in "guix lint --checkers=..."?
>
> I agree it would be more consistent (I guess I was a bit lazy here…)
> Would you like to make this change?  Otherwise I can give it a go.

Yes, I'd like.  The patch is attached, thanks!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-refresh-Support-comma-separated-updater-types.patch --]
[-- Type: text/x-patch, Size: 3263 bytes --]

From 4a5132f171dfe6bac99661e75e7c5e53c4f74116 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Tue, 27 Oct 2015 21:13:05 +0300
Subject: [PATCH] refresh: Support comma separated updater types.

* guix/scripts/refresh.scm (%options): Handle comma separated types for
  '--type' option.
  (guix-refresh): Adjust accordingly.
  (show-help): Likewise.
* doc/guix.texi (Invoking guix refresh): Document it.
---
 doc/guix.texi            |  6 +++---
 guix/scripts/refresh.scm | 14 ++++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1bb7125..6fede5d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4263,8 +4263,8 @@ inconvenient.
 
 @item --type=@var{updater}
 @itemx -t @var{updater}
-Select only packages handled by @var{updater}.  Currently, @var{updater}
-may be one of:
+Select only packages handled by @var{updater} (may be a comma separated
+list of updaters).  Currently, @var{updater} may be one of:
 
 @table @code
 @item gnu
@@ -4279,7 +4279,7 @@ For instance, the following commands only checks for updates of Emacs
 packages hosted at @code{elpa.gnu.org} and updates of CRAN packages:
 
 @example
-$ guix refresh -t elpa -t cran
+$ guix refresh --type=elpa,cran
 gnu/packages/statistics.scm:819:13: r-testthat would be upgraded from 0.10.0 to 0.11.0
 gnu/packages/emacs.scm:856:13: emacs-auctex would be upgraded from 11.88.6 to 11.88.9
 @end example
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index a66b3f9..b2c9db0 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -69,7 +69,8 @@
                             arg)))))
         (option '(#\t "type") #t #f
                 (lambda (opt name arg result)
-                  (alist-cons 'updater (string->symbol arg) result)))
+                  (let ((names (map string->symbol (string-split arg #\,))))
+                    (alist-cons 'updaters names result))))
         (option '(#\L "list-updaters") #f #f
                 (lambda args
                    (list-updaters-and-exit)))
@@ -114,7 +115,8 @@ specified with `--select'.\n"))
   -s, --select=SUBSET    select all the packages in SUBSET, one of
                          `core' or `non-core'"))
   (display (_ "
-  -t, --type=UPDATER     restrict to updates from UPDATER--e.g., 'gnu'"))
+  -t, --type=UPDATER,... restrict to updates from the specified updaters
+                         (e.g., 'gnu')"))
   (display (_ "
   -L, --list-updaters    list available updaters and exit"))
   (display (_ "
@@ -209,15 +211,15 @@ downloaded and authenticated; not updating~%")
   (define (options->updaters opts)
     ;; Return the list of updaters to use.
     (match (filter-map (match-lambda
-                         (('updater . name)
-                          (lookup-updater name))
+                         (('updaters . names)
+                          (map lookup-updater names))
                          (_ #f))
                        opts)
       (()
        ;; Use the default updaters.
        %updaters)
-      (lst
-       lst)))
+      (lists
+       (apply append lists))))
 
   (define (keep-newest package lst)
     ;; If a newer version of PACKAGE is already in LST, return LST; otherwise
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] refresh: Support comma separated updater types.
  2015-10-27 19:00     ` [PATCH] refresh: Support comma separated updater types Alex Kost
@ 2015-10-27 20:18       ` Ludovic Courtès
  2015-10-28 18:54         ` Alex Kost
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2015-10-27 20:18 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> From 4a5132f171dfe6bac99661e75e7c5e53c4f74116 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Tue, 27 Oct 2015 21:13:05 +0300
> Subject: [PATCH] refresh: Support comma separated updater types.
>
> * guix/scripts/refresh.scm (%options): Handle comma separated types for
>   '--type' option.
>   (guix-refresh): Adjust accordingly.
>   (show-help): Likewise.
> * doc/guix.texi (Invoking guix refresh): Document it.

[...]

> +                  (let ((names (map string->symbol (string-split arg #\,))))

I prefer ‘string-tokenize’, which is standard, even though it’s more
verbose.

> +      (lists
> +       (apply append lists))))

Rather: (concatenate lists).

OK with these changes.

Thank you for the quick patch!

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] refresh: Support comma separated updater types.
  2015-10-27 20:18       ` Ludovic Courtès
@ 2015-10-28 18:54         ` Alex Kost
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Kost @ 2015-10-28 18:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2015-10-27 23:18 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> From 4a5132f171dfe6bac99661e75e7c5e53c4f74116 Mon Sep 17 00:00:00 2001
>> From: Alex Kost <alezost@gmail.com>
>> Date: Tue, 27 Oct 2015 21:13:05 +0300
>> Subject: [PATCH] refresh: Support comma separated updater types.
>>
>> * guix/scripts/refresh.scm (%options): Handle comma separated types for
>>   '--type' option.
>>   (guix-refresh): Adjust accordingly.
>>   (show-help): Likewise.
>> * doc/guix.texi (Invoking guix refresh): Document it.
>
> [...]
>
>> +                  (let ((names (map string->symbol (string-split arg #\,))))
>
> I prefer ‘string-tokenize’, which is standard, even though it’s more
> verbose.

OK.  Do you mean that ‘string-split’ is non-standard?  Why?

>> +      (lists
>> +       (apply append lists))))
>
> Rather: (concatenate lists).

Thanks, I didn't know about 'concatenate'.

> OK with these changes.

Thanks, pushed.

-- 
Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-28 18:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 12:54 Tracking upstream releases Ludovic Courtès
2015-10-21 13:17 ` Thompson, David
2015-10-21 17:03 ` Andreas Enge
2015-10-22  8:17 ` Alex Kost
2015-10-25 21:42   ` Ludovic Courtès
2015-10-27 19:00     ` [PATCH] refresh: Support comma separated updater types Alex Kost
2015-10-27 20:18       ` Ludovic Courtès
2015-10-28 18:54         ` Alex Kost

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