Synthesise _SEARCHABLE-TEXT_ for locally-modified packages on demand

This commit is contained in:
Tony Garnock-Jones 2016-12-19 10:49:07 +13:00
parent 8bc1be2862
commit fe20d9cccd

View File

@ -281,7 +281,11 @@
(define ((package-text-matches? pkg) re)
(and (not (tombstone? pkg))
(regexp-match? re (@ pkg _SEARCHABLE-TEXT_))))
(regexp-match? re (or (@ pkg _SEARCHABLE-TEXT_)
;; Packages lacking the _SEARCHABLE-TEXT_ key are _LOCALLY_MODIFIED_.
;; Synthesise searchable text here; a better (?) alternative would be
;; to do this at package save time, but this will do for now.
(pkg->searchable-text pkg)))))
(define (package-search text tags)
(define res (map (lambda (r) (regexp (regexp-quote r #f))) (string-split text)))