public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/plocate/files/, sys-apps/plocate/
@ 2021-03-20  5:43 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2021-03-20  5:43 UTC (permalink / raw
  To: gentoo-commits

commit:     fb791526ce7bc605f666b2e833962fafaaa317fd
Author:     Jeffrey Lin <jeffrey <AT> icurse <DOT> nl>
AuthorDate: Fri Mar  5 15:31:54 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 20 05:33:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb791526

sys-apps/plocate: new package

Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Jeffrey Lin <jeffrey <AT> icurse.nl>
Closes: https://github.com/gentoo/gentoo/pull/19786
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/plocate/Manifest                          |  1 +
 .../files/plocate-1.1.5-no-systemd-check.patch     | 21 ++++++
 sys-apps/plocate/files/plocate-cron.conf           |  9 +++
 sys-apps/plocate/files/plocate.cron                | 51 ++++++++++++++
 sys-apps/plocate/files/updatedb.conf               | 16 +++++
 sys-apps/plocate/metadata.xml                      | 33 ++++++++++
 sys-apps/plocate/plocate-1.1.5.ebuild              | 77 ++++++++++++++++++++++
 7 files changed, 208 insertions(+)

diff --git a/sys-apps/plocate/Manifest b/sys-apps/plocate/Manifest
new file mode 100644
index 00000000000..17237dc8ed4
--- /dev/null
+++ b/sys-apps/plocate/Manifest
@@ -0,0 +1 @@
+DIST plocate-1.1.5.tar.gz 69090 BLAKE2B 70b398eb1a5d7b36294188966ef5f46843d9db9f41021a294d88795944412b4ef3819771082955a74a9945296fa14c59461a4ab4af197691f7085a40eeb7f0ef SHA512 6169ea7b3587e12e555a42e0c70e149626810f5e6f9f1f03ca1b069d7892d45bc52cabf072324eaa6f14055943dd680a71642914c0218a770e2b00a22c75efbc

diff --git a/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
new file mode 100644
index 00000000000..b54eda0ec38
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.5-no-systemd-check.patch
@@ -0,0 +1,21 @@
+diff -aur a/meson.build b/meson.build
+--- a/meson.build	2021-03-05 16:35:00.411781507 -0500
++++ b/meson.build	2021-03-05 16:35:41.641782317 -0500
+@@ -76,17 +76,9 @@
+                configuration: conf_data)
+ install_man(updatedb_conf_man)
+
+-if get_option('install_systemd')
+-	systemd = dependency('systemd', required: false)
+-	if systemd.found()
+-		unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+		updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
+		       output: 'plocate-updatedb.service',
+		       configuration: conf_data)
+-		install_data(updatedb_service, install_dir: unitdir)
+-		install_data('plocate-updatedb.timer', install_dir: unitdir)
+-	endif
+-endif
+
+ # Requires having TurboPFor checked out, so not built by default.
+ # Unless you have a recent Meson, there's no apparently good way

diff --git a/sys-apps/plocate/files/plocate-cron.conf b/sys-apps/plocate/files/plocate-cron.conf
new file mode 100644
index 00000000000..f207344a9e6
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-cron.conf
@@ -0,0 +1,9 @@
+# nice value to run at: see -n in nice(1)
+NICE="19"
+
+# ionice class to run at: see -c in ionice(1)
+# you have to install sys-apps/util-linux manually
+IONICE_CLASS="2"
+
+# ionice priority to run at: see -n in ionice(1)
+IONICE_PRIORITY="7"

diff --git a/sys-apps/plocate/files/plocate.cron b/sys-apps/plocate/files/plocate.cron
new file mode 100644
index 00000000000..ebcfcbffe7b
--- /dev/null
+++ b/sys-apps/plocate/files/plocate.cron
@@ -0,0 +1,51 @@
+#! /bin/sh
+set -e
+
+# check if we run on battery and if so then don't run
+if which on_ac_power >/dev/null 2>&1; then
+	ON_BATTERY=0
+	on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
+	if [ "${ON_BATTERY}" -eq 1 ]; then
+			exit 0
+	fi
+fi
+
+# check if we are already running (lockfile)
+LOCKFILE="/var/lock/plocate.daily.lock"
+if [ -e "${LOCKFILE}" ]; then
+	echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb."
+	exit 1
+fi
+touch "${LOCKFILE}"
+# trap the lockfile only if we really run the updatedb
+trap "rm -f ${LOCKFILE}" EXIT
+
+# source the user specified variables
+if [ -f /etc/plocate-cron.conf ]; then
+	. /etc/plocate-cron.conf
+fi
+
+# check the config file
+NODEVS=""
+if [ ! -f /etc/updatedb.conf ]; then
+	NODEVS=$(awk '$1 == "nodev" && $2 != "rootfs" { print $2 }' /proc/filesystems)
+fi
+
+# alter the priority of the updatedb process
+if [ -x /usr/bin/renice ]; then
+	/usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1
+fi
+if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then
+	/usr/bin/ionice -c${IONICE_CLASS:-2} -n${IONICE_PRIORITY:-7} -p $$ > /dev/null 2>&1
+fi
+
+# Cleanup old temp files from previous unsuccessful runs
+rm -f /var/lib/plocate/plocate.db.*
+
+# run the updatedb if possible
+if [ -x /usr/sbin/updatedb ]; then
+	/usr/sbin/updatedb -f "${NODEVS}"
+else
+	echo >&2 "Warning: \"/usr/sbin/updatedb\" is not executable, unable to run updatedb."
+	exit 0
+fi

