diff options
author | Daniel M. Capella <polyzen@archlinux.org> | 2024-03-10 15:40:55 -0400 |
---|---|---|
committer | Daniel M. Capella <polyzen@archlinux.org> | 2024-03-10 15:45:05 -0400 |
commit | adf429619344daff68c2b4edb94f6997ce8956b1 (patch) | |
tree | 1fc835f2e3748cf03231e1475ee12bf133237b75 | |
parent | b0558b92e70b76041c81a6bf1ddbbaf99404225a (diff) |
pacdiff: Restore behavior for mlocate
Presuming splitting mlocate calls into multiple invocations slows it
down.
-rw-r--r-- | src/checkupdates.sh.in | 2 | ||||
-rw-r--r-- | src/pacdiff.sh.in | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in index d8ac4cf..f5f4581 100644 --- a/src/checkupdates.sh.in +++ b/src/checkupdates.sh.in @@ -126,7 +126,7 @@ else unset ALL_OFF BOLD BLUE GREEN RED YELLOW fi -if ! type -P fakeroot >/dev/null; then +if ! type -p fakeroot >/dev/null; then die 'Cannot find the fakeroot binary' fi diff --git a/src/pacdiff.sh.in b/src/pacdiff.sh.in index d19975d..8a39e1b 100644 --- a/src/pacdiff.sh.in +++ b/src/pacdiff.sh.in @@ -215,10 +215,14 @@ merge_file() { cmd() { if (( USE_LOCATE )); then - # GL-125: We call locate separately for each pattern for compatibility with plocate. - for p in \*.pacnew \*.pacorig \*.pacsave '*.pacsave.[0-9]*'; do - locate -0 -e -b "$p" - done + # plocate searches for files that match all patterns whereas mlocate searches for files that match one or more patterns + if type -p plocate >/dev/null; then + for p in \*.pacnew \*.pacorig \*.pacsave '*.pacsave.[0-9]*'; do + locate -0 -e -b "$p" + done + else + locate -0 -e -b \*.pacnew \*.pacorig \*.pacsave '*.pacsave.[0-9]*' + fi elif (( USE_FIND )); then find "$diffsearchpath" \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave -o -name '*.pacsave.[0-9]*' \) -print0 elif (( USE_PACDB )); then |