Bug#769526: xlshlt: xslhlt should use configuration file provided by package by default
16.11.2014 12:54, Eugene Zhukov пишет: Hi and thank you for your bug report! I examined the patch and have a question about it. What is the purpose of } else if (new File(xslthl-config.xml).isFile()) {? As far as I understand it will always be true. What did I miss? I would only change configFilename = xslthl-config.xml; to configFilename = /usr/share/xslthl/highlighters/xslthl-config.xml; Yes, the purpose of this case is to keep current behaviour. I'm not sure that this file should places in /etc/ directory. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#769526: xlshlt: xslhlt should use configuration file provided by package by default
Thanks for clarifications Niels and Vasiliy. I will upload the fix shortly. As of xslthl-config.xml being in /etc, I don't think this is a configuration file a user would want to change (arguably it's in a preferred form of modification) - it's either provided or not. Eugene -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#769526: xlshlt: xslhlt should use configuration file provided by package by default
Hi and thank you for your bug report! I examined the patch and have a question about it. What is the purpose of } else if (new File(xslthl-config.xml).isFile()) {? As far as I understand it will always be true. What did I miss? I would only change configFilename = xslthl-config.xml; to configFilename = /usr/share/xslthl/highlighters/xslthl-config.xml; -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#769526: xlshlt: xslhlt should use configuration file provided by package by default
On 2014-11-16 10:54, Eugene Zhukov wrote: Hi and thank you for your bug report! I examined the patch and have a question about it. What is the purpose of } else if (new File(xslthl-config.xml).isFile()) {? As far as I understand it will always be true. What did I miss? I would only change configFilename = xslthl-config.xml; to configFilename = /usr/share/xslthl/highlighters/xslthl-config.xml; __ This is the maintainer address of Debian's Java team http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers. Please use debian-j...@lists.debian.org for discussions and questions. Hi, I suppose the purpose of the } else if(new File(...) is to keep the current behaviour of using ./xslthl-config.xml if it exists (in preference to the global one). On a related note, if xslthl-config.xml is a file that the end user might want to change (i.e. it contains configuration), then the Debian package should look for it in /etc (possibly falling back to the /usr/share one if the /etc variant does not exist). ~Niels Ref: https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#769526: xlshlt: xslhlt should use configuration file provided by package by default
Package: xlshlt Version: xslhlt Severity: minor Tags: patch Dear Maintainer, xslhlt package provides the standard configuration file /usr/share/xslthl/highlighters/xslthl-config.xml within. But unfortunately I always have to set filename explicitly by java command-line option «-Dxslthl.config» because xslhlt searches this file in a current directory by default. This behaviour is acceptable for general jar package, but in Debian system it is better to use system-wide configuration file (/usr/share/xslthl/highlighters /xslthl-config.xml) by default. This way eliminates inconvenient point with setting command-line argument for Java applications. -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (500, 'testing'), (500, 'stable'), (102, 'unstable'), (101, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.16-3-amd64 (SMP w/4 CPU cores) Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash --- a/src/main/java/net/sf/xslthl/Config.java +++ b/src/main/java/net/sf/xslthl/Config.java @@ -408,9 +408,11 @@ logger.config(No config file specified, falling back to default behavior); if (System.getProperty(CONFIG_PROPERTY) != null) { configFilename = System.getProperty(CONFIG_PROPERTY); -} else { +} else if (new File(xslthl-config.xml).isFile()) { configFilename = xslthl-config.xml; -} +} else { +configFilename = /usr/share/xslthl/highlighters/xslthl-config.xml; +} } logger.info(String.format(Loading Xslthl configuration from %s,