Bug 272066 - sysutils/scanbd: fix port tool warnings and make sure the scanbd.conf file is a sample
Summary: sysutils/scanbd: fix port tool warnings and make sure the scanbd.conf file is...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Robert Clausecker
URL: https://www.freshports.org/sysutils/s...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-18 14:04 UTC by Trenton Schulz
Modified: 2023-06-26 23:31 UTC (History)
3 users (show)

See Also:
trueos: maintainer-feedback+


Attachments
Update patch to make port behave better. (5.17 KB, patch)
2023-06-18 14:04 UTC, Trenton Schulz
trueos: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trenton Schulz 2023-06-18 14:04:50 UTC
Created attachment 242867 [details]
Update patch to make port behave better.

My original port submission did not have scanbd.conf marked as a sample. As a result, future updates will overwrite any local changes. Sample fixes this exact problem, so use that.

Since I was here, I ran things through rclint and used the port tool to exercise things a bit more. The port revision should be much more robust and usable for everyone! I apologize I didn't do that previously.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-06-25 15:31:35 UTC
In scanbd.conf, you should dynamically patch in the correct PREFIX.  We support compiling packages for a different PREFIX than /usr/local.  For example, you could have a static patch that just puts %%PREFIX%% into the file, then a pre-configure target that does something like

    ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' .../scanbd.conf

to patch in the right PREFIX.

There is a trailing space in scanbd.in.

I'm not very comfortable with you pointing the default configuration to the examples directory.   This directory is meant for examples, not configuration that can be hotwired into the tool.  Also, examples can be omitted if the port is built without the EXAMPLES option.  I'm not sure what a better solution would be.

Shall I commit the patch anyway?  You can fix these things in a future update.
Comment 2 Trenton Schulz 2023-06-26 06:01:42 UTC
(In reply to Robert Clausecker from comment #1)

Hi Robert,

Thanks for pointing these things out. Yes, I agree that to reference examples in the script seems wrong now. I think I may have been a bit too zealous in my reading of the porters handbook when I was trying to find a place for the files. The scripts that are provided are not necessarily required (one can create whatever script one wants), but are more shown as possible ways one can do things in the configuration file. If you have a better suggestion, I can put them another place (perhaps in etc with the provided scanner configurations?).

Thank you as well for the tip on replacement! I was a bit unsure what was the best route for this.

I will admit that this revision is not perfect, but it *is* much better than the previous version, as that one required you to go in and correct paths in the .conf file (and would overwrite your old configuration as well). Granted, no one else would have been bitten by that, but I was when I tried to recreate a jail from scratch.

So, I would prefer if you could commit this one, and I can work on a second revision afterward (likely over the weekend).
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-06-26 07:08:56 UTC
(In reply to Trenton Schulz from comment #2)

> If you have a better suggestion, I can put them another place (perhaps in etc
> with the provided scanner configurations?).

One thing you can do is to put a subdirectory into ${PREFIX}/etc for the configuration.  Install the scanner sample configuration files with file extension .sample but no @sample in pkg-plist.  Tell the user that if he wants to use the samples, he has to rename them to strip the .sample suffix.

> So, I would prefer if you could commit this one, and I can work on a second
> revision afterward (likely over the weekend).

Will do.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-06-26 23:28:53 UTC
A commit in branch main references this bug:

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

commit ff2941686756eeffa63a57949cf6a2150bc5d5fb
Author:     Trenton Schulz <trenton@norwegianrockcat.com>
AuthorDate: 2023-06-18 09:40:06 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-06-26 22:58:23 +0000

    sysutils/scanbd: Make the port better behaved.

    - Address issues in rclint, portlint and the port test tool.
    - make sure scanbd.conf is a sample file.

    PR:             272066

 sysutils/scanbd/Makefile                           | 12 +++++--
 sysutils/scanbd/files/patch-conf_scanbd.conf (new) | 38 ++++++++++++++++++++++
 sysutils/scanbd/files/scanbd.in                    | 24 +++++++++++---
 sysutils/scanbd/pkg-plist                          | 12 +++----
 4 files changed, 73 insertions(+), 13 deletions(-)
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-06-26 23:31:40 UTC
Thank you for your contribution.