Github messages for voidlinux
 help / color / mirror / Atom feed
From: Duncaen <Duncaen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] plocate-1.1.3
Date: Sun, 17 Jan 2021 21:37:53 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27991@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

There is a new pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages plocate
https://github.com/void-linux/void-packages/pull/27991

plocate-1.1.3


A patch file from https://github.com/void-linux/void-packages/pull/27991.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-plocate-27991.patch --]
[-- Type: text/x-diff, Size: 6168 bytes --]

From 740179c839b777e69f0d41f080fac6cceeb65f2a Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Sun, 17 Jan 2021 21:26:59 +0100
Subject: [PATCH 1/2] musl-legacy-compat: update to 0.5.

Add `error_at_line(3)` to error.h
---
 srcpkgs/musl-legacy-compat/files/error.h | 27 ++++++++++++++++++++++++
 srcpkgs/musl-legacy-compat/template      |  2 +-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/musl-legacy-compat/files/error.h b/srcpkgs/musl-legacy-compat/files/error.h
index 4505784182a..c94dbac5bf4 100644
--- a/srcpkgs/musl-legacy-compat/files/error.h
+++ b/srcpkgs/musl-legacy-compat/files/error.h
@@ -26,4 +26,31 @@ static inline void error(int status, int errnum, const char* format, ...)
 		exit(status);
 }
 
+static int error_one_per_line = 0;
+
+static inline void error_at_line(int status, int errnum, const char *filename,
+		unsigned int linenum, const char *format, ...)
+{
+	va_list ap;
+	if (error_one_per_line) {
+		static const char *old_filename;
+		static int old_linenum;
+		if (linenum == old_linenum && filename == old_filename)
+			return;
+		old_filename = filename;
+		old_linenum = linenum;
+	}
+	fprintf(stderr, "%s: %s:%u: ", program_invocation_name, filename, linenum);
+	va_start(ap, format);
+	vfprintf(stderr, format, ap);
+	va_end(ap);
+	if (errnum)
+		fprintf(stderr, ": %s", strerror(errnum));
+	fprintf(stderr, "\n");
+	error_message_count++;
+	if (status)
+		exit(status);
+}
+
+
 #endif	/* _ERROR_H_ */
diff --git a/srcpkgs/musl-legacy-compat/template b/srcpkgs/musl-legacy-compat/template
index afc447314f4..f68bd992251 100644
--- a/srcpkgs/musl-legacy-compat/template
+++ b/srcpkgs/musl-legacy-compat/template
@@ -1,6 +1,6 @@
 # Template file for 'musl-legacy-compat'
 pkgname=musl-legacy-compat
-version=0.4
+version=0.5
 revision=1
 archs="*-musl"
 bootstrap=yes

From b4f8b029dc8524b4f178541ff7d9aad75c18af04 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Sun, 17 Jan 2021 21:34:26 +0100
Subject: [PATCH 2/2] plocate: update to 1.1.3.

---
 srcpkgs/plocate/files/plocate.cron-daily |  6 ++--
 srcpkgs/plocate/files/pupdatedb          |  8 ------
 srcpkgs/plocate/patches/musl.patch       | 35 ++++++++++++++++++++++++
 srcpkgs/plocate/template                 | 19 ++++++++-----
 4 files changed, 49 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/plocate/files/pupdatedb
 create mode 100644 srcpkgs/plocate/patches/musl.patch

diff --git a/srcpkgs/plocate/files/plocate.cron-daily b/srcpkgs/plocate/files/plocate.cron-daily
index 099ba5ce69a..a616d55d280 100644
--- a/srcpkgs/plocate/files/plocate.cron-daily
+++ b/srcpkgs/plocate/files/plocate.cron-daily
@@ -1,5 +1,3 @@
 #!/bin/sh
