Bug 273296 - sysutils/bacula-server: fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in bacula-dir rc.d script
Summary: sysutils/bacula-server: fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in ba...
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: Dan Langille
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-22 17:23 UTC by Lars Herschke
Modified: 2023-08-23 12:47 UTC (History)
2 users (show)

See Also:
lhersch: maintainer-feedback? (dvl)


Attachments
fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in bacula-dir rc.d script (12.00 KB, application/octet-stream)
2023-08-22 17:23 UTC, Lars Herschke
no flags Details
fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in bacula-dir rc.d script (2.23 KB, patch)
2023-08-22 17:26 UTC, Lars Herschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Herschke 2023-08-22 17:23:39 UTC
Created attachment 244284 [details]
fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in bacula-dir rc.d script

The two replacements mentioned above no longer work since revision 448638. The error was then included in the newer Bacula servers.

https://svnweb.freebsd.org/ports?view=revision&revision=448638
Comment 1 Lars Herschke 2023-08-22 17:26:03 UTC
Created attachment 244285 [details]
fix %%REQ_MYSQL%% and %%REQ_PGSQL%% replacement in bacula-dir rc.d script
Comment 2 Dan Langille freebsd_committer freebsd_triage 2023-08-22 18:34:53 UTC
wow, thanks for mentioning this.
Comment 3 Dan Langille freebsd_committer freebsd_triage 2023-08-22 20:01:20 UTC
At present, it looks like this:

# REQUIRE: DAEMON %%REQ_MYSQL%% %%REQ_PGSQL%%

This is how that was set during bacula5 days:

SUB_LIST+=		REQ_MYSQL=mysql REQ_PGSQL=""

See https://cgit.freebsd.org/ports/tree/sysutils/bacula5-server/Makefile?id=ae6ca1f5b3de7a3801fa1c7d553fc4b949e816d5#n132
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-08-22 20:02:35 UTC
A commit in branch main references this bug:

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

commit 9a1289a8b3d2d0c8a0e1fc3c8937332b2136cf58
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2023-08-22 19:49:16 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2023-08-22 20:01:44 +0000

    sysutils/bacula*-server: set rc.d REQUIRES

    Correctly set the REQUIRES for bacula-dir to one of:
    * mysql
    * postgresql

    This setting was lost sometime after bacula5-server

    While here, remove a space within files/bacula-dir.in so the resulting
    REQUIRES contains only one space.

    PR:             273296

 sysutils/bacula11-server/Makefile            | 5 ++++-
 sysutils/bacula11-server/files/bacula-dir.in | 2 +-
 sysutils/bacula13-server/Makefile            | 5 ++++-
 sysutils/bacula13-server/files/bacula-dir.in | 2 +-
 sysutils/bacula9-server/Makefile             | 6 ++++--
 sysutils/bacula9-server/files/bacula-dir.in  | 2 +-
 6 files changed, 15 insertions(+), 7 deletions(-)
Comment 5 Dan Langille freebsd_committer freebsd_triage 2023-08-22 20:10:31 UTC
Thank you
Comment 6 Lars Herschke 2023-08-22 20:46:12 UTC
But you can choose MYSQL and PGSQL as backend at the same time. That's why I used SUB_LIST and SUB_LIST_OFF.
Comment 7 Dan Langille freebsd_committer freebsd_triage 2023-08-22 20:48:10 UTC
(In reply to Lars Herschke from comment #6)
I apologize. I did not notice the patch. Sorry about that. I will fix now.
Comment 8 Lars Herschke 2023-08-22 21:02:26 UTC
The += in SUB_LIST is also not necessary in my opinion. The Porter's manual says the following about this.

"When option OPT is selected, the value of OPT_ABOVEVARIABLE, if defined, is appended to ABOVEVARIABLE. OPT_ABOVEVARIABLE_OFF works the same way, but when OPT is not selected."
Comment 9 Dan Langille freebsd_committer freebsd_triage 2023-08-22 21:05:09 UTC
(In reply to Lars Herschke from comment #8)
I agreee. Thank you. They have been removed.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-08-22 22:58:03 UTC
A commit in branch main references this bug:

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

commit 287a7ddd9b6935b8eb93775b6940eb8060e2ea31
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2023-08-22 22:51:59 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2023-08-22 22:57:55 +0000

    sysutils/bacula*-server: rc.d corrections

    When both MySQL and PostgreSQL are selected, make sure the rc.d script
    is correct. Further more, I must reverse my clever idea to "remove a
    space within files/bacula-dir.in".

    Next time, I should notice the PR contains a patch for the problem I'm
    fixing.

    PR:             273296

 sysutils/bacula11-server/Makefile            | 8 +++++---
 sysutils/bacula11-server/files/bacula-dir.in | 2 +-
 sysutils/bacula13-server/Makefile            | 8 +++++---
 sysutils/bacula13-server/files/bacula-dir.in | 2 +-
 sysutils/bacula9-server/Makefile             | 8 +++++---
 sysutils/bacula9-server/files/bacula-dir.in  | 2 +-
 6 files changed, 18 insertions(+), 12 deletions(-)
Comment 11 Dan Langille freebsd_committer freebsd_triage 2023-08-22 23:04:56 UTC
(In reply to Lars Herschke from comment #8)
Thank you for your help.

I regret not noticing the patch.
Comment 12 Fernando Apesteguía freebsd_committer freebsd_triage 2023-08-23 06:44:05 UTC
^Triage: assign to committer who resolved the issue.

Dan, can this PR be closed?
Comment 13 Lars Herschke 2023-08-23 07:01:12 UTC
Thanks for your really fast handling of the PR.
Comment 14 Dan Langille freebsd_committer freebsd_triage 2023-08-23 12:47:52 UTC
(In reply to Fernando Apesteguía from comment #12)
Yes, thanks.