Hi! zimoun <zimon.touto...@gmail.com> skribis:
> (define %prefix-url > "https://data.guix-patches.cbaines.net/revision") > > (define %suffix-url > "output_consistency=not-matching&target=none&all_results=on") > > (define %json-name "package-derivation-outputs.json") > > > (define* (json-url revision > #:optional > (system (%current-system)) > (json %json-name)) > "Return the URL corresponding to REVISION." > (string-append > %prefix-url "/" revision "/" json "?" %suffix-url"&system=" system)) > > (define* (json-file revision > #:optional > (system (%current-system)) > (name %json-name) > (tmp %temporary-directory)) > "Path where the JSON is stored. > > By default in %TEMPORARY-DIRECTORY/REV-%JSON-NAME." > (let ((hash (substring revision 0 6))) > (string-append tmp "/" hash "-" name "-" system))) > > (define (fetch-json revision system) > "Fetch the JSON file from the Data Service corresponding to REVISION. > > Store the result in %TEMPORARY-DIRECTORY." > (let* ((out (json-file revision system)) > (url (json-url revision system))) > (url-fetch url out))) I think it’s a good idea. My suggestion would be to do as for (guix ci): make a (guix data-service-client) (?) module that contains proper bindings to a subset of the Data Service APIs, using ‘define-json-mapping’. Once we have that, we can consider using it in ‘guix weather’ or in new tools such as the proposed ‘guix git log’. Ludo’.