From d2680d358df6666b4b821662e1740d9668df29af Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 29 Jan 2023 21:51:44 +0000 Subject: bin: Pass list of indexed documents explicitly to index function. * bin/tissue (index): Accept list of indexed documents as an argument instead of implicitly accessing it by loading the config. (pull, main): Pass list of indexed documents to index. --- bin/tissue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/tissue b/bin/tissue index 606e36d..7d1c4e9 100755 --- a/bin/tissue +++ b/bin/tissue @@ -335,7 +335,7 @@ To get usage information for one of these sub-commands, run (command-line-program) (command-line-program))) -(define (index db-path) +(define (index db-path indexed-documents) "Index current repository into xapian database at DB-PATH." (guard (c (else (delete-file-recursively db-path) (format (current-error-port) @@ -348,7 +348,7 @@ To get usage information for one of these sub-commands, run (replace-document! db (document-id-term document) (TermGenerator-get-document (document-term-generator document)))) - (tissue-configuration-indexed-documents (load-config))) + indexed-documents) (WritableDatabase-set-metadata db "commit" (oid->string (reference-name->oid (current-git-repository) "HEAD"))))))) @@ -417,7 +417,9 @@ HOSTNAME." (mkdir "xapian")) (let ((xapian-directory (canonicalize-path "xapian"))) (call-with-current-directory temporary-repository-clone - (cut index xapian-directory)) + (cut index + xapian-directory + (tissue-configuration-indexed-documents config))) (format (current-error-port) "Indexed latest changes.~%")) ;; Build website. @@ -516,7 +518,8 @@ Pull latest from upstream repositories. (string=? (call-with-database %xapian-index (cut Database-get-metadata <> "commit")) current-head)) - (index %xapian-index))) + (index %xapian-index + (tissue-configuration-indexed-documents config)))) ;; Handle sub-command. (apply (match command ("search" tissue-search) -- cgit v1.2.3