Bug 270657 - [NEW PORT] sysutils/plocate - locate that can find all files
Summary: [NEW PORT] sysutils/plocate - locate that can find all files
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-05 16:38 UTC by sec
Modified: 2023-05-18 08:25 UTC (History)
1 user (show)

See Also:


Attachments
new port patch (12.22 KB, patch)
2023-04-05 16:38 UTC, sec
no flags Details | Diff
Updated port (16.42 KB, patch)
2023-05-04 09:09 UTC, sec
sec: maintainer-approval+
Details | Diff
Updates new port patch (17.63 KB, patch)
2023-05-14 08:30 UTC, sec
sec: maintainer-approval+
Details | Diff
Updated new port patch (17.67 KB, patch)
2023-05-15 17:33 UTC, sec
sec: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sec 2023-04-05 16:38:58 UTC
Created attachment 241313 [details]
new port patch

This is a new port of plocate. It is a modern locate that indexes all files but only shows the ones you have read access for.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-05-03 18:59:28 UTC
Thank you for your submission.  Please check the following issues:

 - please prefer DISTVERSION over PORTVERSION if possible
 - do not use REINPLACE_CMD for static replacements.  Instead, supply patch
   files.  Use the "make makepatch" mechanism to generate these (see § 4.4
   Porter's Handbook)
 - please use /var/db instead of ${PREFIX}/var/db for database files.
 - avoid not printing out shell commands in the Makefile
 - including a header file directly from FILESDIR is unconventional but ok.

Rest looks ok.  Will proceed with a build test once you address these issues.

Please make sure to set "maintainer-approval" on your patches so they are more likely to be looked at.
Comment 2 sec 2023-05-04 09:09:06 UTC
Created attachment 241965 [details]
Updated port
Comment 3 sec 2023-05-04 09:10:39 UTC
Addressed your comments:
- use DISTVERSION
- added patch files & removed use of REINPLACE_CMD
- moved database to /var/db
- copied compat c file & header to WORKDIR during compilation
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-05-04 11:42:10 UTC
Thank you for your updated submission.  Here are some additional issues I found

 - your patch generates a directory plocate in the root of the ports tree.
   The port needs to be in a subdirectory of its category, e.g. in directory
   sysutils/plocate.
 - Make sure to hook up your new port in sysutils/Makefile
 - You request that a group plocate be generated.  Please add an entry for this
   group to the GIDs file in the root of the ports collection.
 - LICENSE should be GPLv2+ as README has the “or any later version” clause

Port looks good otherwise and builds fine!  Will likely be able to commit once these three issues are addressed.
Comment 5 sec 2023-05-14 08:30:52 UTC
Created attachment 242160 [details]
Updates new port patch

Adressed the comments:
+ changed License
+ added port to sysutils/Makefile
+ added GID allocation
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-05-14 08:44:03 UTC
Looking better!  I found two additional issues in my extended testing:

 - your port misses USES=pkgconfig.  Without it, it can't find libzstd.
 - your port stages a stray a CACHEDIR.TAG file.  Either patch the build
   scripts so the file is no longer staged or add it to pkg-plist:

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: /var/db/plocate/CACHEDIR.TAG
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1
Comment 7 sec 2023-05-15 17:33:37 UTC
Created attachment 242198 [details]
Updated new port patch

Added CACHEDIR.TAG to plist
Added pkgconfig to USES
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2023-05-15 19:21:31 UTC
Thanks.  Will commit with my next batch.
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-05-18 08:21:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1a556fa3ec8dbea28a7b34b2e9e2f036b0276ad6

commit 1a556fa3ec8dbea28a7b34b2e9e2f036b0276ad6
Author:     Stefan `Sec` Zehl <sec@42.org>
AuthorDate: 2023-05-14 08:26:17 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
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 (new)                    |  34 ++++
 sysutils/plocate/distinfo (new)                    |   3 +
 sysutils/plocate/files/315.plocate.in (new)        |  32 ++++
 sysutils/plocate/files/mntent.h (new)              |  62 ++++++++
 sysutils/plocate/files/mntent_compat.c++ (new)     | 177 +++++++++++++++++++++
 sysutils/plocate/files/patch-conf.cpp (new)        |  11 ++
 .../plocate/files/patch-io__uring__engine.h (new)  |  10 ++
 sysutils/plocate/files/patch-meson.build (new)     |  56 +++++++
 sysutils/plocate/files/patch-updatedb.cpp (new)    |  11 ++
 sysutils/plocate/files/updatedb.conf.sample (new)  |   1 +
 sysutils/plocate/pkg-descr (new)                   |   5 +
 sysutils/plocate/pkg-plist (new)                   |   9 ++
 14 files changed, 413 insertions(+), 1 deletion(-)
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2023-05-18 08:25:36 UTC
Thank you for your submission.