From: Eric Wong Date: Fri, 8 Sep 2023 13:09:05 +0000 (+0000) Subject: update docs + tests for xapian-delve use X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97f1ee0a38966eaeddf78577d1ba8d75afb951ab;p=thirdparty%2Fpublic-inbox.git update docs + tests for xapian-delve use Since -cindex uses the xapian-delve(1) command for `--prune' functionality, we'll rename our `xapian-compact' dependency to the Debian package name (xapian-tools) since `xapian-delve' is in the same package. --- diff --git a/Documentation/txt2pre b/Documentation/txt2pre index 62175f343..c258a90e1 100755 --- a/Documentation/txt2pre +++ b/Documentation/txt2pre @@ -147,6 +147,8 @@ $xurls{'copydatabase(1)'} = 'https://manpages.debian.org/stable/xapian-tools/copydatabase.1.en.html'; $xurls{'xapian-compact(1)'} = 'https://manpages.debian.org/stable/xapian-tools/xapian-compact.1.en.html'; +$xurls{'xapian-delve(1)'} = + 'https://manpages.debian.org/stable/xapian-tools/xapian-delve.1.en.html'; $xurls{'gzip(1)'} = 'https://manpages.debian.org/stable/gzip/gzip.1.en.html'; $xurls{'chmod(1)'} = 'https://manpages.debian.org/stable/coreutils/chmod.1.en.html'; diff --git a/INSTALL b/INSTALL index 2e1c7ef7b..617801cc9 100644 --- a/INSTALL +++ b/INSTALL @@ -111,10 +111,11 @@ Numerous optional modules are likely to be useful as well: * highlight deb: libhighlight-perl (for syntax highlighting with coderepo) -* xapian-compact (tool) deb: xapian-tools +* xapian-tools deb: xapian-tools pkg: xapian-core rpm: xapian-core - (only for public-inbox-compact(1)) + (for public-inbox-compact(1) and + public-inbox-cindex(1)) * curl (tool) deb, pkg, rpm: curl (for HTTP(S) externals with curl) diff --git a/ci/deps.perl b/ci/deps.perl index ae85986d6..942660297 100755 --- a/ci/deps.perl +++ b/ci/deps.perl @@ -1,10 +1,10 @@ #!/usr/bin/perl -w -# Copyright (C) 2019-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # Helper script for installing/uninstalling packages for CI use # Intended for use on non-production chroots or VMs since it # changes installed packages -use strict; +use v5.12; my $usage = "$0 PKG_FMT PROFILE [PROFILE_MOD]"; my $pkg_fmt = shift; @ARGV or die $usage, "\n"; @@ -38,7 +38,7 @@ my $profiles = { Search::Xapian Socket6 highlight.pm - xapian-compact + xapian-tools ) ], # optional developer stuff @@ -119,9 +119,9 @@ my $non_auto = { rpm => [], }, - # we call xapian-compact(1) in public-inbox-compact(1) - 'xapian-compact' => { - deb => 'xapian-tools', + # we call xapian-compact(1) in public-inbox-compact(1) and + # xapian-delve(1) in public-inbox-cindex(1) + 'xapian-tools' => { pkg => 'xapian-core', rpm => 'xapian-core', # ??? }, diff --git a/t/cindex.t b/t/cindex.t index eca6cda2a..9f57bd83b 100644 --- a/t/cindex.t +++ b/t/cindex.t @@ -79,7 +79,7 @@ ok(run_script([qw(-cindex -L medium --dangerous -q -d), SKIP: { - have_xapian_compact; + have_xapian_compact 2; ok(run_script([qw(-compact -q), "$tmp/ext"]), 'compact on full'); ok(run_script([qw(-compact -q), "$tmp/med"]), 'compact on medium'); } @@ -159,7 +159,8 @@ EOM is(scalar($mset->items), 1, 'same result after reindex'); } -if ('--prune') { +SKIP: { # --prune + require_cmd($ENV{XAPIAN_DELVE} || 'xapian-delve', 1); my $csrch = PublicInbox::CodeSearch->new("$tmp/ext"); is(scalar($csrch->mset('s:hi')->items), 1, 'got hit'); @@ -188,7 +189,12 @@ ok(run_script([qw(-cindex --dangerous -q -d), "$tmp/ext", $zp]), ok(run_script([qw(-xcpdb), "$tmp/ext"]), 'xcpdb upgrade'); ok(run_script([qw(-xcpdb -R4), "$tmp/ext"]), 'xcpdb reshard'); -ok(run_script([qw(-xcpdb -R2 --compact), "$tmp/ext"]), 'xcpdb reshard+compact'); -ok(run_script([qw(-xcpdb --compact), "$tmp/ext"]), 'xcpdb compact'); + +SKIP: { + have_xapian_compact 2; + ok(run_script([qw(-xcpdb -R2 --compact), "$tmp/ext"]), + 'xcpdb reshard+compact'); + ok(run_script([qw(-xcpdb --compact), "$tmp/ext"]), 'xcpdb compact'); +}; done_testing;