mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-25 06:07:38 +00:00
Fixed issue with mlocate. Now tomb accepts also plocate for search/index.
This commit is contained in:
parent
4d72a2180a
commit
59d7331cb0
14
tomb
14
tomb
@ -2813,13 +2813,13 @@ BEGIN { }
|
|||||||
# $1 is optional, to specify a tomb
|
# $1 is optional, to specify a tomb
|
||||||
index_tombs() {
|
index_tombs() {
|
||||||
{ command -v updatedb 1>/dev/null 2>/dev/null } || {
|
{ command -v updatedb 1>/dev/null 2>/dev/null } || {
|
||||||
_failure "Cannot index tombs on this system: updatedb (mlocate) not installed." }
|
_failure "Cannot index tombs on this system: updatedb (mlocate/plocate) not installed." }
|
||||||
|
|
||||||
updatedbver=`updatedb --version | grep '^updatedb'`
|
updatedbver=`updatedb --version | grep '^updatedb'`
|
||||||
[[ "$updatedbver" =~ "GNU findutils" ]] && {
|
[[ "$updatedbver" =~ "GNU findutils" ]] && {
|
||||||
_warning "Cannot use GNU findutils for index/search commands." }
|
_warning "Cannot use GNU findutils for index/search commands." }
|
||||||
[[ "$updatedbver" =~ "mlocate" ]] || {
|
[[ "$updatedbver" =~ "locate" ]] || {
|
||||||
_failure "Index command needs 'mlocate' to be installed." }
|
_failure "Index command needs 'mlocate/plocate' to be installed." }
|
||||||
|
|
||||||
_verbose "$updatedbver"
|
_verbose "$updatedbver"
|
||||||
|
|
||||||
@ -2930,13 +2930,13 @@ EOF
|
|||||||
|
|
||||||
search_tombs() {
|
search_tombs() {
|
||||||
{ command -v locate 1>/dev/null 2>/dev/null } || {
|
{ command -v locate 1>/dev/null 2>/dev/null } || {
|
||||||
_failure "Cannot index tombs on this system: updatedb (mlocate) not installed." }
|
_failure "Cannot index tombs on this system: updatedb (mlocate/plocate) not installed." }
|
||||||
|
|
||||||
updatedbver=`updatedb --version | grep '^updatedb'`
|
updatedbver=`updatedb --version | grep '^updatedb'`
|
||||||
[[ "$updatedbver" =~ "GNU findutils" ]] && {
|
[[ "$updatedbver" =~ "GNU findutils" ]] && {
|
||||||
_warning "Cannot use GNU findutils for index/search commands." }
|
_warning "Cannot use GNU findutils for index/search commands." }
|
||||||
[[ "$updatedbver" =~ "mlocate" ]] || {
|
[[ "$updatedbver" =~ "locate" ]] || {
|
||||||
_failure "Index command needs 'mlocate' to be installed." }
|
_failure "Index command needs 'mlocate/plocate' to be installed." }
|
||||||
|
|
||||||
_verbose "$updatedbver"
|
_verbose "$updatedbver"
|
||||||
|
|
||||||
@ -2952,7 +2952,7 @@ search_tombs() {
|
|||||||
tombname=${t[(ws:;:)5]}
|
tombname=${t[(ws:;:)5]}
|
||||||
tombmount="${t[(ws:;:)2]}"
|
tombmount="${t[(ws:;:)2]}"
|
||||||
[[ -r "${tombmount}/.updatedb" ]] && {
|
[[ -r "${tombmount}/.updatedb" ]] && {
|
||||||
# Use mlocate to search hits on filenames
|
# Use mlocate/plocate to search hits on filenames
|
||||||
_message "Searching filenames in tomb ::1 tomb name::" $tombname
|
_message "Searching filenames in tomb ::1 tomb name::" $tombname
|
||||||
locate -d "${tombmount}/.updatedb" -e -i "${(f)@}"
|
locate -d "${tombmount}/.updatedb" -e -i "${(f)@}"
|
||||||
_message "Matches found: ::1 matches::" \
|
_message "Matches found: ::1 matches::" \
|
||||||
|
Loading…
Reference in New Issue
Block a user