diff --git a/sys-apps/plocate/files/updatedb.conf b/sys-apps/plocate/files/updatedb.conf
new file mode 100644
index 00000000000..6a00d3aa2b9
--- /dev/null
+++ b/sys-apps/plocate/files/updatedb.conf
@@ -0,0 +1,16 @@
+# /etc/updatedb.conf: config file for slocate
+
+# This file sets variables that are used by updatedb.
+# For more info, see the updatedb.conf(5) manpage.
+
+# Filesystems that are pruned from updatedb database
+PRUNEFS="afs anon_inodefs auto autofs bdev binfmt binfmt_misc cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmpfs ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"
+
+# Paths which are pruned from updatedb database
+PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool"
+
+# Folder names that are pruned from updatedb database
+PRUNENAMES=".git .hg .svn CVS"
+
+# Skip bind mounts.
+PRUNE_BIND_MOUNTS="yes"

diff --git a/sys-apps/plocate/metadata.xml b/sys-apps/plocate/metadata.xml
new file mode 100644
index 00000000000..1920c0fd849
--- /dev/null
+++ b/sys-apps/plocate/metadata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>sam@gentoo.org</email>
+		<name>Sam James</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>arsen@aarsen.me</email>
+		<name>Arsen Arsenović</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>jeffrey@icurse.nl</email>
+		<name>Jeffrey Lin</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<use>
+		<flag name="io-uring">Enable efficient I/O via <pkg>sys-libs/liburing</pkg>.</flag>
+	</use>
+	<longdescription>
+plocate works by creating an inverted index over trigrams (combinations of
+three bytes) in the search strings, which allows it to rapidly narrow down the
+set of candidates to a very small list, instead of linearly scanning through
+every entry. It does nearly all I/O asynchronously using io_uring if available
+(Linux 5.1+), which reduces the impact of seek latency on systems without SSDs.
+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).
+	</longdescription>
+</pkgmetadata>

