all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Nikita Karetnikov <nikita.karetnikov@gmail.com>
Cc: bug-guix@gnu.org
Subject: Re: [PATCH] Add (guix gnu-maintenance).
Date: Tue, 04 Dec 2012 19:42:02 +0100	[thread overview]
Message-ID: <874nk1vev9.fsf@inria.fr> (raw)
In-Reply-To: CAD15K4vBw7UixSbkAvK3vtoeqTte3hb0mvyP9SOxwesjc5-WOw@mail.gmail.com

Hi,

Nikita Karetnikov <nikita.karetnikov@gmail.com> skribis:

> +(define (http-fetch str)
> +  "Fetch a file from STR, which should be a URI."

Rather:

  (define (http-fetch uri)
    "Return a string containing the textual data at URI, a string."
    ...)

> +       (error "download failed:" str code
> +              (string-downcase (response-reason-phrase resp)))))))

Please remove ‘string-downcase’.

> +(define %womb

Rather ‘%package-list-url’.

> +  (string-append "http://cvs.savannah.gnu.org/"
> +                 "viewvc/*checkout*/gnumaint/"
> +                 "gnupackages.txt?root=womb"))
> +
> +(define-public (gnu-packages-womb)

What about ‘official-gnu-packages’ instead?  Seems more descriptive to me.

Also, please use #:export instead of ‘define-public’ (I try to avoid the
latter, and use it only in (distro packages ...) where it matters to
increase locality.)

> +  "Return a list of GNU packages."

  "Return the list of system identifiers of official GNU packages."

> +  (let ((lst (string-split (http-fetch %womb) #\nl)))
> +    (map (cut string-drop <> 9)
> +         (rx-filter lst (make-regexp "^package: (.+)$")))))

Rather:

  (define %package-line-rx
    (make-regexp "^package: (.+)$"))

  (let ((lst (string-split (http-fetch %package-list-url) #\nl)))
    (filter-map (lambda (line)
                  (and=> (regexp-exec %package-line-rx line)
                         (cut match:substring <> 1)))
                lst)

Can you post an updated patch?

Thanks,
Ludo’.

  reply	other threads:[~2012-12-04 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04  2:58 [PATCH] Add (guix gnu-maintenance) Nikita Karetnikov
2012-12-04  3:15 ` Nikita Karetnikov
2012-12-04 18:42   ` Ludovic Courtès [this message]
2012-12-04 23:15     ` Nikita Karetnikov
2012-12-05 13:59       ` 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

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

  git send-email \
    --in-reply-to=874nk1vev9.fsf@inria.fr \
    --to=ludo@gnu.org \
    --cc=bug-guix@gnu.org \
    --cc=nikita.karetnikov@gmail.com \
    /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.