-set -e
-plocate-build /var/lib/mlocate/mlocate.db /var/lib/mlocate/plocate.db.new
-chgrp _plocate /var/lib/mlocate/plocate.db.new
-mv /var/lib/mlocate/plocate.db.new /var/lib/mlocate/plocate.db
+ulimit -n 131072
+exec pupdatedb
diff --git a/srcpkgs/plocate/files/pupdatedb b/srcpkgs/plocate/files/pupdatedb
deleted file mode 100644
index 08fdbd0748a..00000000000
--- a/srcpkgs/plocate/files/pupdatedb
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# pupdatedb [database directory] - update a database for plocate
-set -e
-dbdir=${1:-${DBDIR:-/var/lib/mlocate}}
-mupdatedb -o "${dbdir}/mlocate.db"
-plocate-build "${dbdir}/mlocate.db" "${dbdir}/plocate.db.new"
-chgrp _plocate "${dbdir}/plocate.db.new"
-mv "${dbdir}/plocate.db.new" "${dbdir}/plocate.db"
diff --git a/srcpkgs/plocate/patches/musl.patch b/srcpkgs/plocate/patches/musl.patch
new file mode 100644
index 00000000000..22e955b6fd4
--- /dev/null
+++ b/srcpkgs/plocate/patches/musl.patch
@@ -0,0 +1,35 @@
+--- conf.cpp
++++ conf.cpp
+@@ -479,7 +479,7 @@
+ 			if (conf_scan_root != NULL)
+ 				error(EXIT_FAILURE, 0, _("--%s specified twice"),
+ 				      "database-root");
+-			conf_scan_root = canonicalize_file_name(optarg);
++			conf_scan_root = realpath(optarg, NULL);
+ 			if (conf_scan_root == NULL)
+ 				error(EXIT_FAILURE, errno, _("invalid value `%s' of --%s"), optarg,
+ 				      "database-root");
+--- database-builder.cpp
++++ database-builder.cpp
+@@ -1,3 +1,5 @@
++#include <sys/types.h>
++
+ #include "database-builder.h"
+ 
+ #include "dprintf.h"
+@@ -10,7 +12,6 @@
+ #include <string_view>
+ #include <sys/stat.h>
+ #include <sys/time.h>
+-#include <sys/types.h>
+ #include <unistd.h>
+ #include <zdict.h>
+ #include <zstd.h>
+--- plocate-build.cpp.orig
++++ plocate-build.cpp
+@@ -1,3 +1,5 @@
++#include <sys/types.h>
++
+ #include "database-builder.h"
+ #include "db.h"
+ #include "dprintf.h"
diff --git a/srcpkgs/plocate/template b/srcpkgs/plocate/template
index 590edee47e8..43b3450c3e3 100644
--- a/srcpkgs/plocate/template
+++ b/srcpkgs/plocate/template
@@ -1,24 +1,31 @@
 # Template file for 'plocate'
 pkgname=plocate
-version=1.0.7
+version=1.1.3
 revision=1
 build_style=meson
+configure_args="
+ -Dupdatedb_progname=pupdatedb
+ -Dlocategroup=_plocate"
 hostmakedepends="pkg-config"
 makedepends="libzstd-devel"
-depends="mlocate"
 short_desc="Much faster locate based on posting lists"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://plocate.sesse.net/"
 distfiles="https://plocate.sesse.net/download/plocate-${version}.tar.gz"
-checksum=528541eede06170aa16488b2c24abad2e527a12053a62a4a49d0eac3a41e21d3
+checksum=5e6174838e53b1d63852215b02bededcb9878d8fc7f375e3b33afd59121811fa
 
 system_accounts="_plocate"
 
 alternatives="
  locate:locate:/usr/bin/plocate
  locate:locate.1:/usr/share/man/man1/plocate.1
- locate:updatedb:/usr/bin/pupdatedb"
+ locate:updatedb:/usr/bin/pupdatedb
+ locate:updatedb.conf.5:/usr/share/man/man5/pupdatedb.conf.5"
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	makedepends+=" musl-legacy-compat"
+fi
 
 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 	makedepends+=" libatomic-devel"
@@ -26,8 +33,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 fi
 
 post_install() {
-	# replace daily cronjob with our own version
-	rm ${DESTDIR}/etc/cron.daily/plocate
 	vinstall ${FILESDIR}/plocate.cron-daily 744 etc/cron.daily plocate-build
-	vbin ${FILESDIR}/pupdatedb
+	mv ${DESTDIR}/usr/share/man/man5/{,p}updatedb.conf.5
 }

             reply	other threads:[~2021-01-17 20:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-17 20:37 Duncaen [this message]
2021-01-17 20:44 ` plocate-1.1.3 leahneukirchen
2021-01-17 20:57 ` [PR PATCH] [Updated] plocate-1.1.3 Duncaen
2021-01-17 22:27 ` [PR REVIEW] plocate-1.1.3 ericonr
2021-01-17 23:08 ` Duncaen
2021-01-17 23:08 ` Duncaen
2021-01-17 23:12 ` ericonr
2021-01-17 23:22 ` Duncaen
2021-01-19 22:59 ` plocate-1.1.3 ericonr
2021-01-19 23:52 ` plocate-1.1.3 Duncaen
2021-02-02 11:13 ` plocate-1.1.3 leahneukirchen
2021-04-06 12:37 ` [PR PATCH] [Updated] plocate-1.1.3 Duncaen
2021-06-13 20:08 ` [PR PATCH] [Closed]: plocate-1.1.3 Duncaen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27991@inbox.vuxu.org \
    --to=duncaen@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).