mlocate: Make it work on Android 7.0 (fixes #1454)
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 22 Sep 2017 19:02:40 +0000 (21:02 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 22 Sep 2017 19:02:40 +0000 (21:02 +0200)
packages/mlocate/build.sh
packages/mlocate/src-locate.c.patch [new file with mode: 0644]

index 13b6001..5c47a88 100644 (file)
@@ -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 (file)
index 0000000..a796482
--- /dev/null
@@ -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)