ports/155081: [rc.d][patch] net-p2p/transmission-daemon: don't override conf_dir and download_dir unconditionally

Anonymous swell.k at gmail.com
Sun Feb 27 11:20:10 UTC 2011

>Number:         155081
>Category:       ports
>Synopsis:       [rc.d][patch] net-p2p/transmission-daemon: don't override conf_dir and download_dir unconditionally
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 27 11:20:09 UTC 2011
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
# transmission-daemon-2.21
transmission_conf_dir= # default
transmission_download_dir= # config or default
Initializing value with `:=' ensures such a variable can be neither
undefined nor null. And `${foo:+-f ${foo}}' in transmission_flags always
expands with the right string, it could be reduced to just `-f ${foo}'.

So, by defining empty conf_dir and/or download_dir transmission should
infer default values from home directory, i.e. TRANSMISSION_HOME,
XDG_CONFIG_HOME, HOME in libtransmission/platform.c) and download_dir
from config file, too.

This is similar to how watch_dir is used which can be empty, too, while
at the same time it can be defined via config file.
--- a.diff begins here ---
Index: net-p2p/transmission-cli/files/transmission.in
RCS file: /a/.cvsup/ports/net-p2p/transmission-cli/files/transmission.in,v
retrieving revision 1.3
diff -u -p -r1.3 transmission.in
--- net-p2p/transmission-cli/files/transmission.in	27 Mar 2010 00:14:31 -0000	1.3
+++ net-p2p/transmission-cli/files/transmission.in	27 Feb 2011 02:42:57 -0000
@@ -33,8 +33,8 @@ load_rc_config ${name}
 : ${transmission_enable:="NO"}
 : ${transmission_user:="transmission"}
-: ${transmission_conf_dir:="%%PREFIX%%/etc/transmission/home"}
-: ${transmission_download_dir:="%%PREFIX%%/etc/transmission/home/Downloads"}
+: ${transmission_conf_dir="%%PREFIX%%/etc/transmission/home"}
+: ${transmission_download_dir="%%PREFIX%%/etc/transmission/home/Downloads"}
 transmission_flags=" \
 	${transmission_watch_dir:+-c ${transmission_watch_dir}} \
--- a.diff ends here ---

More information about the freebsd-ports-bugs mailing list