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.
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.
(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).
(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.
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(-)
Thank you for your contribution.