Permit fetching of the local-packages table (for debugging)

This commit is contained in:
Tony Garnock-Jones 2014-11-10 14:03:41 -05:00
parent 2aac35df7b
commit 2cb428a484
2 changed files with 11 additions and 1 deletions

View File

@ -11,7 +11,8 @@
replace-package!
delete-package!
refresh-packages!
next-fetch-deadline)
next-fetch-deadline
packages-jsexpr)
(require json)
(require racket/set)
@ -243,3 +244,6 @@
#:when (and (not (tombstone? pkg))
((if include? values not) (@ref (@ pkg search-terms) tag-name))))
(values package-name pkg)))))))
(define (packages-jsexpr)
(manager-rpc 'packages))

View File

@ -55,6 +55,7 @@
[("json" "search-completions") json-search-completions]
[("json" "tag-search-completions") json-tag-search-completions]
[("json" "formal-tags") json-formal-tags]
[("pkgs-all.json") pkgs-all-json]
))
(define (on-continuation-expiry request)
@ -1111,3 +1112,8 @@
(response/output #:mime-type #"application/json"
(lambda (response-port)
(write-json (set->list (all-formal-tags)) response-port))))
(define (pkgs-all-json request)
(response/output #:mime-type #"application/json"
(lambda (response-port)
(write-json (packages-jsexpr) response-port))))