diff --git a/sys-apps/plocate/plocate-1.1.5.ebuild b/sys-apps/plocate/plocate-1.1.5.ebuild
new file mode 100644
index 00000000000..ca1701e89c2
--- /dev/null
+++ b/sys-apps/plocate/plocate-1.1.5.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info meson systemd
+
+DESCRIPTION="Posting locate is a much faster locate"
+HOMEPAGE="https://plocate.sesse.net/"
+SRC_URI="https://plocate.sesse.net/download/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="io-uring"
+
+RDEPEND="
+	acct-group/locate
+	app-arch/zstd:=
+	io-uring? ( sys-libs/liburing:= )
+	!sys-apps/mlocate
+"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~IO_URING"
+ERROR_IO_URING="required for USE=io-uring"
+
+PATCHES=(
+	"${FILESDIR}/${PN}"-1.1.5-no-systemd-check.patch
+)
+
+src_prepare() {
+	# pretend liburing dep doesn't exist when USE flag off
+	if ! use io-uring; then
+		sed -i "s/dependency('liburing/dependency('/" meson.build || die
+	fi
+
+	# we'll install the manpage ourself to locate.1
+	sed -i "/install_man('plocate.1')/d" meson.build || die
+
+	default
+}
+
+src_configure() {
+	local emesonargs=(
+		-Dlocategroup=locate
+	)
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+	dodoc README NEWS
+	newman "${S}/${PN}.1" locate.1
+	dosym plocate /usr/bin/locate
+
+	insinto /etc
+	doins "${FILESDIR}"/updatedb.conf
+	doins "${FILESDIR}"/plocate-cron.conf
+	fperms 0644 /etc/{updatedb,plocate-cron}.conf
+
+	insinto /etc/cron.daily
+	newins "${FILESDIR}"/plocate.cron plocate
+	fperms 0755 /etc/cron.daily/plocate
+
+	systemd_dounit "${BUILD_DIR}/${PN}"-updatedb.service "${S}/${PN}"-updatedb.timer
+}
+
+pkg_postinst() {
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		elog "The database for the locate command is generated daily by a cron job,"
+		elog "if you install for the first time you can run the updatedb command manually now."
+		elog
+		elog "Note that the /etc/updatedb.conf file is generic,"
+		elog "please customize it to your system requirements."
+	fi
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/plocate/files/, sys-apps/plocate/
@ 2021-08-19  2:24 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2021-08-19  2:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fa05345540e33508d93f924e2b34c12e831c0bc9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 19 02:24:40 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 19 02:24:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa053455

Revert "sys-apps/plocate: add version 1.1.9"

Didn't mean to push! This reverts commit f86f7acf1b4cb919a762e1595dea1011463099c7.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/plocate/Manifest                          |  1 -
 .../files/plocate-1.1.9-no-systemd-check.patch     | 38 ----------
 sys-apps/plocate/plocate-1.1.9.ebuild              | 82 ----------------------
 3 files changed, 121 deletions(-)

diff --git a/sys-apps/plocate/Manifest b/sys-apps/plocate/Manifest
index 381cb363f74..4d4a1d480d4 100644
--- a/sys-apps/plocate/Manifest
+++ b/sys-apps/plocate/Manifest
@@ -1,2 +1 @@
 DIST plocate-1.1.8.tar.gz 71569 BLAKE2B 06ad0e9535b76bf0102cdeeb6014e2d84f85f51f5926520566e9c6871f04ac09651bb0674ed679d2a4c0d4e516e55dfef35a7021112fad3549bf76993554aeb5 SHA512 a685347df64ac1a3eb7789cb7023b4d0ffed5fb7435a4bd88c3943991e145a387829532ec0c01d30d851b97b8d3173ff4c7c274775e639b75f0b1b45e5bca2a6
-DIST plocate-1.1.9.tar.gz 71973 BLAKE2B c761735ee54c6f8430839dee1582b10e7eaf15e29cefed94d59221d0111d002cac88d86050099b6cdf0130b71a995c0d26fe57cbd9eccdf00b3489f5bd1ae432 SHA512 2a2bffa338add760e598ac14b68d063cb0cc7df244b6af84f70166294a0c0b66acdedce432d0573e8f2d8dcd3ddba597baa407e93cddc5c58a0b492a1e031135

diff --git a/sys-apps/plocate/files/plocate-1.1.9-no-systemd-check.patch b/sys-apps/plocate/files/plocate-1.1.9-no-systemd-check.patch
deleted file mode 100644
index 677f20fc799..00000000000
--- a/sys-apps/plocate/files/plocate-1.1.9-no-systemd-check.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0b1e568bc66df9fdb0bfd6f54b4ff2e540769dbe Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
-Date: Thu, 19 Aug 2021 02:36:54 +0200
-Subject: [PATCH] unconditionally configure systemd service
-
----
- meson.build | 15 +++------------
- 1 file changed, 3 insertions(+), 12 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index dc14eb1..9a3b3fe 100644
---- a/meson.build
-+++ b/meson.build
-@@ -76,18 +76,9 @@ updatedb_conf_man = configure_file(input: 'updatedb.conf.5.in',
-                configuration: conf_data)
- install_man(updatedb_conf_man)
- 
--if get_option('install_systemd')
--	unitdir = get_option('systemunitdir')
--	if unitdir == ''
--		unitdir = dependency('systemd').get_pkgconfig_variable('systemdsystemunitdir')
--	endif
--
--	updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
--		output: 'plocate-updatedb.service',
--		configuration: conf_data)
--	install_data(updatedb_service, install_dir: unitdir)
--	install_data('plocate-updatedb.timer', install_dir: unitdir)
--endif
-+updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
-+	output: 'plocate-updatedb.service',
-+	configuration: conf_data)
- 
- # Requires having TurboPFor checked out, so not built by default.
- # Unless you have a recent Meson, there's no apparently good way
--- 
-2.31.1
-

