[Git][java-team/jtreg][master] Install jtreg under /usr/share/jtreg and use it as the default JT_HOME path

Emmanuel Bourg gitlab at salsa.debian.org
Sun Apr 12 23:33:18 BST 2020



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / jtreg


Commits:
1262e8f6 by Emmanuel Bourg at 2020-04-13T00:28:59+02:00
Install jtreg under /usr/share/jtreg and use it as the default JT_HOME path

- - - - -


4 changed files:

- debian/changelog
- debian/jtreg.install
- + debian/jtreg.links
- debian/patches/launchers.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+jtreg (5.0-b01-2) unstable; urgency=medium
+
+  * Team upload.
+  * Install jtreg under /usr/share/jtreg and use it as the default JT_HOME path
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Mon, 13 Apr 2020 00:28:39 +0200
+
 jtreg (5.0-b01-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/jtreg.install
=====================================
@@ -1,5 +1,5 @@
-dist/jtreg/lib/jtreg.jar /usr/share/java
-dist/jtreg/doc/jtreg/tag-spec.html /usr/share/doc/jtreg
-dist/jtreg/doc/jtreg/usage.txt /usr/share/doc/jtreg
-dist/jtreg/bin/jtdiff /usr/bin
-dist/jtreg/bin/jtreg /usr/bin
+dist/jtreg/lib/jtreg.jar                /usr/share/java
+dist/jtreg/doc/jtreg/tag-spec.html      /usr/share/doc/jtreg
+dist/jtreg/doc/jtreg/usage.txt          /usr/share/doc/jtreg
+dist/jtreg/bin/jtdiff                   /usr/share/jtreg/bin
+dist/jtreg/bin/jtreg                    /usr/share/jtreg/bin


=====================================
debian/jtreg.links
=====================================
@@ -0,0 +1,8 @@
+usr/share/jtreg/bin/jtreg               /usr/bin/jtreg
+usr/share/jtreg/bin/jtdiff              /usr/bin/jtdiff
+
+usr/share/java/javatest.jar             /usr/share/jtreg/lib/javatest.jar
+usr/share/java/jcommander.jar           /usr/share/jtreg/lib/jcommander.jar
+usr/share/java/jtreg.jar                /usr/share/jtreg/lib/jtreg.jar
+usr/share/java/junit4.jar               /usr/share/jtreg/lib/junit.jar
+usr/share/java/testng.jar               /usr/share/jtreg/lib/testng.jar


=====================================
debian/patches/launchers.patch
=====================================
@@ -1,188 +1,46 @@
-## Description: add some description
-## Origin/Author: add some origin or author
-## Bug: bug URL
+Description: Modifies the launcher scripts to specify the default Java and jtreg paths
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
 --- a/src/share/bin/jtdiff.sh
 +++ b/src/share/bin/jtdiff.sh
-@@ -37,40 +37,6 @@
+@@ -37,6 +37,10 @@
  #
  # jtdiff also provides an Ant task for direct invocation from Ant.
  
--# Determine jtdiff/JavaTest installation directory
--if [ -n "$JT_HOME" ]; then
--    if [ ! -r $JT_HOME/lib/jtreg.jar ];then
--        echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
--       exit 1;
--    fi
--else
--    # Deduce where script is installed
--    # - should work on most derivatives of Bourne shell, like ash, bash, ksh,
--    #   sh, zsh, etc, including on Windows, MKS (ksh) and Cygwin (ash or bash)
--    if type -p type 1>/dev/null 2>&1 && test -z "`type -p type`" ; then
--        myname=`type -p "$0"`
--    elif type type 1>/dev/null 2>&1 ; then
--        myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
--    elif whence whence 1>/dev/null 2>&1 ; then
--        myname=`whence "$0"`
--    fi
--    mydir=`dirname "$myname"`
--    p=`cd "$mydir" ; pwd`
--    while [ -n "$p" -a "$p" != "/" ]; do
--        if [ -r "$p"/lib/jtreg.jar ]; then JT_HOME="$p" ; break; fi
--        p=`dirname "$p"`
--    done
--    if [ -z "$JT_HOME" ]; then
--        echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
--    fi
--fi
--
--# Normalize JT_HOME if using Cygwin
--case "`uname -s`" in
--    CYGWIN* ) cygwin=1 ; JT_HOME=`cygpath -a -m "$JT_HOME"` ;;
--esac
--
--
- # Separate out -J* options for the JVM
- # Unset IFS and use newline as arg separator to preserve spaces in args
- DUALCASE=1  # for MKS: make case statement case-sensitive (6709498)
-@@ -88,36 +54,25 @@
- done
- unset DUALCASE
- 
--# Determine java for jtdiff, from JT_JAVA, JAVA_HOME, java
--if [ -n "$JT_JAVA" ]; then
--    if [ -d "$JT_JAVA" ]; then
--        JT_JAVA="$JT_JAVA/bin/java"
--    fi
--elif [ -n "$JAVA_HOME" ]; then
--    JT_JAVA="$JAVA_HOME/bin/java"
--else
++if [ -z "${JT_HOME}" ]; then
++    JT_HOME="/usr/share/jtreg"
++fi
++
+ # Determine jtdiff/JavaTest installation directory
+ if [ -n "$JT_HOME" ]; then
+     if [ ! -r $JT_HOME/lib/jtreg.jar ];then
+@@ -96,7 +100,7 @@
+ elif [ -n "$JAVA_HOME" ]; then
+     JT_JAVA="$JAVA_HOME/bin/java"
+ else
 -    JT_JAVA=java
