guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package graph queries


From: Catonano
Subject: Re: Package graph queries
Date: Thu, 11 Aug 2016 06:37:50 +0200



2016-07-31 0:19 GMT+02:00 Ludovic Courtès <address@hidden>:
Jelle Licht <address@hidden> skribis:

> On Jul 29, 2016 16:53, "Catonano" <address@hidden> wrote:

[...]

>> For example: which are the packages with less or no dependencies (and a
>> lot of dependants) ?
>> Because those should be imported first, in my opinion.

[...]

> ^ This, I like. Does anyone have any suggestions on tools that could help
> me do this in guile?

I understand you want to perform these queries on NPM packages, not Guix
packages, but if you could hook your NPM package representation in (guix
graph)¹, you could do the same as this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix graph)
scheme@(guile-user)> ,use(guix scripts graph)
scheme@(guile-user)> ,use(gnu packages)
scheme@(guile-user)> ,use(guix monad-repl)
scheme@(guile-user)> ,enter-store-monad
store-monad@(guile-user) [1]> (node-back-edges %bag-node-type (fold-packages cons '()))
$4 = #<procedure 59ac880 at guix/graph.scm:87:17 (node)>
store-monad@(guile-user) [1]> ,q
scheme@(guile-user)> ,use(srfi srfi-1)
scheme@(guile-user)> (filter (lambda (p)
                               (> (node-reachable-count (list p) $4)
                                  600))
                             (fold-packages cons '()))

My concern, here, would be an equivalent of "fold-packages" for registry.npmjs.com.

The API seems a bit cloudy to me.
 
See this question
https://stackoverflow.com/questions/34071621/query-npmjs-registry-via-api



reply via email to

[Prev in Thread] Current Thread [Next in Thread]