diff --git a/sys-apps/plocate/plocate-1.1.9.ebuild b/sys-apps/plocate/plocate-1.1.9.ebuild
deleted file mode 100644
index 8153e282f37..00000000000
--- a/sys-apps/plocate/plocate-1.1.9.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit linux-info meson systemd
-
-DESCRIPTION="Posting locate is a much faster locate"
-HOMEPAGE="https://plocate.sesse.net/"
-SRC_URI="https://plocate.sesse.net/download/${P}.tar.gz"
-
-# GPL-2 for updatedb
-# GPL-2+ for plocate itself
-LICENSE="GPL-2 GPL-2+"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64"
-IUSE="+io-uring"
-
-RDEPEND="
-	acct-group/locate
-	app-arch/zstd:=
-	io-uring? ( sys-libs/liburing:= )
-	!sys-apps/mlocate
-"
-DEPEND="${RDEPEND}"
-
-CONFIG_CHECK="~IO_URING"
-ERROR_IO_URING="required for USE=io-uring"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.1.9-no-systemd-check.patch
-)
-
-src_prepare() {
-	# Pretend liburing dep doesn't exist when USE flag off
-	if ! use io-uring; then
-		sed -i "s/dependency('liburing/dependency('/" meson.build || die
-	fi
-
-	# We'll install the manpage ourself to locate.1
-	sed -i "/install_man('plocate.1')/d" meson.build || die
-
-	default
-}
-
-src_configure() {
-	local emesonargs=(
-		-Dlocategroup=locate
-	)
-	meson_src_configure
-}
-
-src_install() {
-	meson_src_install
-	dodoc README NEWS
-	newman "${S}"/${PN}.1 locate.1
-	dosym plocate /usr/bin/locate
-
-	insinto /etc
-	doins "${FILESDIR}"/updatedb.conf
-	doins "${FILESDIR}"/plocate-cron.conf
-	fperms 0644 /etc/{updatedb,plocate-cron}.conf
-
-	insinto /etc/cron.daily
-	# Ensure that the cron file has the same name as the
-	# systemd-timer, to avoid plocate being run twice daily on systems
-	# with a systemd compatiblity layer. See also bug #780351.
-	newins "${FILESDIR}"/plocate.cron plocate-updatedb
-	fperms 0755 /etc/cron.daily/plocate-updatedb
-
-	systemd_dounit "${BUILD_DIR}"/${PN}-updatedb.service "${S}"/${PN}-updatedb.timer
-}
-
-pkg_postinst() {
-	if [[ -z "${REPLACING_VERSIONS}" ]] ; then
-		elog "The database for the locate command is generated daily by a cron job,"
-		elog "if you install for the first time you can run the updatedb command manually now."
-		elog
-		elog "Note that the ${EROOT}/etc/updatedb.conf file is generic,"
-		elog "please customize it to your system requirements."
-	fi
-}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/plocate/files/, sys-apps/plocate/
@ 2021-08-25  7:52 Florian Schmaus
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Schmaus @ 2021-08-25  7:52 UTC (permalink / raw
  To: gentoo-commits

commit:     d5806bdf4686f5af5f9f7b06741578c3e40be456
Author:     Arsen Arsenović <arsen <AT> aarsen <DOT> me>
AuthorDate: Tue Aug 24 22:41:26 2021 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Aug 25 07:52:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5806bdf

sys-apps/plocate: add version 1.1.10

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Arsen Arsenović <arsen <AT> aarsen.me>
Closes: https://github.com/gentoo/gentoo/pull/22022
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 sys-apps/plocate/Manifest                          |  1 +
 ...0-meson-use-feature-option-for-libiouring.patch | 38 ++++++++++
 sys-apps/plocate/plocate-1.1.10.ebuild             | 81 ++++++++++++++++++++++
 3 files changed, 120 insertions(+)

diff --git a/sys-apps/plocate/Manifest b/sys-apps/plocate/Manifest
index 4d4a1d480d4..7a35e770f07 100644
--- a/sys-apps/plocate/Manifest
+++ b/sys-apps/plocate/Manifest
@@ -1 +1,2 @@
+DIST plocate-1.1.10.tar.gz 72222 BLAKE2B 2d84177454380c9e806a46a6e7057aca15b65c9d83179ba35062d0b8772e7cb3ff50d594c294d73157e7705d4b2eea3f12d07e614076e6a6c7a9b532f42640f5 SHA512 eee4a8982b8fff18793cd06c35cdea501226fae6409df02e8bed3d14feb3ed4ba6c29e907f36f5efb74202e8926547def83379b03aeb6348e1a6e7b51f12fdb9
 DIST plocate-1.1.8.tar.gz 71569 BLAKE2B 06ad0e9535b76bf0102cdeeb6014e2d84f85f51f5926520566e9c6871f04ac09651bb0674ed679d2a4c0d4e516e55dfef35a7021112fad3549bf76993554aeb5 SHA512 a685347df64ac1a3eb7789cb7023b4d0ffed5fb7435a4bd88c3943991e145a387829532ec0c01d30d851b97b8d3173ff4c7c274775e639b75f0b1b45e5bca2a6

diff --git a/sys-apps/plocate/files/plocate-1.1.10-meson-use-feature-option-for-libiouring.patch b/sys-apps/plocate/files/plocate-1.1.10-meson-use-feature-option-for-libiouring.patch
new file mode 100644
index 00000000000..183c9f8e7ff
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.10-meson-use-feature-option-for-libiouring.patch
@@ -0,0 +1,38 @@
+From 562128212376305bac8edd10d80c24f1223f1870 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
+Date: Thu, 19 Aug 2021 12:03:39 +0200
+Subject: [PATCH plocate] meson: use feature option for libiouring
+
+source-based distributions would prefer to allow this option to be
+disabled without a hack, regardless of is libiouring installed or not,
+and meson already supports feature options for this purpose.
+---
+ meson.build       | 2 +-
+ meson_options.txt | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 6fb0f74..fb79e3f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -10,7 +10,7 @@ add_project_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', lan
+ add_project_arguments('-DPACKAGE_BUGREPORT="steinar+plocate@gunderson.no"', language: 'cpp')
+ 
+ cxx = meson.get_compiler('cpp')
+-uringdep = dependency('liburing', required: false)
++uringdep = dependency('liburing', required: get_option('use_libiouring'))
+ zstddep = dependency('libzstd')
+ threaddep = dependency('threads')
+ atomicdep = cxx.find_library('atomic', required: false)
+diff --git a/meson_options.txt b/meson_options.txt
+index 8ac13c5..9c90bf0 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -3,3 +3,4 @@ option('install_systemd', type: 'boolean', value: true, description: 'Install sy
+ option('systemunitdir', type: 'string', description: 'Where to install systemd units to (default: autodetect)')
+ option('locategroup', type: 'string', value: 'plocate', description: 'Group that the install script will use for the .db file')
+ option('updatedb_progname', type: 'string', value: 'updatedb', description: 'Binary name of updatedb')
++option('use_libiouring', type: 'feature', value: 'auto', description: 'Enable libiouring dependency (default: autodetect)')
+-- 
+2.31.1
+

diff --git a/sys-apps/plocate/plocate-1.1.10.ebuild b/sys-apps/plocate/plocate-1.1.10.ebuild
new file mode 100644
index 00000000000..d198d630c59
--- /dev/null
+++ b/sys-apps/plocate/plocate-1.1.10.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info meson systemd
+
+DESCRIPTION="Posting locate is a much faster locate"
+HOMEPAGE="https://plocate.sesse.net/"
+SRC_URI="https://plocate.sesse.net/download/${P}.tar.gz"
+
+# GPL-2 for updatedb
+# GPL-2+ for plocate itself
+LICENSE="GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="+io-uring"
+
+RDEPEND="
+	acct-group/locate
+	app-arch/zstd:=
+	io-uring? ( sys-libs/liburing:= )
+	!sys-apps/mlocate
+"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~IO_URING"
+ERROR_IO_URING="required for USE=io-uring"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.1.10-meson-use-feature-option-for-libiouring.patch
+)
+
+src_prepare() {
+	# We'll install the manpage ourself to locate.1
+	sed -i "/install_man('plocate.1')/d" meson.build || die
+
+	default
+}
+
+src_configure() {
+	local emesonargs=(
+		-Dlocategroup=locate
+		-Dinstall_systemd=true
+		-Dinstall_cron=false
+		-Dsystemunitdir="$(systemd_get_systemunitdir)"
+		"$(meson_feature io-uring use_libiouring)"
+	)
+	meson_src_configure
+}
+
+src_install() {
+	meson_src_install
+	dodoc README NEWS
+	newman "${S}"/${PN}.1 locate.1
+	dosym plocate /usr/bin/locate
+
+	insinto /etc
+	doins "${FILESDIR}"/updatedb.conf
+	doins "${FILESDIR}"/plocate-cron.conf
+	fperms 0644 /etc/{updatedb,plocate-cron}.conf
+
+	insinto /etc/cron.daily
+	# Ensure that the cron file has the same name as the
+	# systemd-timer, to avoid plocate being run twice daily on systems
+	# with a systemd compatiblity layer. See also bug #780351.
+	newins "${FILESDIR}"/plocate.cron plocate-updatedb
+	fperms 0755 /etc/cron.daily/plocate-updatedb
+
+	systemd_dounit "${BUILD_DIR}"/${PN}-updatedb.service "${S}"/${PN}-updatedb.timer
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]] ; then
+		elog "The database for the locate command is generated daily by a cron job,"
+		elog "if you install for the first time you can run the updatedb command manually now."
+		elog
+		elog "Note that the ${EROOT}/etc/updatedb.conf file is generic,"
+		elog "please customize it to your system requirements."
+	fi
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/plocate/files/, sys-apps/plocate/
@ 2022-07-15  1:26 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-07-15  1:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8ae581f317277614e761ff7659de8ba16abb2bab
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Thu Jul  7 17:36:44 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 01:17:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ae581f3