-+# Java home directory
-+if [ -z "${JT_JAVA}" ]; then
-+    JT_JAVA="/usr/lib/jvm/default-java"
++    JT_JAVA=/usr/lib/jvm/default-java/bin/java
  fi
  
--# Verify java version (1.)5 or newer used to run jtdiff
--version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.agent.GetSystemProperty java.version 2>&1 |
--        grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
--
--if [ -z "$version" ]; then
--    echo "Cannot determine version of java to run jtdiff"
--    exit 1;
--elif [ "$version" -lt 5 ]; then
--    echo "java version 5 or later is required to run jtdiff"
--    exit 1;
-+if [ -z "${JT_HOME}" ] || [ ! -f "${JT_HOME}/jtreg.jar" ]; then
-+    JT_HOME="/usr/share/java"
- fi
- 
-+
- # And finally ...
- 
-+JT_CLASSPATH="${JT_HOME}/jtreg.jar:/usr/share/java/javatest.jar:/usr/share/java/jh.jar:/usr/share/java/junit4.jar"
-+
- IFS=$nl
- 
--"${JT_JAVA:-${JAVA_HOME:+$JAVA_HOME/bin/}java}" \
-+"${JT_JAVA}"/bin/java \
-     $javaOpts \
-     -Dprogram=`basename "$0"` \
--    -cp "${JT_HOME}/lib/jtreg.jar" \
-+    -cp "${JT_CLASSPATH}" \
-     com.sun.javatest.diff.Main \
-     $jtdiffOpts
+ # Verify java version (1.)5 or newer used to run jtdiff
 --- a/src/share/bin/jtreg.sh
 +++ b/src/share/bin/jtreg.sh
-@@ -68,36 +68,6 @@
+@@ -67,6 +67,9 @@
+     Linux ) if grep -qi Microsoft /proc/version ; then wsl=1 ; fi ;;
  esac
  
++if [ -z "${JT_HOME}" ]; then
++    JT_HOME="/usr/share/jtreg"
++fi
  
