From nobody Thu May 18 08:20:37 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QMNFy1Rwkz3bMyb; Thu, 18 May 2023 08:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QMNFy03h7z3L6b; Thu, 18 May 2023 08:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684398038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XYkR+kf7J6180wyBgRl51+LIoMP7U7ZK07lEBuiOj6k=; b=ccQN/C136yvJ7cVzUcDSyX19ixXcwUqOqqmN/1UKQDVeN8ivIajwoNlnseHG0pIotemwID pPvxGGVXPDydEwwIm6J5c27RNANP74b8foCTj14CES7u94LdmXVECR32VCPvm3QKIAIAu5 3BYY3s8+h4tJK54I5i4dby67d8Ty26zyxdrmqw7Ex3WZ/Fwa/5rUo1VLdmBsohrk4cl+8F BmqMlb9rcFCkncnFyqDVuouUA8RcUbV7OGNEBIkWMUNT8FneoM6uo9d7iVZ5F+LAs/Y9gh TJDtXUoJcdDPrDDQFILJC3VcQKS6PxnXXDuu3d2DlQid/UbdoYnM7T5FHIdBkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684398038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XYkR+kf7J6180wyBgRl51+LIoMP7U7ZK07lEBuiOj6k=; b=N2oXn2RGS3/fqNJ999i3OEnVIZRPGllYU/kkHS/mZlwE1B+XaLwEyjeCGuByAms0wVzdiq 4RMqzjuoCPLVyKTSskzylckm0NiqTDd9EQQPcIrbQMOdV9pYlcDmjSojvb4oWIv46X/cqM hzXPEdy7gqQsouBXiNFxKWEFTgKzEPuwRgcSQ0kz1BihfbzVKuNJaamlAQvIvhusMmKM7q 3kXhVVu/WXgN9+6EFAXyua6MuPbOzYDAigsBs9pI85zIgYJ7XwUSh5mVJv7jmNm649/dUP UAFtnwtPNtk+SaqQRe3vfAM2NmNvP1m3/GvQemZicYeEMldsbH9oY7mwlmr3rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684398038; a=rsa-sha256; cv=none; b=ur8gWm5XKwTgOcvx4QCS4UZBCYfOLJVBvxSNjmO3kt0WVcrz069PaB8oZtKG1kK3ccfz5e UGIPATesJgGfOqYRaLIuIh05ZHwcjVI7DMBJDkE+jMm5sOCIinLhagUn8KC2JxVqvrHsO+ xnQZY6yQKC8MDdJb8z35ilXYBTtnxBXyqDQ11kwtacnVuEP/eZmPRgT4CVugl6L2V6KP9C dJMx3GAWdAOPN+G6sUygQXJR7lhW9miHVy8y0tqnqTb9k/9BOpPdBGui5KXD0VTkn0PHJc Q4L27BkQfxplwhbNynks4HP1DGBEohG5t55YuaZjfTOgfBwxo4J1jOVqKNLaSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QMNFx62NZzf9y; Thu, 18 May 2023 08:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34I8Kbwr056579; Thu, 18 May 2023 08:20:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34I8KbmT056578; Thu, 18 May 2023 08:20:37 GMT (envelope-from git) Date: Thu, 18 May 2023 08:20:37 GMT Message-Id: <202305180820.34I8KbmT056578@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: 1a556fa3ec8d - main - sysutils/plocate: Fast & privacy-respecting locate utility List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a556fa3ec8dbea28a7b34b2e9e2f036b0276ad6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=1a556fa3ec8dbea28a7b34b2e9e2f036b0276ad6 commit 1a556fa3ec8dbea28a7b34b2e9e2f036b0276ad6 Author: Stefan `Sec` Zehl AuthorDate: 2023-05-14 08:26:17 +0000 Commit: Robert Clausecker CommitDate: 2023-05-18 08:19:45 +0000 sysutils/plocate: Fast & privacy-respecting locate utility plocate is a locate(1) based on posting lists, completely replacing mlocate with a much faster (and smaller) index. It is suitable as a default locate on your system. Like mlocate and slocate, the returned file set is user-dependent, ie. a user will only see a file if find(1) would list it (all directories from the root have +rx permissions). WWW: https://plocate.sesse.net/ PR: 270657 --- GIDs | 2 +- sysutils/Makefile | 1 + sysutils/plocate/Makefile | 34 +++++ sysutils/plocate/distinfo | 3 + sysutils/plocate/files/315.plocate.in | 32 ++++ sysutils/plocate/files/mntent.h | 62 ++++++++ sysutils/plocate/files/mntent_compat.c++ | 177 +++++++++++++++++++++++ sysutils/plocate/files/patch-conf.cpp | 11 ++ sysutils/plocate/files/patch-io__uring__engine.h | 10 ++ sysutils/plocate/files/patch-meson.build | 56 +++++++ sysutils/plocate/files/patch-updatedb.cpp | 11 ++ sysutils/plocate/files/updatedb.conf.sample | 1 + sysutils/plocate/pkg-descr | 5 + sysutils/plocate/pkg-plist | 9 ++ 14 files changed, 413 insertions(+), 1 deletion(-) diff --git a/GIDs b/GIDs index d6880befb380..141ef8ef9ffd 100644 --- a/GIDs +++ b/GIDs @@ -801,7 +801,7 @@ opensearch:*:855: # free: 857 # free: 858 # free: 859 -# free: 860 +plocate:*:860: # free: 861 # free: 862 # free: 863 diff --git a/sysutils/Makefile b/sysutils/Makefile index da2b7f28b9b5..77f732fd8cf3 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1032,6 +1032,7 @@ SUBDIR += plasma5-powerdevil SUBDIR += plasma5-systemsettings SUBDIR += plconfig + SUBDIR += plocate SUBDIR += pmt SUBDIR += pnscan SUBDIR += podman diff --git a/sysutils/plocate/Makefile b/sysutils/plocate/Makefile new file mode 100644 index 000000000000..034a86cd6954 --- /dev/null +++ b/sysutils/plocate/Makefile @@ -0,0 +1,34 @@ +PORTNAME= plocate +DISTVERSION= 1.1.18 +CATEGORIES= sysutils +MASTER_SITES= https://plocate.sesse.net/download/ + +MAINTAINER= sec@42.org +COMMENT= Fast & privacy-respecting locate utility +WWW= https://plocate.sesse.net/ + +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= meson:devel/meson +LIB_DEPENDS= libzstd.so:archivers/zstd + +USES= meson pkgconfig +MESON_ARGS= --sharedstatedir=/var/db + +SUB_FILES= 315.plocate + +GROUPS= plocate + +post-patch: + ${CP} ${FILESDIR}/mntent_compat.c++ ${FILESDIR}/mntent.h ${WRKSRC} + +post-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKDIR}/315.plocate \ + ${STAGEDIR}${PREFIX}/etc/periodic/daily + ${INSTALL_DATA} ${FILESDIR}/updatedb.conf.sample \ + ${STAGEDIR}${PREFIX}/etc + ${MKDIR} ${STAGEDIR}/var/db/plocate + +.include diff --git a/sysutils/plocate/distinfo b/sysutils/plocate/distinfo new file mode 100644 index 000000000000..9e8a1adee1e9 --- /dev/null +++ b/sysutils/plocate/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1680026625 +SHA256 (plocate-1.1.18.tar.gz) = 939657050b70719b01ce04fc1c8b64270062a0d53da2c72eafbe036a1964e12c +SIZE (plocate-1.1.18.tar.gz) = 73906 diff --git a/sysutils/plocate/files/315.plocate.in b/sysutils/plocate/files/315.plocate.in new file mode 100644 index 000000000000..d02f915ba684 --- /dev/null +++ b/sysutils/plocate/files/315.plocate.in @@ -0,0 +1,32 @@ +#!/bin/sh - +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +case "$daily_plocate_enable" in + [Yy][Ee][Ss]) + echo "" + echo "Rebuilding plocate database:" + + SBINDIR=%%PREFIX%%/sbin + LOCATEGROUP=plocate + DBFILE=/var/db/plocate/plocate.db + + touch $DBFILE && rc=0 || rc=3 + + cd / + nice -n 5 $SBINDIR/updatedb + ;; + + *) rc=0;; +esac + +exit $rc diff --git a/sysutils/plocate/files/mntent.h b/sysutils/plocate/files/mntent.h new file mode 100644 index 000000000000..e61cddd89c82 --- /dev/null +++ b/sysutils/plocate/files/mntent.h @@ -0,0 +1,62 @@ +/* + * mntent + * mntent.h - compatability header for FreeBSD + * + * Copyright (c) 2001 David Rufino + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(HAVE_MNTENT_H) +#include +#else +#ifndef _MNTENT_H +#define _MNTENT_H +#include + +#define MOUNTED "dummy" + +#define MNTTYPE_NFS "nfs" + +struct mntent { + char *mnt_fsname; + char *mnt_dir; + char *mnt_type; + char *mnt_opts; + int mnt_freq; + int mnt_passno; +}; + +#define setmntent(x,y) ((FILE *)0x1) +#ifdef __cplusplus +extern "C" { +#endif +struct mntent *getmntent __P ((FILE *fp)); +char *hasmntopt __P ((const struct mntent *mnt, const char *option)); +#ifdef __cplusplus +}; // extern "C" +#endif +#define endmntent(x) ((int)1) + +#endif /* _MNTENT_H */ +#endif /* HAVE_MNTENT_H */ diff --git a/sysutils/plocate/files/mntent_compat.c++ b/sysutils/plocate/files/mntent_compat.c++ new file mode 100644 index 000000000000..4ca1a55c8ffe --- /dev/null +++ b/sysutils/plocate/files/mntent_compat.c++ @@ -0,0 +1,177 @@ +/* + * Copyright (c) 1980, 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2001 + * David Rufino + * Copyright (c) 2006 + * Stanislav Sedov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* most of this was ripped from the mount(3) source */ + +//#include "config.h" +#include "mntent.h" +#include +#include +#include +#include +#include + +static int pos = -1; +static int mntsize = -1; +static struct mntent _mntent; + +struct { + int m_flag; + const char *m_option; +} mntoptions[] = { + { MNT_ASYNC, "async" }, + { MNT_NOATIME, "noatime"}, + { MNT_NOEXEC, "noexec"}, + { MNT_NOSUID, "nosuid"}, + { MNT_NOSYMFOLLOW, "nosymfollow"}, + { MNT_SYNCHRONOUS, "sync"}, + { MNT_UNION, "union"}, + { MNT_NOCLUSTERR, "noclusterr"}, + { static_cast(MNT_NOCLUSTERW), "noclusterw"}, + { MNT_SUIDDIR, "suiddir"}, +#ifdef MNT_SNAPSHOT + { MNT_SNAPSHOT, "snapshot"}, +#endif +#ifdef MNT_MULTILABEL + { MNT_MULTILABEL, "multilabel"}, +#endif +#ifdef MNT_ACLS + { MNT_ACLS, "acls"}, +#endif +#ifdef MNT_NODEV + { MNT_NODEV, "nodev"}, +#endif +}; + +#define N_OPTS (sizeof(mntoptions) / sizeof(*mntoptions)) + + +extern "C" { + +char * +hasmntopt (const struct mntent *mnt, const char *option) +{ + char *opt, *optbuf; + + optbuf = strdup(mnt->mnt_opts); + for (opt = optbuf; (opt = strtok(opt, " ")) != NULL; opt = NULL) { + if (!strcasecmp(opt, option)) { + opt = opt - optbuf + mnt->mnt_opts; + free (optbuf); + return (opt); + } + } + free (optbuf); + return (NULL); +} + +static char * +catopt (char *s0, const char *s1) +{ + size_t newlen; + char *cp; + + if (s1 == NULL || *s1 == '\0') + return s0; + + if (s0 != NULL) { + newlen = strlen(s0) + strlen(s1) + 1 + 1; + if ((cp = (char *)realloc(s0, newlen)) == NULL) + return (NULL); + + (void)strcat(cp, " "); + (void)strcat(cp, s1); + } else + cp = strdup(s1); + + return (cp); +} + + +static char * +flags2opts (int flags) +{ + char *res = NULL; + int i; + + res = catopt(res, (flags & MNT_RDONLY) ? "ro" : "rw"); + + for (i = 0; i < N_OPTS; i++) + if (flags & mntoptions[i].m_flag) + res = catopt(res, mntoptions[i].m_option); + return res; +} + +static struct mntent * +statfs_to_mntent (struct statfs *mntbuf) +{ + static char opts_buf[40], *tmp; + + _mntent.mnt_fsname = mntbuf->f_mntfromname; + _mntent.mnt_dir = mntbuf->f_mntonname; + _mntent.mnt_type = mntbuf->f_fstypename; + tmp = flags2opts (mntbuf->f_flags); + if (tmp) { + opts_buf[sizeof(opts_buf) - 1] = '\0'; + strncpy (opts_buf, tmp, sizeof(opts_buf)-1); + free (tmp); + } else { + *opts_buf = '\0'; + } + _mntent.mnt_opts = opts_buf; + _mntent.mnt_freq = _mntent.mnt_passno = 0; + return (&_mntent); +} + +struct mntent * +getmntent (FILE *fp) +{ + static struct statfs *mntbuf; + + if (pos == -1 || mntsize == -1) + mntsize = getmntinfo (&mntbuf, MNT_NOWAIT); + + ++pos; + if (pos == mntsize) { + pos = mntsize = -1; + return (NULL); + } + + return (statfs_to_mntent (&mntbuf[pos])); +} + +}; // extern "C" diff --git a/sysutils/plocate/files/patch-conf.cpp b/sysutils/plocate/files/patch-conf.cpp new file mode 100644 index 000000000000..019bf4b1ab96 --- /dev/null +++ b/sysutils/plocate/files/patch-conf.cpp @@ -0,0 +1,11 @@ +--- conf.cpp.orig 2023-05-04 07:34:30 UTC ++++ conf.cpp +@@ -35,6 +35,8 @@ any later version. + #include + #include + ++#define program_invocation_name getprogname() ++ + using namespace std; + + /* true if locate(1) should check whether files are visible before reporting diff --git a/sysutils/plocate/files/patch-io__uring__engine.h b/sysutils/plocate/files/patch-io__uring__engine.h new file mode 100644 index 000000000000..6ae751285cf6 --- /dev/null +++ b/sysutils/plocate/files/patch-io__uring__engine.h @@ -0,0 +1,10 @@ +--- io_uring_engine.h.orig 2023-05-04 07:33:59 UTC ++++ io_uring_engine.h +@@ -7,7 +7,6 @@ + #include + #include + #include +-#include + + struct io_uring_sqe; + #ifndef WITHOUT_URING diff --git a/sysutils/plocate/files/patch-meson.build b/sysutils/plocate/files/patch-meson.build new file mode 100644 index 000000000000..091386cdcfa8 --- /dev/null +++ b/sysutils/plocate/files/patch-meson.build @@ -0,0 +1,56 @@ +--- meson.build.orig 2023-05-04 07:34:20 UTC ++++ meson.build +@@ -1,7 +1,7 @@ + project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.18') + + add_project_arguments('-DGROUPNAME="' + get_option('locategroup') + '"', language: 'cpp') +-add_project_arguments('-DUPDATEDB_CONF="/etc/updatedb.conf"', language: 'cpp') ++add_project_arguments('-DUPDATEDB_CONF= "' + get_option('prefix') + '/etc/updatedb.conf"', language: 'cpp') + dbfile = join_paths(get_option('sharedstatedir'), get_option('dbpath')) + add_project_arguments('-DDBFILE="' + dbfile + '"', language: 'cpp') + add_project_arguments('-DPACKAGE_NAME="plocate"', language: 'cpp') +@@ -30,16 +30,12 @@ if cxx.compiles(code, name: 'function multiversioning' + add_project_arguments('-DHAS_FUNCTION_MULTIVERSIONING', language: 'cpp') + endif + +-executable('plocate', ['plocate.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'parse_trigrams.cpp', 'serializer.cpp', 'access_rx_cache.cpp', 'needle.cpp', 'complete_pread.cpp'], ++executable('plocate', ['plocate.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'parse_trigrams.cpp', 'serializer.cpp', 'access_rx_cache.cpp', 'needle.cpp', 'complete_pread.cpp', 'mntent_compat.c++'], + dependencies: [uringdep, zstddep, threaddep, atomicdep], + install: true, + install_mode: ['rwxr-sr-x', 'root', get_option('locategroup')]) +-executable('plocate-build', ['plocate-build.cpp', 'database-builder.cpp'], +- dependencies: [zstddep], +- install: true, +- install_dir: get_option('sbindir')) + updatedb_progname = get_option('updatedb_progname') +-executable(updatedb_progname, ['updatedb.cpp', 'database-builder.cpp', 'conf.cpp', 'lib.cpp', 'bind-mount.cpp', 'complete_pread.cpp'], ++executable(updatedb_progname, ['updatedb.cpp', 'database-builder.cpp', 'conf.cpp', 'lib.cpp', 'bind-mount.cpp', 'complete_pread.cpp', 'mntent_compat.c++'], + dependencies: [zstddep, threaddep], + install: true, + install_dir: get_option('sbindir')) +@@ -49,7 +45,7 @@ conf_data.set('PROCESSED_BY_MESON', '1') + conf_data.set('sbindir', join_paths(get_option('prefix'), get_option('sbindir'))) + conf_data.set('groupname', get_option('locategroup')) + conf_data.set('dbfile', dbfile) +-conf_data.set('updatedb_conf', '/etc/updatedb.conf') ++conf_data.set('updatedb_conf',get_option('prefix')+'/etc/updatedb.conf') + conf_data.set('updatedb_progname', updatedb_progname) + update_script = configure_file(input: 'update-plocate.sh', + output: 'update-plocate.sh', +@@ -64,7 +60,6 @@ if get_option('install_cron') + rename: 'plocate') + endif + install_man('plocate.1') +-install_man('plocate-build.8') + + updatedb_man = configure_file(input: 'updatedb.8.in', + output: updatedb_progname + '.8', +@@ -102,7 +97,7 @@ if run_command('[', '-r', pfordir + '/libic.a', ']', c + turbopfordep = declare_dependency( + include_directories: include_directories('TurboPFor-Integer-Compression'), + dependencies: meson.get_compiler('cpp').find_library('ic', dirs: pfordir)) +- executable('bench', ['bench.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'complete_pread.cpp'], ++ executable('bench', ['bench.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'complete_pread.cpp', 'mntent_compat.c++'], + dependencies: [uringdep, turbopfordep], + build_by_default: false, + install: false) diff --git a/sysutils/plocate/files/patch-updatedb.cpp b/sysutils/plocate/files/patch-updatedb.cpp new file mode 100644 index 000000000000..65f5b4614d72 --- /dev/null +++ b/sysutils/plocate/files/patch-updatedb.cpp @@ -0,0 +1,11 @@ +--- updatedb.cpp.orig 2023-05-04 07:34:10 UTC ++++ updatedb.cpp +@@ -44,7 +44,7 @@ any later version. + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/sysutils/plocate/files/updatedb.conf.sample b/sysutils/plocate/files/updatedb.conf.sample new file mode 100644 index 000000000000..9bbf44669cd5 --- /dev/null +++ b/sysutils/plocate/files/updatedb.conf.sample @@ -0,0 +1 @@ +PRUNEFS = "devfs fdescfs nullfs procfs linsysfs" diff --git a/sysutils/plocate/pkg-descr b/sysutils/plocate/pkg-descr new file mode 100644 index 000000000000..04e074d87025 --- /dev/null +++ b/sysutils/plocate/pkg-descr @@ -0,0 +1,5 @@ +plocate is a locate(1) based on posting lists, completely replacing mlocate +with a much faster (and smaller) index. It is suitable as a default locate on +your system. Like mlocate and slocate, the returned file set is +user-dependent, ie. a user will only see a file if find(1) would list it (all +directories from the root have +rx permissions). diff --git a/sysutils/plocate/pkg-plist b/sysutils/plocate/pkg-plist new file mode 100644 index 000000000000..f6908d72dba0 --- /dev/null +++ b/sysutils/plocate/pkg-plist @@ -0,0 +1,9 @@ +@(,plocate,2755) bin/plocate +sbin/updatedb +man/man1/plocate.1.gz +man/man8/updatedb.8.gz +man/man5/updatedb.conf.5.gz +etc/periodic/daily/315.plocate +@sample etc/updatedb.conf.sample +@dir /var/db/plocate +/var/db/plocate/CACHEDIR.TAG