Bug 247204 - sysutils/bastille has incorrect default configuration file handling
Summary: sysutils/bastille has incorrect default configuration file handling
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kyle Evans
Depends on: 245630
  Show dependency treegraph
Reported: 2020-06-12 13:20 UTC by Paul Mather
Modified: 2021-01-16 03:47 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (christer.edwards)


Note You need to log in before you can comment on or make changes to this bug.
Description Paul Mather 2020-06-12 13:20:24 UTC
The sysutils/bastille port uses @sample in pkg-plist to designate its default configuration file.  However, it lists the "target_file" name, not the "sample_file" name.  This causes any local modifications to /usr/local/etc/bastille/bastille.conf to be overwritten when the package is updated.

A suggested fix is to change the config file pkg-plist entry to the following:

@sample %%ETCDIR%%/bastille.conf.sample

and to rename the distribution file in the port "bastille.conf.sample".

Note, in Example 8.3 "Real Life Example, How @sample is Implemented" in the FreeBSD Porter's Handbook (https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-keywords.html#plist-keywords-sample-example) it's clear that if only one filename is present in a @sample line then the real target file is assumed to be that filename minus the ".sample" suffix: ''target_file="${sample_file%.sample}"''  This is also stated in Section 8.6.9 ("@sample file [file]"), though the language wording is not 100% clear.

Section 8.3 ("Configuration Files") is clear in recommending the single-filename variant of @sample, using ".sample" as the suffix.  The Bastille port should be changed to adhere with this recommendation.
Comment 1 Sven R 2020-06-16 10:18:37 UTC
This is already fixed in the latest version which has not been committed yet. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245630
Comment 2 Kyle Evans freebsd_committer 2020-06-17 03:00:37 UTC
Deciding how to handle this... I missed this prior to committing the update, otherwise I would have split out the .sample change and MFH'd it.
Comment 3 Christer Edwards 2021-01-16 03:47:39 UTC
I believe this can be closed based on #245630