sys-apps/plocate: Fix build for musl

Read each patch for explaination, both are now upstreamed!
Should be in 1.1.17 (or whatever next release will be called).

Closes: https://bugs.gentoo.org/show_bug.cgi?id=829580
Closes: https://bugs.gentoo.org/show_bug.cgi?id=853769
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/26268
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...plocate-1.1.16-error-to-fprintf-exit-musl.patch | 337 +++++++++++++++++++++
 .../plocate-1.1.16-include-linux-stat_h-musl.patch |  30 ++
 sys-apps/plocate/plocate-1.1.16.ebuild             |   2 +
 3 files changed, 369 insertions(+)

diff --git a/sys-apps/plocate/files/plocate-1.1.16-error-to-fprintf-exit-musl.patch b/sys-apps/plocate/files/plocate-1.1.16-error-to-fprintf-exit-musl.patch
new file mode 100644
index 000000000000..6d108501307f
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.16-error-to-fprintf-exit-musl.patch
@@ -0,0 +1,337 @@
+https://bugs.gentoo.org/829580
+https://git.sesse.net/?p=plocate;a=commit;h=fd6198891d6fd9642effc0843fef6f23b991af3e
+
+From fd6198891d6fd9642effc0843fef6f23b991af3e Mon Sep 17 00:00:00 2001
+From: "Steinar H. Gunderson" <steinar+git@gunderson.no>
+Date: Wed, 13 Jul 2022 22:31:54 +0200
+Subject: [PATCH 2/2] Remove dependency on non-POSIX header error.h.
+
+This helps compatibility with certain configurations of musl libc.
+Note that the output format on updatedb.conf errors will change somewhat,
+and only the first one will be reported followed by immediate exit
+(unlike earlier, where all updatedb.conf errors would be output before exit).
+
+Based on a patch by Alfred Persson Forsberg.
+---
+ conf.cpp | 178 +++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 94 insertions(+), 84 deletions(-)
+
+diff --git a/conf.cpp b/conf.cpp
+index 1055fd7..60dd93f 100644
+--- a/conf.cpp
++++ b/conf.cpp
+@@ -22,7 +22,6 @@ any later version.
+ 
+ #include "conf.h"
+ 
+-#include "error.h"
+ #include "lib.h"
+ 
+ #include <algorithm>
+@@ -167,11 +166,6 @@ uc_lex(void)
+ 		/* Fall through */
+ 	case '\n':
+ 		uc_current_line++;
+-		if (uc_current_line == 0) {
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_current_line - 1,
+-			              _("warning: Line number overflow"));
+-			error_message_count--; /* Don't count as an error */
+-		}
+ 		return UCT_EOL;
+ 
+ 	case '=':
+@@ -180,10 +174,9 @@ uc_lex(void)
+ 	case '"': {
+ 		while ((c = getc_unlocked(uc_file)) != '"') {
+ 			if (c == EOF || c == '\n') {
+-				error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-				              _("missing closing `\"'"));
+-				ungetc(c, uc_file);
+-				break;
++				fprintf(stderr, "%s:%u: missing closing `\"'\n",
++					UPDATEDB_CONF, uc_line);
++				exit(EXIT_FAILURE);
+ 			}
+ 			uc_lex_buf.push_back(c);
+ 		}
+@@ -215,21 +208,18 @@ uc_lex(void)
+ static void
+ parse_updatedb_conf(void)
+ {
+-	int old_error_one_per_line;
+-	unsigned old_error_message_count;
+ 	bool had_prune_bind_mounts, had_prunefs, had_prunenames, had_prunepaths;
+ 
+ 	uc_file = fopen(UPDATEDB_CONF, "r");
+ 	if (uc_file == NULL) {
+-		if (errno != ENOENT)
+-			error(EXIT_FAILURE, errno, _("can not open `%s'"), UPDATEDB_CONF);
+-		goto err;
++	        if (errno != ENOENT) {
++		        perror(UPDATEDB_CONF);
++			exit(EXIT_FAILURE);
++	        }
++		return;
+ 	}
+ 	flockfile(uc_file);
+ 	uc_current_line = 1;
+-	old_error_message_count = error_message_count;
+-	old_error_one_per_line = error_one_per_line;
+-	error_one_per_line = 1;
+ 	had_prune_bind_mounts = false;
+ 	had_prunefs = false;
+ 	had_prunenames = false;
+@@ -263,40 +253,39 @@ parse_updatedb_conf(void)
+ 			break;
+ 
+ 		case UCT_IDENTIFIER:
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("unknown variable `%s'"), uc_lex_buf.c_str());
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: unknown variable: `%s'\n",
++				UPDATEDB_CONF, uc_line, uc_lex_buf.c_str());
++			exit(EXIT_FAILURE);
+ 
+ 		default:
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("variable name expected"));
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: variable name expected\n",
++				UPDATEDB_CONF, uc_line);
++			exit(EXIT_FAILURE);
+ 		}
+ 		if (*had_var != false) {
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("variable `%s' was already defined"), uc_lex_buf.c_str());
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: variable `%s' was already defined\n",
++				UPDATEDB_CONF, uc_line, uc_lex_buf.c_str());
++			exit(EXIT_FAILURE);
+ 		}
+ 		*had_var = true;
+ 		var_token = token;
+ 		token = uc_lex();
+ 		if (token != UCT_EQUAL) {
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("`=' expected after variable name"));
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: `=' expected after variable name\n",
++				UPDATEDB_CONF, uc_line);
++			exit(EXIT_FAILURE);
+ 		}
+ 		token = uc_lex();
+ 		if (token != UCT_QUOTED) {
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("value in quotes expected after `='"));
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: value in quotes expected after `='\n",
++				UPDATEDB_CONF, uc_line);
++			exit(EXIT_FAILURE);
+ 		}
+ 		if (var_token == UCT_PRUNE_BIND_MOUNTS) {
+ 			if (parse_bool(&conf_prune_bind_mounts, uc_lex_buf.c_str()) != 0) {
+-				error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-				              _("invalid value `%s' of PRUNE_BIND_MOUNTS"),
+-				              uc_lex_buf.c_str());
+-				goto skip_to_eol;
++				fprintf(stderr, "%s:%u: invalid value `%s' of PRUNE_BIND_MOUNTS\n",
++					UPDATEDB_CONF, uc_line, uc_lex_buf.c_str());
++				exit(EXIT_FAILURE);
+ 			}
+ 		} else if (var_token == UCT_PRUNEFS)
+ 			var_add_values(&conf_prunefs, uc_lex_buf.c_str());
+@@ -308,12 +297,11 @@ parse_updatedb_conf(void)
+ 			abort();
+ 		token = uc_lex();
+ 		if (token != UCT_EOL && token != UCT_EOF) {
+-			error_at_line(0, 0, UPDATEDB_CONF, uc_line,
+-			              _("unexpected data after variable value"));
+-			goto skip_to_eol;
++			fprintf(stderr, "%s:%u: unexpected data after variable value\n",
++				UPDATEDB_CONF, uc_line);
++			exit(EXIT_FAILURE);
+ 		}
+ 		/* Fall through */
+-	skip_to_eol:
+ 		while (token != UCT_EOL) {
+ 			if (token == UCT_EOF)
+ 				goto eof;
+@@ -321,14 +309,12 @@ parse_updatedb_conf(void)
+ 		}
+ 	}
+ eof:
+-	if (ferror(uc_file))
+-		error(EXIT_FAILURE, 0, _("I/O error reading `%s'"), UPDATEDB_CONF);
+-	error_one_per_line = old_error_one_per_line;
++	if (ferror(uc_file)) {
++		perror(UPDATEDB_CONF);
++		exit(EXIT_FAILURE);
++	}
+ 	funlockfile(uc_file);
+ 	fclose(uc_file);
+-	if (error_message_count != old_error_message_count)
+-		exit(EXIT_FAILURE);
+-err:;
+ }
+ 
+ /* Command-line argument parsing */
+@@ -384,8 +370,11 @@ prepend_cwd(const string &path)
+ 	do
+ 		buf.resize(buf.size() * 1.5);
+ 	while ((res = getcwd(buf.data(), buf.size())) == NULL && errno == ERANGE);
+-	if (res == NULL)
+-		error(EXIT_FAILURE, errno, _("can not get current working directory"));
++	if (res == NULL) {
++	        fprintf(stderr, "%s: %s: can not get current working directory\n",
++			program_invocation_name, strerror(errno));
++	        exit(EXIT_FAILURE);
++	}
+ 	buf.resize(strlen(buf.data()));
+ 	return buf + '/' + path;
+ }
+@@ -438,54 +427,64 @@ parse_arguments(int argc, char *argv[])
+ 			exit(EXIT_FAILURE);
+ 
+ 		case 'B':
+-			if (got_prune_bind_mounts != false)
+-				error(EXIT_FAILURE, 0,
+-				      _("--%s would override earlier command-line argument"),
+-				      "prune-bind-mounts");
++		        if (got_prune_bind_mounts != false) {
++				fprintf(stderr, "%s: --%s would override earlier command-line argument\n",
++				        program_invocation_name, "prune-bind-mounts");
++				exit(EXIT_FAILURE);
++			}
+ 			got_prune_bind_mounts = true;
+-			if (parse_bool(&conf_prune_bind_mounts, optarg) != 0)
+-				error(EXIT_FAILURE, 0, _("invalid value `%s' of --%s"), optarg,
+-				      "prune-bind-mounts");
++			if (parse_bool(&conf_prune_bind_mounts, optarg) != 0) {
++				fprintf(stderr, "%s: invalid value %s of --%s\n",
++				        program_invocation_name, optarg, "prune-bind-mounts");
++				exit(EXIT_FAILURE);
++			}
+ 			break;
+ 
+ 		case 'F':
+-			if (prunefs_changed != false)
+-				error(EXIT_FAILURE, 0,
+-				      _("--%s would override earlier command-line argument"),
+-				      "prunefs");
++			if (prunefs_changed != false) {
++				fprintf(stderr, "%s: --%s would override earlier command-line argument\n",
++				        program_invocation_name, "prunefs");
++				exit(EXIT_FAILURE);
++			}
+ 			prunefs_changed = true;
+ 			conf_prunefs.clear();
+ 			var_add_values(&conf_prunefs, optarg);
+ 			break;
+ 
+ 		case 'N':
+-			if (prunenames_changed != false)
+-				error(EXIT_FAILURE, 0,
+-				      _("--%s would override earlier command-line argument"),
+-				      "prunenames");
++			if (prunenames_changed != false) {
++				fprintf(stderr, "%s: --%s would override earlier command-line argument\n",
++                                        program_invocation_name, "prunenames");
++                                exit(EXIT_FAILURE);
++			}
+ 			prunenames_changed = true;
+ 			conf_prunenames.clear();
+ 			var_add_values(&conf_prunenames, optarg);
+ 			break;
+ 
+ 		case 'P':
+-			if (prunepaths_changed != false)
+-				error(EXIT_FAILURE, 0,
+-				      _("--%s would override earlier command-line argument"),
+-				      "prunepaths");
++			if (prunepaths_changed != false) {
++				fprintf(stderr, "%s: --%s would override earlier command-line argument\n",
++                                        program_invocation_name, "prunepaths");
++                                exit(EXIT_FAILURE);
++			}
+ 			prunepaths_changed = true;
+ 			conf_prunepaths.clear();
+ 			var_add_values(&conf_prunepaths, optarg);
+ 			break;
+ 
+ 		case 'U':
+-			if (conf_scan_root != NULL)
+-				error(EXIT_FAILURE, 0, _("--%s specified twice"),
+-				      "database-root");
++			if (conf_scan_root != NULL) {
++				fprintf(stderr, "%s: --%s specified twice\n",
++					program_invocation_name, "database-root");
++				exit(EXIT_FAILURE);
++			}
+ 			conf_scan_root = realpath(optarg, nullptr);
+-			if (conf_scan_root == NULL)
+-				error(EXIT_FAILURE, errno, _("invalid value `%s' of --%s"), optarg,
+-				      "database-root");
++			if (conf_scan_root == NULL) {
++				fprintf(stderr, "%s: %s: invalid value `%s' of --%s\n",
++					program_invocation_name, strerror(errno), optarg, "database-root");
++				exit(EXIT_FAILURE);
++			}
+ 			break;
+ 
+ 		case 'V':
+@@ -517,13 +516,18 @@ parse_arguments(int argc, char *argv[])
+ 			exit(EXIT_SUCCESS);
+ 
+ 		case 'l':
+-			if (got_visibility != false)
+-				error(EXIT_FAILURE, 0, _("--%s specified twice"),
+-				      "require-visibility");
++			if (got_visibility != false) {
++				fprintf(stderr, "%s: --%s specified twice\n",
++                                        program_invocation_name, "require-visibility");
++                                exit(EXIT_FAILURE);
++			}
++
+ 			got_visibility = true;
+-			if (parse_bool(&conf_check_visibility, optarg) != 0)
+-				error(EXIT_FAILURE, 0, _("invalid value `%s' of --%s"), optarg,
+-				      "require-visibility");
++			if (parse_bool(&conf_check_visibility, optarg) != 0) {
++				fprintf(stderr, "%s: invalid value `%s' of --%s",
++					program_invocation_name, optarg, "require-visibility");
++				exit(EXIT_FAILURE);
++			}
+ 			break;
+ 
+ 		case 'n':
+@@ -532,8 +536,11 @@ parse_arguments(int argc, char *argv[])
+ 			break;
+ 
+ 		case 'o':
+-			if (!conf_output.empty())
+-				error(EXIT_FAILURE, 0, _("--%s specified twice"), "output");
++			if (!conf_output.empty()) {
++				fprintf(stderr, "%s: --%s specified twice",
++					program_invocation_name, "output");
++				exit(EXIT_FAILURE);
++			}
+ 			conf_output = optarg;
+ 			break;
+ 
+@@ -558,8 +565,11 @@ parse_arguments(int argc, char *argv[])
+ 		}
+ 	}
+ options_done:
+-	if (optind != argc)
+-		error(EXIT_FAILURE, 0, _("unexpected operand on command line"));
++	if (optind != argc) {
++		fprintf(stderr, "%s: unexpected operand on command line",
++			program_invocation_name);
++		exit(EXIT_FAILURE);
++	}
+ 	if (conf_scan_root == NULL) {
+ 		static char root[] = "/";
+ 
+-- 
+2.35.1
+

diff --git a/sys-apps/plocate/files/plocate-1.1.16-include-linux-stat_h-musl.patch b/sys-apps/plocate/files/plocate-1.1.16-include-linux-stat_h-musl.patch
new file mode 100644
index 000000000000..a4b9fe4d1bc6
--- /dev/null
+++ b/sys-apps/plocate/files/plocate-1.1.16-include-linux-stat_h-musl.patch
@@ -0,0 +1,30 @@
+https://git.sesse.net/?p=plocate;a=commit;h=0125004cd28c5f9124632b594e51dde73af1691c
+https://git.alpinelinux.org/aports/tree/community/plocate/include-statx.patch
+https://bugs.gentoo.org/853769
+
+From 0125004cd28c5f9124632b594e51dde73af1691c Mon Sep 17 00:00:00 2001
+From: "Steinar H. Gunderson" <steinar+git@gunderson.no>
+Date: Sat, 25 Jun 2022 10:01:49 +0200
+Subject: [PATCH 1/2] Add a missing #include.
+
+Taken from the Alpine Linux packaging; seems to be for statx()
+(presumably on musl libc).
+---
+ io_uring_engine.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/io_uring_engine.h b/io_uring_engine.h
+index 688a6ae..bcb1058 100644
+--- a/io_uring_engine.h
++++ b/io_uring_engine.h
+@@ -7,6 +7,7 @@
+ #include <string_view>
+ #include <sys/socket.h>
+ #include <sys/types.h>
++#include <linux/stat.h>
+ 
+ struct io_uring_sqe;
+ #ifndef WITHOUT_URING
+-- 
+2.35.1
+

diff --git a/sys-apps/plocate/plocate-1.1.16.ebuild b/sys-apps/plocate/plocate-1.1.16.ebuild
index baa634d92859..ea20d3fb9b1c 100644
--- a/sys-apps/plocate/plocate-1.1.16.ebuild
+++ b/sys-apps/plocate/plocate-1.1.16.ebuild
@@ -26,6 +26,8 @@ DEPEND="${RDEPEND}"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-1.1.15-meson-use-feature-option-for-libiouring.patch
+	"${FILESDIR}"/${PN}-1.1.16-error-to-fprintf-exit-musl.patch
+	"${FILESDIR}"/${PN}-1.1.16-include-linux-stat_h-musl.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-15  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-25  7:52 [gentoo-commits] repo/gentoo:master commit in: sys-apps/plocate/files/, sys-apps/plocate/ Florian Schmaus
  -- strict thread matches above, loose matches on Subject: below --
2022-07-15  1:26 Sam James
2021-08-19  2:24 Sam James
2021-03-20  5:43 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox