summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-01-29 21:51:44 +0000
committerArun Isaac2023-01-29 22:35:53 +0000
commitd2680d358df6666b4b821662e1740d9668df29af (patch)
tree9945c3e9b2ab72c7f13c7533bbfdfbebcefb1bf3
parentb1f7b54fece789a2abcda356c7c2bca23a7100f1 (diff)
downloadtissue-d2680d358df6666b4b821662e1740d9668df29af.tar.gz
tissue-d2680d358df6666b4b821662e1740d9668df29af.tar.lz
tissue-d2680d358df6666b4b821662e1740d9668df29af.zip
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.
-rwxr-xr-xbin/tissue11
1 files changed, 7 insertions, 4 deletions
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)