]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
update docs + tests for xapian-delve use
authorEric Wong <e@80x24.org>
Fri, 8 Sep 2023 13:09:05 +0000 (13:09 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Sep 2023 20:43:20 +0000 (20:43 +0000)
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.

Documentation/txt2pre
INSTALL
ci/deps.perl
t/cindex.t

index 62175f3438bd26f266343b26c6350a90af15fa9e..c258a90e1f7f8fff12c4b281d3e05a77a8b927b0 100755 (executable)
@@ -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 2e1c7ef7bb0a6aa2ab3d4017917c1c259e6cc25f..617801cc97909cab886af60d709f6e1117453b47 100644 (file)
--- 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)
index ae85986d622f87bd30563fc168f41fd128f3543d..942660297fbd482e8e663ef9f678367aec68bd78 100755 (executable)
@@ -1,10 +1,10 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 # 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', # ???
        },
index eca6cda2ada700f0b4ed017f8a6c047eb358292f..9f57bd83b2d0884bfddda7d5576059bfaaa8f564 100644 (file)
@@ -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;