From nobody Tue Feb 15 15:06:11 2022 X-Original-To: dev-commits-ports-main@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 1F5EF19CAD61; Tue, 15 Feb 2022 15:06:12 +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 4Jyktq6FlBz3P8n; Tue, 15 Feb 2022 15:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644937571; 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=ipThDM3UCMUCqTn47r2QpltTKu11ldfyMiTbWdPEgvs=; b=dhsipb7Go5z2gtoYRXn5sCs484iM0XI8+zYfjdtpVeE4etG6TzCneRn6FDdGKoyhv2voGO 9R3d9HmkfK+G6KwroZ1Mp7ScOIFAfBE8dvySXQD0qrjtyoCe8PqsZ8HqVvfGCFNou9ML7p mhkerfju28d3TpNZG/93lmxsvWUrTzYW1Bal7j09raUYw2gwy1rNnVAL+3Y1bTXbNd+hEa 6urSNd6aW2vxEN/swOvSiQexExBolLZPYCy7ye116bF8hQ7TWMuwynI+aTigD7D6XkB6Kc XYxpkziacCuVBVdGU7VtZBBomMDLbTUhJ/ePt7Cr6hNmIetaM5CDo75BKSvr1g== 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 B2D69249F8; Tue, 15 Feb 2022 15:06:11 +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 21FF6B3M090788; Tue, 15 Feb 2022 15:06:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21FF6BvP090787; Tue, 15 Feb 2022 15:06:11 GMT (envelope-from git) Date: Tue, 15 Feb 2022 15:06:11 GMT Message-Id: <202202151506.21FF6BvP090787@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Alexey Dokuchaev Subject: git: c2848657ef8d - main - sysutils/fsearch: update the port to the latest patch release 0.1.2 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: danfe X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2848657ef8df23f3a5d515b589c2b33558b2ede Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644937571; 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=ipThDM3UCMUCqTn47r2QpltTKu11ldfyMiTbWdPEgvs=; b=ndsPlkf0WCtHTmcwkeAVeTZd85rLDbg7HA7CXZ3pBCcbu3TBKtHPSYpXU8W/6m08KYsopT xuGSqirn9b/HhiDWvMPDww36NUj22909T5dnpHfhqHf/7EYOIoYFBjXjr8k7ThukUp+lLe Ygz+9F2GWaDRJN6fWeNE4brqpBq3p7oN5DVRt1ALRpXR7+eIU2N7lwOGayz5woT75aakiN +oDfRgYbApj/RRPn1Mt44s0qH+QvPdkPXdepJNeHB84XThQgnhVf50ZLx4E0KlmjMBD9Gc NhYepAJB2UVnkDiuoU+v2JlVt9xC8VSQRRFaoSsXSxhXaj7or09aXjFizpmWUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644937571; a=rsa-sha256; cv=none; b=KpAZyluZt3+ViqZCecKh5yyeRzXHNT5bnOZ1gkZGPzbOj124+kOd2SPhpK/VChy7aXZH4i 59JOn2mUYfTfCblzXfwPLyTBmwtjtnpYEnBJSDrJgTsx+2M47Wkwa9ixc4wzpPj4m3ODHz w5aADHNCoJRGJVN1jMScQw6HoePyvS2R52Shrq5PTbf/rdncuB5r5rGqZQRycB32vaHC27 4G/128pzkAyKjXSU2p0U2pvkCoh2RmkspM4W+RLJ1Rq/bcAUV5c4Nz4V2wV/hchUUkhtxM d0OmBo2RsxN+qxcitKlyL32rg1Bl8ZxGA7GdJhW9aJmbaX8dvXcjnenNVjT7Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by danfe: URL: https://cgit.FreeBSD.org/ports/commit/?id=c2848657ef8df23f3a5d515b589c2b33558b2ede commit c2848657ef8df23f3a5d515b589c2b33558b2ede Author: Alexey Dokuchaev AuthorDate: 2022-02-15 15:04:26 +0000 Commit: Alexey Dokuchaev CommitDate: 2022-02-15 15:04:26 +0000 sysutils/fsearch: update the port to the latest patch release 0.1.2 Switch away from using g_utf8_collate_key_for_filename() for version sorting because it's way too slow. For comparison, sorting 3 million files by name takes less than a second (~850ms) with strverscmp() but more than a minute (~95s) with g_utf8_collate_key_for_filename(). So it's roughly a hundred times slower. Instead, pull strverscmp() implementation directly from the GNU library sources. --- sysutils/fsearch/Makefile | 9 ++- sysutils/fsearch/distinfo | 10 ++- .../files/patch-src_fsearch__string__utils.c | 94 ++++++++++++++++++++++ sysutils/fsearch/files/patch-src_string__utils.c | 30 ------- sysutils/fsearch/files/patch-src_string__utils.h | 10 --- sysutils/fsearch/pkg-plist | 11 +++ 6 files changed, 119 insertions(+), 45 deletions(-) diff --git a/sysutils/fsearch/Makefile b/sysutils/fsearch/Makefile index 7c21fa22efea..1e335dcc54fb 100644 --- a/sysutils/fsearch/Makefile +++ b/sysutils/fsearch/Makefile @@ -1,10 +1,12 @@ # Created by: Alexey Dokuchaev PORTNAME= fsearch -DISTVERSION= 0.1beta4 -DISTVERSIONPREFIX= v +PORTVERSION= 0.1.2 CATEGORIES= sysutils +PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ +PATCHFILES= 7f602118e0de9f524e71.diff:-p1 f0ee01b40156ddb36651.diff:-p1 + MAINTAINER= danfe@FreeBSD.org COMMENT= Fast file search utility for Unix-like systems @@ -24,5 +26,8 @@ USE_GNOME= cairo gdkpixbuf2 gtk30 intltool post-patch: @${REINPLACE_CMD} -e 's,v=UNKNOWN,v=${DISTVERSION},' \ ${WRKSRC}/build-aux/git-version-gen + @${PRINTF} '\n%s\n%s;\n' int \ + 'strverscmp(const char *, const char *)' \ + >> ${WRKSRC}/src/fsearch_string_utils.h .include diff --git a/sysutils/fsearch/distinfo b/sysutils/fsearch/distinfo index 7f23b98d211d..e468d1fcf2f6 100644 --- a/sysutils/fsearch/distinfo +++ b/sysutils/fsearch/distinfo @@ -1,3 +1,7 @@ -TIMESTAMP = 1582545022 -SHA256 (cboxdoerfer-fsearch-v0.1beta4_GH0.tar.gz) = a8664990194e476f7349c68e7c74c3eb56b5091fd6ef4a9f6581c3e408900464 -SIZE (cboxdoerfer-fsearch-v0.1beta4_GH0.tar.gz) = 160390 +TIMESTAMP = 1643482609 +SHA256 (cboxdoerfer-fsearch-0.1.2_GH0.tar.gz) = f80e10922812169e8437476d5fbe6d05249997c49b98f991d382a6d5566551b4 +SIZE (cboxdoerfer-fsearch-0.1.2_GH0.tar.gz) = 504787 +SHA256 (7f602118e0de9f524e71.diff) = cd24cf0cc3f07c3135d0cdb6981784b8bb254c12f8d0d7aabfe068417c17b36b +SIZE (7f602118e0de9f524e71.diff) = 693 +SHA256 (f0ee01b40156ddb36651.diff) = 75f01513f0c88e61715097495b22f920c5131b2c03956d54d5b94e53e7ec5a7a +SIZE (f0ee01b40156ddb36651.diff) = 1741 diff --git a/sysutils/fsearch/files/patch-src_fsearch__string__utils.c b/sysutils/fsearch/files/patch-src_fsearch__string__utils.c new file mode 100644 index 000000000000..d57fb73a7f75 --- /dev/null +++ b/sysutils/fsearch/files/patch-src_fsearch__string__utils.c @@ -0,0 +1,94 @@ +--- src/fsearch_string_utils.c.orig 2022-01-29 18:56:49 UTC ++++ src/fsearch_string_utils.c +@@ -214,3 +214,91 @@ fs_str_split(const char *src) { + + return (char **)g_ptr_array_free(new, FALSE); + } ++ ++/* Compare strings while treating digits characters numerically. ++ Copyright (C) 1997-2022 Free Software Foundation, Inc. ++ Contributed by Jean-François Bignolles , ++ 1997. */ ++ ++#include ++ ++/* states: S_N: normal, S_I: comparing integral part, S_F: comparing ++ fractional parts, S_Z: idem but with leading Zeroes only */ ++#define S_N 0x0 ++#define S_I 0x3 ++#define S_F 0x6 ++#define S_Z 0x9 ++ ++/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ ++#define CMP 2 ++#define LEN 3 ++ ++/* Compare S1 and S2 as strings holding indices/version numbers, ++ returning less than, equal to or greater than zero if S1 is less than, ++ equal to, or greater than S2. */ ++ ++int ++strverscmp (const char *s1, const char *s2) ++{ ++ const unsigned char *p1 = (const unsigned char *) s1; ++ const unsigned char *p2 = (const unsigned char *) s2; ++ ++ /* Symbol(s) 0 [1-9] others ++ Transition (10) 0 (01) d (00) x */ ++ static const uint_least8_t next_state[] = ++ { ++ /* state x d 0 */ ++ /* S_N */ S_N, S_I, S_Z, ++ /* S_I */ S_N, S_I, S_I, ++ /* S_F */ S_N, S_F, S_F, ++ /* S_Z */ S_N, S_F, S_Z ++ }; ++ ++ static const int_least8_t result_type[] = ++ { ++ /* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */ ++ ++ /* S_N */ CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, ++ /* S_I */ CMP, -1, -1, +1, LEN, LEN, +1, LEN, LEN, ++ /* S_F */ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, ++ /* S_Z */ CMP, +1, +1, -1, CMP, CMP, -1, CMP, CMP ++ }; ++ ++ if (p1 == p2) ++ return 0; ++ ++ unsigned char c1 = *p1++; ++ unsigned char c2 = *p2++; ++ /* Hint: '0' is a digit too. */ ++ int state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); ++ ++ int diff; ++ while ((diff = c1 - c2) == 0) ++ { ++ if (c1 == '\0') ++ return diff; ++ ++ state = next_state[state]; ++ c1 = *p1++; ++ c2 = *p2++; ++ state += (c1 == '0') + (isdigit (c1) != 0); ++ } ++ ++ state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))]; ++ ++ switch (state) ++ { ++ case CMP: ++ return diff; ++ ++ case LEN: ++ while (isdigit (*p1++)) ++ if (!isdigit (*p2++)) ++ return 1; ++ ++ return isdigit (*p2) ? -1 : diff; ++ ++ default: ++ return state; ++ } ++} diff --git a/sysutils/fsearch/files/patch-src_string__utils.c b/sysutils/fsearch/files/patch-src_string__utils.c deleted file mode 100644 index b41d4e1e32ea..000000000000 --- a/sysutils/fsearch/files/patch-src_string__utils.c +++ /dev/null @@ -1,30 +0,0 @@ ---- src/string_utils.c.orig 2020-02-24 11:50:22 UTC -+++ src/string_utils.c -@@ -16,6 +16,7 @@ - along with this program; if not, see . - */ - -+#include - #include - #include - #include -@@ -62,3 +63,19 @@ fs_str_copy (char *dest, char *end, const char *src) - return ptr; - } - -+int -+strverscmp (const char *s1, -+ const char *s2) -+{ -+ gchar *tmp1, *tmp2; -+ gint ret; -+ -+ tmp1 = g_utf8_collate_key_for_filename(s1, -1); -+ tmp2 = g_utf8_collate_key_for_filename(s2, -1); -+ -+ ret = strcmp(tmp1, tmp2); -+ -+ g_free(tmp1); -+ g_free(tmp2); -+ return ret; -+} diff --git a/sysutils/fsearch/files/patch-src_string__utils.h b/sysutils/fsearch/files/patch-src_string__utils.h deleted file mode 100644 index e8f329e07e9c..000000000000 --- a/sysutils/fsearch/files/patch-src_string__utils.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/string_utils.h.orig 2020-02-24 11:50:22 UTC -+++ src/string_utils.h -@@ -30,3 +30,7 @@ char * - fs_str_copy (char *dest, - char *end, - const char *src); -+ -+int -+strverscmp (const char *s1, -+ const char *s2); diff --git a/sysutils/fsearch/pkg-plist b/sysutils/fsearch/pkg-plist index 371098a772d1..7ab0d448348f 100644 --- a/sysutils/fsearch/pkg-plist +++ b/sysutils/fsearch/pkg-plist @@ -1,15 +1,23 @@ bin/fsearch +man/man1/fsearch.1.gz share/applications/fsearch.desktop +share/icons/hicolor/scalable/apps/io.github.cboxdoerfer.FSearch.svg +share/locale/ar/LC_MESSAGES/fsearch.mo +share/locale/ber/LC_MESSAGES/fsearch.mo share/locale/bg/LC_MESSAGES/fsearch.mo share/locale/ca/LC_MESSAGES/fsearch.mo share/locale/de/LC_MESSAGES/fsearch.mo share/locale/el/LC_MESSAGES/fsearch.mo +share/locale/en_GB/LC_MESSAGES/fsearch.mo share/locale/es/LC_MESSAGES/fsearch.mo share/locale/fi/LC_MESSAGES/fsearch.mo share/locale/fr/LC_MESSAGES/fsearch.mo share/locale/gl/LC_MESSAGES/fsearch.mo +share/locale/he/LC_MESSAGES/fsearch.mo share/locale/hu/LC_MESSAGES/fsearch.mo share/locale/id/LC_MESSAGES/fsearch.mo +share/locale/ie/LC_MESSAGES/fsearch.mo +share/locale/it/LC_MESSAGES/fsearch.mo share/locale/ja/LC_MESSAGES/fsearch.mo share/locale/ko/LC_MESSAGES/fsearch.mo share/locale/lt/LC_MESSAGES/fsearch.mo @@ -20,6 +28,9 @@ share/locale/pt/LC_MESSAGES/fsearch.mo share/locale/pt_BR/LC_MESSAGES/fsearch.mo share/locale/ru/LC_MESSAGES/fsearch.mo share/locale/sk/LC_MESSAGES/fsearch.mo +share/locale/sv/LC_MESSAGES/fsearch.mo +share/locale/te/LC_MESSAGES/fsearch.mo share/locale/tr/LC_MESSAGES/fsearch.mo +share/locale/tzm/LC_MESSAGES/fsearch.mo share/locale/uk/LC_MESSAGES/fsearch.mo share/locale/zh_CN/LC_MESSAGES/fsearch.mo