Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

nerun
Copy link
Contributor

@nerun nerun commented Jun 26, 2023

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
Copy link
Member

jaromil commented Jun 27, 2023

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
Copy link
Contributor Author

nerun commented Jun 27, 2023

@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 added a commit to nerun/Tomb that referenced this pull request Jun 27, 2023
(2) Created a README file to clear up some confused issues about versioning;
(3) Updated 'es', 'fr', 'it' and 'ru.po' to line up help message (PR dyne#481 and
Jaromil request in PR dyne#483);
(4) Added Brazilian Portuguese translation (for Tomb 2.3 and 2.10);
(5) Created new tomb.pot template based upon Tomb 2.10 (current);
nerun added a commit to nerun/Tomb that referenced this pull request Jun 27, 2023
@nerun nerun mentioned this pull request Jun 27, 2023
@nerun
Copy link
Contributor Author

nerun commented Jun 27, 2023

I suggest merge this PR after merge PR #486.

@jaromil jaromil merged commit 59d7331 into dyne:master Jun 27, 2023
@nerun nerun deleted the mlocate branch June 27, 2023 21:02
jaromil pushed a commit that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants