From 740179c839b777e69f0d41f080fac6cceeb65f2a Mon Sep 17 00:00:00 2001 From: Duncaen 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 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 ++ + #include "database-builder.h" + + #include "dprintf.h" +@@ -10,7 +12,6 @@ + #include + #include + #include +-#include + #include + #include + #include +--- plocate-build.cpp.orig ++++ plocate-build.cpp +@@ -1,3 +1,5 @@ ++#include ++ + #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 " 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 }