Bug#935244: jh_depends: "-j headless" have no effect

Dmitry Smirnov onlyjob at debian.org
Wed Aug 21 07:28:18 BST 2019


Package: javahelper
Version: 0.72.9
Severity: normal
Control: block 864861 by -1
Tags: patch

Despite jh_depends invoked with option "-jheadless", the generated 
java:Depends contains "default-jre" instead of "default-jre-headless".

Looks like jh_depends is rather sloppy: is uses no "set -u" to ensure that 
there are no undefined variables and no surprise that some variables are used 
before they are defined...

The following patch fixes the problem:

~~~~
--- a/jh_depends
+++ b/jh_depends
@@ -210,9 +210,9 @@
    if [ -n "$WRAPPER" ]; then
       DEBDEPS="jarwrapper (>=0.5) $DEBDEPS"
    fi
    JVMDEPS=
-   if [ -n "`getarg j jvm`" ] && [ -z "$JVM" ]; then
+   if [ -n "`getarg j jvm`" ]; then
       JVM="`getarg j jvm`"
    fi

    if [ -n "$WRAPPER" ] && [ -z "$JVM" ]; then
~~~~

By the time when script checks "-j | --jvm" options, $JVM is always defined 
so removing '&& [ -z "$JVM" ]' condition is required to respect given 
parameters.

Thanks.

-- 
Regards,
 Dmitry Smirnov

---

The truth is incontrovertible, malice may attack it, ignorance may deride
it, but in the end; there it is.
        -- Winston Churchill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20190821/116741d4/attachment.sig>


More information about the pkg-java-maintainers mailing list