Bug 198217 - games/minecraft-server: avoid java-args.txt if DAEMON [PATCH]
Summary: games/minecraft-server: avoid java-args.txt if DAEMON [PATCH]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-03 11:07 UTC by Helge Oldach
Modified: 2015-05-19 10:07 UTC (History)
3 users (show)

See Also:


Attachments
patch (830 bytes, patch)
2015-03-03 11:08 UTC, Helge Oldach
no flags Details | Diff
Patch demonstrating radio options (1.34 KB, patch)
2015-03-09 16:51 UTC, Jonathan Price
freebsd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2015-03-03 11:07:53 UTC
Thank you for providing DAEMON support. There is a small glitch however: java-args.txt is installed even with the DAEMON knob turned on, but it is useless in this case as the parameters are supplied through /etc/rc.conf.

The attached patch fixes this.
Comment 1 Helge Oldach 2015-03-03 11:08:33 UTC
Created attachment 153706 [details]
patch
Comment 2 Jonathan Price 2015-03-03 16:25:44 UTC
Thankyou for the patch Helge. I have had a look and it appears to be fine.

I have a question regarding pkg-plist. Could you point me to some documentation explaining the %%NO_[option]%% syntax? I've not come across that before.
Comment 3 Helge Oldach 2015-03-03 17:13:50 UTC
Chapter 7.1 of the porter's handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist.html#plist-sub
Comment 4 Jonathan Price 2015-03-09 09:35:27 UTC
Upon further thought, I believe this change is not the most ideal one.

The DAEMON option is currently implemented as a standard option. This means that the functionality to run the port as a DAEMON is an additional set of functionality on top of the base functionality. Therefore, it would not be appropriate to remove any files if this option is selected.

This leaves two solutions:
- Don't remove the file if the DAEMON option is selected
- Change the current DAEMON option to a radio option. This would mean that the user would have to select either STANDALONE or DAEMON, at which point selectively installing files based on the chosen option would make more sense.

If anybody is interested in me implementing the second solution, please let me know. In the meantime I am going to close this change request.

Thanks once again to Helge for providing the request.
Comment 5 Helge Oldach 2015-03-09 09:59:19 UTC
Can't follow the argument. The file java-args.txt is not only unused, but its existence is completely misleading if DAEMON is on.

Unless I'm mistaken all other files are valid in all cases, so what is the point of not implementing a trivial modification and instead looking at more complex things? Keep it simple, please.
Comment 6 Jonathan Price 2015-03-09 16:51:11 UTC
Created attachment 154091 [details]
Patch demonstrating radio options

I apologise if I hadn't expressed my point clearly enough earlier. I have now produced a patch to demonstrate my thoughts.

This patch removes the DAEMON option, and instead offers two radio options, STANDALONE and DAEMON.

If you select STANDALONE, it installs java-args.txt and /usr/local/bin/minecraft-server.

If you select DAEMON, it installs /usr/local/etc/rc.d/minecraft

The issue I was having before, was that the DAEMON option was an additional option, rather than selecting daemon OR standalone, so technically speaking the DAEMON option should have given you the choice to run it as a daemon AND standalone, as you hadn't specified not to install the standalone files. Therefore, it would have caused confusing results for some users who didn't expect adding an option to remove files from the base install.

If you have time, please give this patch a quick test and see if you can understand what I'm trying to say.

I thank you for your continued time on this matter.
Comment 7 Jonathan Price 2015-05-07 09:43:40 UTC
This issue was resolved in #199564 so this bug can now be closed.