dyne / tomb

the Crypto Undertaker
https://dyne.org/software/tomb
GNU General Public License v3.0
1.32k stars 151 forks source link

Tomb accepts also plocate for search/index (not only mlocate) #483

Closed nerun closed 1 year ago

nerun commented 1 year ago

Related issue: #464

The problem

Tomb is an old tool and uses mlocate for searching/indexing. But modern systems have replaced mlocate with plocate. On these systems (such as Linux Mint 21.1 and Ubuntu 22.04) the tomb index or tomb search commands are broken, user receives message:

Index command needs 'mlocate' to be installed.

To fix this issue i have changed lines with:

[[ "$updatedbver" =~ "mlocate" ]] || {
    _failure "Index command needs 'mlocate' to be installed." }

To:

[[ "$updatedbver" =~ "locate" ]] || {
    _failure "Index command needs 'mlocate/plocate' to be installed." }

Now both systems (with mlocate or plocate) works fine.

Difference between mlocate and plocate

plocate is backwards-compatible with mlocate, and is much faster and more efficient than mlocate.

In fact you don’t have a choice between mlocate and plocate in Ubuntu 22.04: if you install the former, you’ll end up with the latter anyway, because mlocate is a transitional package which pulls in plocate.

Source: Difference between mlocate and plocate

jaromil commented 1 year ago

Hi nerun!

I see this PR just changes error messages, which is OK if we can be sure to rely on distros to keep aliasing executables as locate/updatedb.

One request before merging, which should be easy to do: can you please also update the .po translations with this detail? so we keep them aligned.

thanks!

nerun commented 1 year ago

@jaromil , about PO files, no problem! But could you help me with issue #482 ? It's related to translations and PO files.

This PR specifically doesn't just fix error messages. Index/search commands don't work in Linux Mint (and probably Ubuntu 22.04). Precisely because of the mlocate problem. These commands specifically look for mlocate, when they don't find it they don't work and return the error message. What this PR does is tell the index/search commands to look for mlocate OR plocate. And then everything works on Linux Mint/Ubuntu (current versions).

nerun commented 1 year ago

I suggest merge this PR after merge PR #486.