about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-08 13:09:05 +0000
committerEric Wong <e@80x24.org>2023-09-08 20:43:20 +0000
commit97f1ee0a38966eaeddf78577d1ba8d75afb951ab (patch)
treea7617456b1b9056009d40c4ed6604ff0410a0e45
parent7a0f5c42a8e22a01c076ef38204d3ee9fa8b3af2 (diff)
downloadpublic-inbox-97f1ee0a38966eaeddf78577d1ba8d75afb951ab.tar.gz
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.
-rwxr-xr-xDocumentation/txt2pre2
-rw-r--r--INSTALL5
-rwxr-xr-xci/deps.perl12
-rw-r--r--t/cindex.t14
4 files changed, 21 insertions, 12 deletions
diff --git a/Documentation/txt2pre b/Documentation/txt2pre
index 62175f34..c258a90e 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 2e1c7ef7..617801cc 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 ae85986d..94266029 100755
--- a/ci/deps.perl
+++ b/ci/deps.perl
@@ -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', # ???
         },
diff --git a/t/cindex.t b/t/cindex.t
index eca6cda2..9f57bd83 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;