--# Determine jtreg/JavaTest installation directory
--if [ -n "$JT_HOME" ]; then
--    if [ ! -r $JT_HOME/lib/jtreg.jar ];then
--        echo "Invalid JT_HOME=$JT_HOME. Cannot find or read $JT_HOME/lib/jtreg.jar"
--       exit 1;
--    fi
--else
--    # Deduce where script is installed
--    # - should work on most derivatives of Bourne shell, like ash, bash, ksh,
--    #   sh, zsh, etc, including on Windows, MKS (ksh), Cygwin (ash or bash)
--    #   and Windows Subsystem for Linux (WSL)
--    if type -p type 1>/dev/null 2>&1 && test -z "`type -p type`" ; then
--        myname=`type -p "$0"`
--    elif type type 1>/dev/null 2>&1 ; then
--        myname=`type "$0" | sed -e 's/^.* is a tracked alias for //' -e 's/^.* is //'`
--    elif whence whence 1>/dev/null 2>&1 ; then
--        myname=`whence "$0"`
--    fi
--    mydir=`dirname "$myname"`
--    p=`cd "$mydir" ; pwd`
--    while [ -n "$p" -a "$p" != "/" ]; do
--        if [ -r "$p"/lib/jtreg.jar ]; then JT_HOME="$p" ; break; fi
--        p=`dirname "$p"`
--    done
--    if [ -z "$JT_HOME" ]; then
--        echo "Cannot determine JT_HOME; please set it explicitly"; exit 1
--    fi
--fi
--
--
- # Look for -jdk option as possible default to run jtreg
- # Unset IFS and use newline as arg separator to preserve spaces in args
- DUALCASE=1  # for MKS: make case statement case-sensitive (6709498)
-@@ -113,17 +83,9 @@
- done
- unset DUALCASE
- 
--# Determine java for jtreg, from JT_JAVA, JAVA_HOME, -jdk, java
--if [ -n "$JT_JAVA" ]; then
--    if [ -d "$JT_JAVA" ]; then
--        JT_JAVA="$JT_JAVA/bin/java"
--    fi
--elif [ -n "$JAVA_HOME" ]; then
--    JT_JAVA="$JAVA_HOME/bin/java"
--elif [ -n "$jdk" ]; then
--    JT_JAVA="$jdk/bin/java"
--else
+ # Determine jtreg/JavaTest installation directory
+ if [ -n "$JT_HOME" ]; then
+@@ -123,7 +126,7 @@
+ elif [ -n "$jdk" ]; then
+     JT_JAVA="$jdk/bin/java"
+ else
 -    JT_JAVA=java
-+# Java home directory
-+if [ -z "${JT_JAVA}" ]; then
-+    JT_JAVA="/usr/lib/jvm/default-java"
++    JT_JAVA=/usr/lib/jvm/default-java/bin/java
  fi
  
  # Fixup JT_JAVA, JTHOME as needed, if using Cygwin or WSL
-@@ -134,16 +96,8 @@
-     JT_HOME=`wslpath -a -m "$JT_HOME"`
- fi
- 
--# Verify java version (1.)7 or newer used to run jtreg
--version=`"$JT_JAVA" -classpath "${JT_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.agent.GetSystemProperty java.version 2>&1 |
--        grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
--
--if [ -z "$version" ]; then
--    echo "Cannot determine version of java to run jtreg"
--    exit 1;
--elif [ "$version" -lt 7 ]; then
--    echo "java version 7 or later is required to run jtreg"
--    exit 1;
-+if [ -z "${JT_HOME}" ] || [ ! -f "${JT_HOME}/jtreg.jar" ]; then
-+    JT_HOME="/usr/share/java"
- fi
- 
- # Separate out -J* options for the JVM
-@@ -170,10 +124,13 @@
- 
- # And finally ...
- 
-+JT_CLASSPATH="${JT_HOME}/jtreg.jar:/usr/share/java/javatest.jar:/usr/share/java/jh.jar:/usr/share/java/junit4.jar"
-+
- IFS=$nl
- 
--"${JT_JAVA}" \
-+"${JT_JAVA}"/bin/java \
-     $javaOpts \
-     -Dprogram=`basename "$0"` \
--    -jar "${JT_HOME}/lib/jtreg.jar" \
-+    -cp "${JT_CLASSPATH}" \
-+    com.sun.javatest.regtest.Main \
-     $jtregOpts



View it on GitLab: https://salsa.debian.org/java-team/jtreg/-/commit/1262e8f6e7a387565ae3fe1447ef93671033d019

-- 
View it on GitLab: https://salsa.debian.org/java-team/jtreg/-/commit/1262e8f6e7a387565ae3fe1447ef93671033d019
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200412/a6c8b432/attachment.html>


More information about the pkg-java-commits mailing list