From 13e237a06e6c521afb72019c71c76ab8655184cf Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 22 Sep 2017 21:02:40 +0200 Subject: [PATCH] mlocate: Make it work on Android 7.0 (fixes #1454) --- packages/mlocate/build.sh | 2 +- packages/mlocate/src-locate.c.patch | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/mlocate/src-locate.c.patch diff --git a/packages/mlocate/build.sh b/packages/mlocate/build.sh index 13b6001b2..5c47a883c 100644 --- a/packages/mlocate/build.sh +++ b/packages/mlocate/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://pagure.io/mlocate TERMUX_PKG_DESCRIPTION="Tool to find files anywhere in the filesystem based on their name" TERMUX_PKG_VERSION=0.26 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://releases.pagure.org/mlocate/mlocate-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=3063df79fe198fb9618e180c54baf3105b33d88fe602ff2d8570aaf944f1263e diff --git a/packages/mlocate/src-locate.c.patch b/packages/mlocate/src-locate.c.patch new file mode 100644 index 000000000..a796482ba --- /dev/null +++ b/packages/mlocate/src-locate.c.patch @@ -0,0 +1,18 @@ +Do not fail if "/" is not accessible - which it is not on Android starting +with Android 7.0. + +diff -u -r ../mlocate-0.26/src/locate.c ./src/locate.c +--- ../mlocate-0.26/src/locate.c 2012-09-22 03:48:54.000000000 +0200 ++++ ./src/locate.c 2017-09-22 20:57:44.062275402 +0200 +@@ -1026,11 +1027,6 @@ + uc_obstack_mark = obstack_alloc (&uc_obstack, 0); + obstack_init (&check_stack_obstack); + res = EXIT_FAILURE; +- /* Don't call access ("/", R_OK | X_OK) all the time. This is too strict, +- it is possible to have "/" --x and have a database describing a +- subdirectory, but that is just too improbable. */ +- if (conf_statistics == false && access ("/", R_OK | X_OK) != 0) +- goto done; + for (i = 0; i < conf_dbpath.len; i++) + { + if (conf_output_limit_set != false && matches_found >= conf_output_limit)